# NOT RUN {
library(mice)
imp <- mice(nhanes2)
# fit the model using mice and lm
fit_imp1 <- with(lm(bmi~age+hyp+chl), data = imp)
summary(pool(fit_imp1))
# fit the model using brms
fit_imp2 <- brm_multiple(bmi~age+hyp+chl, data = imp, chains = 1)
summary(fit_imp2)
plot(fit_imp2, pars = "^b_")
# investigate convergence of the original models
fit_imp2$rhats
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab