if (FALSE) {
# model with population-level effects only
fit1 <- brm(rating ~ treat + period + carry,
data = inhaler)
(loo1 <- loo_subsample(fit1))
# model with an additional varying intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
data = inhaler)
(loo2 <- loo_subsample(fit2))
# compare both models
loo_compare(loo1, loo2)
}
Run the code above in your browser using DataLab