-
Notifications
You must be signed in to change notification settings - Fork 0
/
coef.brmsfit.Rmd
52 lines (41 loc) · 1.7 KB
/
coef.brmsfit.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: "``brms::coef.brmsfit``"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(brms)
```
Extract Model Coefficients
#### Description
Extract model coefficients, which are the sum of population-level effects and corresponding grouplevel effects
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
coef(object, summary = TRUE, robust = FALSE,
probs = c(0.025, 0.975), ...)
</code></pre>
#### Arguments
* ``object``: An object of class brmsfit.
* ``summary``: Should summary statistics (i.e. means, sds, and 95% intervals) be returned instead of the raw values? Default is TRUE.
* ``robust``: If FALSE (the default) the mean is used as the measure of central tendency and the standard deviation as the measure of variability. If TRUE, the median and the
median absolute deviation (MAD) are applied instead. Only used if summary is TRUE.
* ``probs``: The percentiles to be computed by the quantile function. Only used if summary is TRUE.
* `` ... ``: Further arguments passed to fixef.brmsfit and ranef.brmsfit.
#### Examples
```{r}
fit <- brm(count ~ zAge + zBase * Trt + (1+Trt|visit),
data = epilepsy, family = gaussian(), chains = 2)
## extract population and group-level coefficients separately
fixef(fit)
ranef(fit)
## extract combined coefficients
coef(fit)
```
#### Value
If old is FALSE: A list of arrays (one per grouping factor). If summary is TRUE, names of the first
dimension are the factor levels and names of the third dimension are the group-level effects. If
summary is FALSE, names of the second dimension are the factor levels and names of the third
dimension are the group-level effects.
#### Author(s)
Paul-Christian Buerkner <[email protected]>