I am trying to get R^2 estimates using a multiple-imputed dataset using mice, but there seems to be a problem with the package. Every time I use pool.r.squared, the fraction of information missing due to nonresponse (fmi) comes out as NaN.
Looking at the source code for the pool.r.squared function, it looks like the issue is that it calls pool.scalar, which includes a function called barnard.rubin that is supposed to return df, but that funciton doesn't exist. Thus, the df is not computed and NaN is returned.
Is there some dependent package I'm missing? I am using R version 3.4.4 and mice v3.4.0.
For example, when I do:
library(mice) data("mtcars") mtc <- ampute(mtcars[,1:4], prop=.2) mtc <- mtc$amp mimp <- mice(mtc) fit <-with(mimp,lm(mpg~hp)) pool.r.squared(fit)
I get this output...
est lo 95 hi 95 fmi R^2 0.5998103 0.3358283 0.7842701 NaN