提问人:Katharina 提问时间:9/26/2023 更新时间:9/26/2023 访问量:10
使用 MICE 进行多级插补的错误消息
Error messages multilevel imputation with MICE
问:
我尝试在 R 中插补数据集,同时考虑到它的多级结构。
pred2 <- make.predictorMatrix(Scales)
#Cluster
#Variables not imputed
pred2 [c("stud_id", "sg_idn",
"trs1jgs", "s12tt", "trs1juel", "s1alt",
"s1ukab", "s1uukb", "s1umob", "s1utpb",
"ABrating", "ABrandom"),] <-0
#Variables not predicting
pred2 [,c("stud_id","s1ukab","s1uukb", "s1umob", "s1utpb",
"ABrating", "ABrandom")] <-0
pred2 [,"sg_idn"] <- -2
pred2
write.csv2(pred2, file = "Predictormatrix_02.csv")
### Make method
meth2 <- make.method(Scales)
meth2 [] <- "2l.pmm"
meth2 [c("stud_id", "sg_idn",
"trs1jgs", "s12tt", "trs1juel", "s1alt",
"s1ukab", "s1uukb", "s1umob", "s1utpb",
"ABrating", "ABrandom")] <- ""
meth2
imp1 <- mice(Scales, m=5, method=meth2, predictorMatrix=pred2, maxit=5, seed=1234)
但是,我遇到了几个问题: 我收到四种不同的警告:
- In stats::runif(N, 0, fg1/noise) : NAs produziert
- 在 NextMethod() 中: 要更换的物料数不是更换长度的倍数
- 在 imputes[cc] <- do.call(f, args = args) 中: 要更换的物料数不是更换长度的倍数
- 此外,在我的 45 个变量中,有 5 个变量: 边界(奇异)拟合:参见 help('isSingular')
警告是什么意思?有没有可能解决问题?
答: 暂无答案
评论