# NOT RUN {
# model with population-level effects only
fit1 <- brm(rating ~ treat + period + carry,
data = inhaler, family = "gaussian")
w1 <- WAIC(fit1)
# model with an additional varying intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "gaussian")
w2 <- WAIC(fit2)
# compare both models
compare_ic(w1, w2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab