Variance decomposition for brms models
model_summary(brmsfit)
Returns a data frame with the summaries of posterior estimates.
if (FALSE) { # \dontrun{
md = dplyr::starwars
# Centering variables
md = md %>%
dplyr::select(mass, sex, species) %>%
dplyr::mutate(mass = log(mass),
sex = dplyr::recode(sex, "male" = 1,
"female" = -1,
"hermaphroditic" = 0,
"none" = as.numeric(NA)))
mod = brms_model(Chainset = 2,
Response = "mass",
FixedEffect = "sex",
RandomEffect = "species",
Family = "gaussian",
Data = md)
model_summary(mod)
} # }