Learn R Programming

brms (version 0.9.1)

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 class 'brmsfit':
coef(object, estimate = "mean", ...)

Arguments

object
An object of class brmsfit
estimate
The point estimate to be calculated for the random effects, either "mean" or "median".
...
Further arguments to be passed to the function specified in estimate

Value

  • A list of matrices (one per grouping factor), with factor levels as row names and coefficients as column names

Examples

Run this code
fit <- brm(count ~ log_Age_c + log_Base4_c * Trt_c + (1+Trt_c|visit), 
           data = epilepsy, family = "poisson", chains = 1)
## extract fixed and random effects coefficients seperately
fixef(fit)
ranef(fit)
## extract combined coefficients     
coef(fit)

Run the code above in your browser using DataLab