#model with fixed effects only
fit1 <- brm(rating ~ treat + period + carry,
data = inhaler, family = "gaussian")
WAIC(fit1)
#model with an additional random intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "gaussian")
#compare both models
WAIC(fit1, fit2)
Run the code above in your browser using DataLab