简体   繁体   English

使用R中的鼠标包进行多次插补的残差平方和

[英]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? 使用mice包,我们如何检查合并分析的残差平方和?

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. fit包含对每个输入数据集的分析,并合并pool(fit)合并的结果。 Is there a command to check the residuals sum of squared for a standard lm object, something like residuals(pool(fit)) ? 是否有一个命令来检查标准lm对象的残差平方和,类似于residuals(pool(fit))

you can extract the residuals for each of the input dataset with the function res= sapply(fit[[4]],residuals) 您可以使用函数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) 一种选择(尽管我不认为它已在任何地方发布)是对多个估算数据集上的残差求平均值,apply(res,1,mean)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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