[R] multiple imputation with fit.mult.impute in Hmisc
Jonathan Baron
baron at psych.upenn.edu
Sun Jul 27 20:47:30 CEST 2003
I have always avoided missing data by keeping my distance from
the real world. But I have a student who is doing a study of
real patients. We're trying to test regression models using
multiple imputation. We did the following (roughly):
f <- aregImpute(~ [list of 32 variables, separated by + signs],
n.impute=20, defaultLinear=T, data=t1)
# I read that 20 is better than the default of 5.
# defaultLinear makes sense for our data.
fmp <- fit.mult.impute(Y ~ X1 + X2 ... [for the model of interest],
xtrans=f, fitter=lm, data=t1)
and all goes well (usually) except that we get the following
message at the end of the last step:
Warning message: Not using a Design fitting function;
summary(fit) will use standard errors, t, P from last imputation
only. Use Varcov(fit) to get the correct covariance matrix,
sqrt(diag(Varcov(fit))) to get s.e.
I did try using sqrt(diag(Varcov(fmp))), as it suggested, and it
didn't seem to change anything from when I did summary(fmp).
But this Warning message sounds scary. It sounds like the whole
process of multiple imputation is being ignored, if only the last
one is being used.
So I discovered I could get rid of this warning by loading the
Design library and then using ols instead of lm as the fitter in
fit.mult.imput. It seems that ols provides a variance/covariance
matrix (or something) that fit.mult.impute can use.
But here I am beyond my (very recently acquired) understanding of
what this is all about.
Should I worry about that warning message? Or am I maybe off the
track in some larger way?
--
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R page: http://finzi.psych.upenn.edu/
More information about the R-help
mailing list