I'm not sure how accurate this is, but here's an attempt. Despite the fact that method="mean" should indicate an unconditional average value, it follows from the documentation that prdictorMatrix does not change accordingly.
Typically, residual NA occurs because predictors suffer from multicollinearity, or because there are too few cases for each variable (so the imputation model cannot be estimated). However, method="mean" should not behave this way.
Here is what I did:
dfn <- read.table(text="abcd 0 1 0 1 1 0 0 0 0 0 0 0 NA 0 0 0 0 0 0 NA", header=TRUE) imp <- mice( dfn, method="mean", predictorMatrix=diag(ncol(dfn)) ) complete(imp)
You can try this using your actual dataset, but you should carefully check the results. For example, do:
sapply(dfn, function(x) mean(x,na.rm=TRUE))
The means for each variable should be identical to the means that were imputed. Please let me know if this solves your problem.
source share