我正在分析从 R 中的 MICE 包生成的多重插补数据集。为了评估我的线性模型的整体重要性,我使用 pool.compare() 将我的“完整”模型与仅截取的“受限”模型进行比较。但是,pool.compare() 返回的自由度(残差)似乎非常膨胀(我设置了 m = 50 个插补)。我知道 50 次插补很高,但我的数据集需要它。我在下面给出了一个使用 MICE 包中的 nhanes2 数据集的相同问题的示例。我有两个问题:
1)为什么pool.compare()返回的自由度这么高?
2) 使用 Barnard 和 Rubin (1999) 建议并在 Stef van Burren 的缺失数据的灵活插补教科书第 2.3.6 节中描述的对自由度的调整是否合适?
下面的 R 代码显示了我询问的有关使用 nhanes2 数据集的问题。该数据集有 25 个观察值,该示例拟合线性模型,该模型具有一个分类预测变量(年龄),三个水平和一个连续预测变量(chl)。
# load package and data
library("mice")
data(nhanes2)
# impute missing values, m = 50
imp <- mice(nhanes2, m = 50, seed = 1, print = FALSE)
# produce the models to compare, a full model and
# an intercept only restricted model
fit.imputed.full <- with(imp, lm(bmi ~ age + chl))
fit.imputed.res <- with(imp, lm(bmi ~ 1))
# compare models using pool.compare()
pooled.comparison <- pool.compare(fit.imputed.full, fit.imputed.res)
# given that the original dataset had 25 observations, and we have a
# linear model with three predictors (age is a factor with three levels)
# I'd expect the degrees of freedom (residual) for the comparison to be at
# most 24. The df for the numerator comes as expected:
pooled.comparison$df1
[1] 3
# the df for the denominator comes out a much larger than the
# maximum of 24:
pooled.comparison$df2
[1] 1374.457
# by way of comparison, the same analysis conducted on a single
# hypothetically complete dataset gives the expected degrees of freedom
nhanes2CCA <- complete(imp, 1)
attach(nhanes2CCA)
fit.CCA.full <- lm(bmi ~ age + chl)
fit.CCA.res <- lm(bmi ~ 1)
detach(nhanes2CCA)
anova(fit.CCA.full, fit.CCA.res)
Model 1: bmi ~ age + chl
Model 2: bmi ~ 1
Res.Df RSS Df Sum of Sq F Pr(>F)
1 21 293.60
2 24 477.23 -3 -183.62 4.3778 0.01525 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
最后,对假设的完整数据集进行的分析返回 24 个自由度似乎很奇怪,而对 50 个多重插补数据集进行的分析返回超过 1000 个自由度。为什么自由度会有这么大的差异?
我的第二个问题与 Barnard 和 Rubin(1999)提出的修正有关。在这里使用该更正是否合适?因为这是一个多参数测试,所以我猜这样做需要对 lambda 进行估计,该估计值是在被估计的参数中平均的。
我在这个例子中使用的数字是:
v_old = 1374.457
v_com = 25-1 = 24
平均 lambda = 0.329
v_obs = 14.91
v(调整后的自由度)= 14.75
在这种情况下应用此校正会返回 14.75 的校正自由度,这大于仅分析完整案例 (12) 将返回的 df,并且小于通过分析假设的完整数据集 (24) 将返回的 df )。这似乎是合理的。
谢谢大家的帮助。
马特。