简体   繁体   English

多重插补的池化结果,pool()函数错误,mice包

[英]Pooling results of multiple imputation, pool() function error, mice package

I am new to multiple imputation.我是多重插补的新手。 I followed tutorials that I found online and performed multiple imputations on my own data.我遵循了我在网上找到的教程,并对我自己的数据进行了多次插补。 Everything went well until the very last step when I need to pool results from different data sets with imputed values.一切都很顺利,直到最后一步,我需要将来自不同数据集的结果与估算值合并。 R gave me the following error messages: R 给了我以下错误消息:

pool(rep1_mi)
Error: No tidy method for objects of class qr
In addition: Warning messages:
1: In get.dfcom(object, dfcom) : Infinite sample size assumed.
2: 'tidy.numeric' is deprecated.
See help("Deprecated") 
3: 'tidy.numeric' is deprecated.
See help("Deprecated") 
4: 'tidy.numeric' is deprecated.
See help("Deprecated") 
5: 'tidy.numeric' is deprecated.
See help("Deprecated") 
6: 'tidy.numeric' is deprecated.
See help("Deprecated") 
7: 'tidy.numeric' is deprecated.
See help("Deprecated") 

I didn't find any solution that works.我没有找到任何有效的解决方案。 Could anyone please help?有人可以帮忙吗? Thanks.谢谢。

This GitHub issue is related to your problem.这个 GitHub 问题与您的问题有关。 You can work around it by using the pool.scalar() function.您可以使用pool.scalar()函数来解决它。

Try to run your model directly on the output given by mice and not on the output given by complete function尝试直接在mice给出的输出上运行模型,而不是在complete函数给出的输出上运行

library(psych)
# to create some missingness 
bfi[4,1] = NA_character_
bfi[6,2] = NA_character_
bfi[9,1] = NA_character_
bfi[7,2] = NA_character_
bfi[6,1] = NA_character_

# run mice
imput.bfi <- mice(bfi, m = 3)

# when "complete" function is used, "pool" function will not run
bfi.imp.dat=mice::complete(imput.bfi, action="long", inc = TRUE)
# run linear regression 
lm.bfi=with(bfi.imp.dat, lm(N1 ~ age))
# pool will not work here 
pool(lm.bfi)


# In this case the "pool" function will work properly
# run linear regression 
lm.bfi=with(imput.bfi, lm(N1 ~ age))
# pool results 
pool(lm.bfi)

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

相关问题 使用 MICE 包进行多次插补后合并 Cox PH 结果 - Pooling Cox PH results after multiple imputation with the MICE package 使用小鼠 package 进行多重插补 - Multiple imputation using mice package 使用MICE包导致缺失值插补错误 - Error in missing value imputation using MICE package 如何用“survSplit”function 划分估算数据,最后在 MICE ZEFE90A8E604A7C840E88D03A67F6B7DZ8 中使用“pool”function 汇集分析结果 - How to divide imputed data with 'survSplit' function and finally pool the analysis results using 'pool' function in MICE package 如何使用MICE包进行多次插补后的预测 - How to do the prediction after multiple imputation with MICE package 使用R中的鼠标包进行多次插补的残差平方和 - Residuals sum of squared for multiple imputation using mice package in R R — 在小鼠 package 中为插补 model 选择预测变量子集时出错 - R — Error when selecting subset of predictors for an imputation model in mice package 使用R中的小鼠包进行多次插补的残留图 - Residual plots for multiple imputation using mice package in R 有没有人尝试在“小鼠”包中并行化多重插补? - Has anyone tried to parallelize multiple imputation in 'mice' package? 插补期间使用随机森林(MICE程序包)时出错 - Error using random forest (MICE package) during imputation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM