I am somewhat new to mice but I am trying my best. So I successfully imputed my data and created five datasets.

For the sake of simplicity, let's just use the nhanes dataset that comes with mice

 imp <- mice(nhanes, seed = 23109)

In my paper, I need to show basic descriptives (so for example: mean, standard deviation, skewness, kurtosis etc.). I understand that I can pool the parameters and results of my analysis with Rubin's rules using the following syntax:

fit <- with(imp, lm(chl ~ age + bmi))

Call: pool(object = fit)
Pooled coefficients:
(Intercept) age bmi
-34.158914 34.330666 6.212025
Fraction of information about the coefficients missing due to nonresponse:
(Intercept) age bmi
0.5747265 0.7501284 0.4795427

But how would I go about this to report basic descriptives? Is there a way to combine these and a function in the mice package that does this for me, or do I have to do this manually? So for example I tried:

mean.fit <- with(data=imp, expr=mean(bmi))

and , I get the warning:

Error in pool(mean.fit) : Object has no coef() method. 

which obviously means that is not how it should be done.

A different (and easier) possibility would be to pick just one of the imputed datasets to showcase (they are all very similar anyway. However, it feels like this wouldn't be a recommended thing to do because the whole upside of using multiple imputation should be that I am not pretending that the imputed values are the real values but that they come with a certain uncertainty.

If anyone could help me, I'd be very happy. Thanks.

  • $\begingroup$ I had this problem a few years ago. I cannot now remember what I did. I don't have time to dig out my archives tonight, but I'll have a look tomorrow. $\endgroup$ – timbp Jul 19 '18 at 9:44

If your goal is just to complete descriptives with no standard error around the descriptives (i.e., no confidence interval around the sample mean or sample standard deviation), you can use complete() to recover the imputed data sets and then perform actions on them. For example, to compute the average sample mean and variance across the imputations, you might do the following:

imp.data <- complete(imp, "long")
(means <- with(imp.data, tapply(bmi, .imp, mean)))
(variances <- with(imp.data, tapply(bmi, .imp, var)))

If you want inference, you can manually apply Rubin's rules to the estimates.

| cite | improve this answer | |

Consider using miceadds package if you want to calculate standard deviations etc. See https://www.rdocumentation.org/packages/miceadds/versions/3.5-14/topics/with.miceadds

| cite | improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.