Assume we use the following example from the mice
package:
imp <- mice(nhanes, m=5, print = FALSE, seed = 55152)
I want to obtain the means of nhanes$chl
grouped by nhanes$hyp
. Without using multiple inputation, one would do:
nhanes %>%
group_by(hyp) %>%
summarise(chl = mean(chl, na.rm = T))
How can I obtain such pooled estimates of means of chl
per group of hyp
after multiple imputation with mice
?