9.9 Number of imputations revisited
In Section 9.4.6 you were instructed to simply use 20 imputations. That approach was taken so as to not complicate the initial presentation of the other aspects of multiple imputation. However, the correct number of imputations needed is actually a function of information that is obtained after fitting the regression model. von Hippel (2020) suggests to first fit the imputation model 20 times, then fit your regression model, and then recompute the number of imputations using the how_many_imputations()
function in the howManyImputations
library (Errickson 2023). If that number is larger than 20, then re-fit the imputation model with the larger number of imputations. See also von Hippel (2019).
For example:
imp <- mice(nhanes,
seed = 3,
m = 20,
print = F)
# Temporary fit, just to get the number of imputations
fit <- with(imp,
lm(LBDGLUSI_trans ~ BMXWAIST + smoker + RIDAGEYR +
RIAGENDR + race_eth + income))
howManyImputations::how_many_imputations(fit)
## [1] 7
Since we already fit the model with m = 20
imputations, and having more imputations is better than fewer, there is no need to re-fit the imputation and regression models. However, if how_many_imputations()
had returned a number larger than 20, then we would re-fit the imputation model with that larger number and then re-fit the regression model with the updated mids
object.