Skip to contents

This function takes a brms model fit for a factorial design and returns all design cells along with their encoding in the regression model.

Usage

get_cell_definitions(fit)

Arguments

fit

An object of class brmsfit.

Value

A tibble containing the minimal design matrix.

Note

The faintr package currently does not support multivariate models and models that use families categorical, dirichlet, multinomial, and logistic_normal. Furthermore, models must not include special effect terms mo(), mi(), me(), and cs() for fixed effects. Also note that faintr currently does not support models where the intercept is a population-level parameter (class b), as is the case when using the 0 + Intercept syntax in the brm function call.

References

Bürkner, P.-C. (2017). brms: An R Package for Bayesian Multilevel Models Using Stan. Journal of Statistical Software, 80(1), 1-28. doi:10.18637/jss.v080.i01

Examples

if (FALSE) {
# fit a linear mixed effects model on data from a 2 x 2 factorial design
## regress voice pitch against gender and context
fit <- brms::brm(formula = pitch ~ gender * context + (1 | subject + sentence),
                 data = politeness)

# check encoding scheme used in the model
get_cell_definitions(fit)
}