【发布时间】:2021-02-20 10:00:08
【问题描述】:
我是在 R 中打包 mice 的新手。但我试图从 popmis 中估算 5 个数据集,然后分别拟合 lmer() 模型 with(),最后在它们之间拟合 pool()。
我认为mice() 中的pool() 函数不适用于来自lme4 包的lmer() 调用,对吧?
如果是这样的话,有没有办法为我下面的情况编写一个类似于pool() 的定制函数?
library(mice)
library(lme4)
imp <- mice(popmis, m = 5) # `popmis` is a dataset from `mice`
fit <- with(imp, lme4::lmer(popular ~ sex + (1|school))) # works fine.
pool(fit) # BUT this one fails, should I loop here?
【问题讨论】:
标签: r missing-data lme4 imputation r-mice