brms (version 1.10.2)

coef.brmsfit: Extract Model Coefficients

Description

Extract model coefficients, which are the sum of population-level effects and corresponding group-level effects

Usage

# S3 method for brmsfit
coef(object, summary = TRUE, robust = FALSE,
  probs = c(0.025, 0.975), old = FALSE, estimate = c("mean", "median"),
  ...)

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 deivation (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.

old

Logical; indicates if the old implementation of this method (prior to version 1.7.0) should be used. Defaults to FALSE.

estimate

(Deprecated) The point estimate to be calculated for the group-level effects, either "mean" or "median".

...

Further arguments to be passed to the function specified in estimate.

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.

If old is TRUE: A list of matrices (one per grouping factor), with factor levels as row names and group-level effects as column names.

Examples

Run this code
# NOT RUN {
fit <- brm(count ~ log_Age_c + log_Base4_c * Trt_c + (1+Trt_c|visit), 
           data = epilepsy, family = gaussian(), chains = 2)
## extract population and group-level coefficients separately
fixef(fit)
ranef(fit)
## extract combined coefficients 
coef(fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace