我不确定这背后的原因是什么 .

我有一个包含107个变量的数据集(混合了数字和因子数据类型),其中一些包含缺失值 . 我使用鼠标来估算数据 .

MICE估算了大多数变量的数据 . 但是,有些变量根本没有估算 .

很奇怪,虽然有些变量是成功估算的,但有些变量却没有 . 我也尝试仅在没有成功估算的变量上运行MICE,这一次,它成功了 .

这背后的原因是什么?它与我的数据集中的变量数量有什么关系吗?我该如何解决这个问题,还是需要为每个变量单独运行鼠标?

非常感谢,

编辑我现在给出代码来复制我的意思 .

> #create data set with NAs
> iris.fake = prodNA(iris, noNA = 0.9)
> iris.fake.miss <- aggr(iris.fake)
> iris.fake.miss$missings
             Variable Count
Sepal.Length Sepal.Length   138
Sepal.Width   Sepal.Width   137
Petal.Length Petal.Length   138
Petal.Width   Petal.Width   131
Species           Species   131
> 
> #run mice
> imp = mice(iris.fake, m = 5, maxit = 5)
iter imp variable
1   1  Sepal.Width  Petal.Length  Petal.Width  Species
1   2  Sepal.Width  Petal.Length  Petal.Width  Species
1   3  Sepal.Width  Petal.Length  Petal.Width  Species
1   4  Sepal.Width  Petal.Length  Petal.Width  Species
1   5  Sepal.Width  Petal.Length  Petal.Width  Species
2   1  Sepal.Width  Petal.Length  Petal.Width  Species
2   2  Sepal.Width  Petal.Length  Petal.Width  Species
2   3  Sepal.Width  Petal.Length  Petal.Width  Species
2   4  Sepal.Width  Petal.Length  Petal.Width  Species
2   5  Sepal.Width  Petal.Length  Petal.Width  Species
3   1  Sepal.Width  Petal.Length  Petal.Width  Species
3   2  Sepal.Width  Petal.Length  Petal.Width  Species
3   3  Sepal.Width  Petal.Length  Petal.Width  Species
3   4  Sepal.Width  Petal.Length  Petal.Width  Species
3   5  Sepal.Width  Petal.Length  Petal.Width  Species
4   1  Sepal.Width  Petal.Length  Petal.Width  Species
4   2  Sepal.Width  Petal.Length  Petal.Width  Species
4   3  Sepal.Width  Petal.Length  Petal.Width  Species
4   4  Sepal.Width  Petal.Length  Petal.Width  Species
4   5  Sepal.Width  Petal.Length  Petal.Width  Species
5   1  Sepal.Width  Petal.Length  Petal.Width  Species
5   2  Sepal.Width  Petal.Length  Petal.Width  Species
5   3  Sepal.Width  Petal.Length  Petal.Width  Species
5   4  Sepal.Width  Petal.Length  Petal.Width  Species
5   5  Sepal.Width  Petal.Length  Petal.Width  Species
> summary(imp)
Multiply imputed data set
Call:
mice(data = iris.fake, m = 5, maxit = 5)
Number of multiple imputations:  5
Missing cells per column:
Sepal.Length  Sepal.Width Petal.Length  Petal.Width      Species 
138          137          138          131          131 
Imputation methods:
Sepal.Length  Sepal.Width Petal.Length  Petal.Width      Species 
"pmm"        "pmm"        "pmm"        "pmm"    "polyreg" 
VisitSequence:
Sepal.Width Petal.Length  Petal.Width      Species 
 2            3            4            5 
PredictorMatrix:
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
Sepal.Length            0           0            0           0       0
Sepal.Width             0           0            1           1       1
Petal.Length            0           1            0           1       1
Petal.Width             0           1            1           0       1
Species                 0           1            1           1       0
Random generator seed value:  NA 
> 
> com = complete(imp,2)
> iris.imp.miss <- aggr(com)
> iris.imp.miss$missings
Variable Count
Sepal.Length Sepal.Length   138
Sepal.Width   Sepal.Width     0
Petal.Length Petal.Length     0
Petal.Width   Petal.Width     0
Species           Species     0