The D3-statistic is a likelihood-ratio test statistic.
Arguments
- fit1
An object of class
mira, produced bywith().- fit0
An object of class
mira, produced bywith(). The model infit0is a nested withinfit1. The default null modelfit0 = NULLcomparesfit1to the intercept-only model.- dfcom
A single number denoting the complete-data degrees of freedom of model
fit1. If not specified, it is set equal todf.residualof modelfit1. If that cannot be done, the procedure assumes (perhaps incorrectly) a large sample.- df.com
Deprecated
Details
The D3() function implements the likelihood-ratio method of
Meng and Rubin (1992). For each of the m imputed datasets, the
function calculates the deviance between the full and the null model
as fitted, and the deviance between the two models with all parameters
fixed at their estimates pooled over the imputations. The pooled
parameters include the nuisance parameters: the residual variance in
lm and gaussian glm, and the variance components and
residual variance in lmer models. Models fitted by REML are
refitted by ML.
The log-likelihood at fixed parameters is evaluated exactly for
lm, for glm with the gaussian, binomial and poisson
families, and for lmerMod. For these classes D3() gives
the same result as mitml::testModels(method = "D3"). For other
classes, D3() constrains the regression coefficients by means of
fix.coef and re-estimates the remaining parameters in
each imputed dataset, which approximates the method.
A negative D3 statistic signals that the models constrained to
the pooled coefficients fit much worse than the models as fitted. This
typically happens when the coefficients are unstable across imputations,
for example under separation in logistic regression with small samples.
D3() warns in that case, and the result should not be trusted.
References
Meng, X. L., and D. B. Rubin. 1992. Performing Likelihood Ratio Tests with Multiply-Imputed Data Sets. Biometrika, 79 (1): 103–11.
https://stefvanbuuren.name/fimd/sec-multiparameter.html#sec:likelihoodratio
Examples
# Compare two linear models:
imp <- mice(nhanes2, seed = 51009, print = FALSE)
mi1 <- with(data = imp, expr = lm(bmi ~ age + hyp + chl))
mi0 <- with(data = imp, expr = lm(bmi ~ age + hyp))
D3(mi1, mi0)
#> test statistic df1 df2 dfcom p.value riv
#> 1 ~~ 2 1.854883 1 6.086733 20 0.2214652 4.281458
if (FALSE) { # \dontrun{
# Compare two logistic regression models
imp <- mice(boys, maxit = 2, print = FALSE)
fit1 <- with(imp, glm(gen > levels(gen)[1] ~ hgt + hc + reg, family = binomial))
fit0 <- with(imp, glm(gen > levels(gen)[1] ~ hgt + hc, family = binomial))
D3(fit1, fit0)
} # }
