brms (version 0.10.0)

ranef.brmsfit: Extract Group-Level Estimates

Description

Extract the group-level ('random') effects of each level from a brmsfit object.

Usage

"ranef"(object, estimate = "mean", var = FALSE, ...)

Arguments

object
An object of class brmsfit.
estimate
The point estimate to be calculated for the random effects, either "mean" or "median".
var
logical; indicating if the covariance matrix for each random effects should be computed.
...
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 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 = "poisson", chains = 1)
# ## group-level means with corresponding covariances
# rf <- ranef(fit, var = TRUE)
# attr(rf, "var")
# ## group-level medians
# ranef(fit, estimate = "median")                                                        
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace