Learn R Programming

brms (version 2.1.0)

gr: Set up basic grouping terms in brms

Description

Function used to set up a basic grouping term in brms. The function does not evaluate its arguments -- it exists purely to help set up a model with grouping terms. gr is called implicitly inside the package and there is usually no need to call it directly.

Usage

gr(...)

Arguments

...

One or more terms containing grouping factors.

See Also

brmsformula

Examples

Run this code
# NOT RUN {
# model using basic lme4-style formula
fit1 <- brm(count ~ Trt_c + (1|patient), data = epilepsy)
summary(fit1)
# equivalent model using 'gr' which is called anyway internally
fit2 <- brm(count ~ Trt_c + (1|gr(patient)), data = epilepsy)
summary(fit2)
WAIC(fit1, fit2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab