简体   繁体   中英

Residuals sum of squared for multiple imputation using mice package in R

With the mice package, how do we check for the residuals sum of squared of the pooled analysis?

library(mice) 
imp <- mice(nhanes, seed = 24500)
fit <- with(imp, lm(chl ~ age + bmi))
pool(fit)
summary(pool(fit))

fit contains the analysis for each input dataset and pool(fit) the pooled results. Is there a command to check the residuals sum of squared for a standard lm object, something like residuals(pool(fit)) ?

you can extract the residuals for each of the input dataset with the function res= sapply(fit[[4]],residuals)

and one option (although I don't think it's been published anywhere) is to average the residuals over the multiple imputed datasets, apply(res,1,mean)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM