# example for multiple imputed datasets
if (require("mice")) {
data("nhanes2")
imp <- mice(nhanes2, printFlag = FALSE)
predictions <- lapply(1:5, function(i) {
m <- lm(bmi ~ age + hyp + chl, data = complete(imp, action = i))
ggpredict(m, "age")
})
pool_predictions(predictions)
}
Run the code above in your browser using DataLab