# D1: Compare two nested models using D1-statistic In mice: Multivariate Imputation by Chained Equations

## Description

The D1-statistics is the multivariate Wald test.

## Usage

 `1` ```D1(fit1, fit0 = NULL, dfcom = NULL, df.com = NULL) ```

## Arguments

 `fit1` An object of class `mira`, produced by `with()`. `fit0` An object of class `mira`, produced by `with()`. The model in `fit0` is a nested within `fit1`. The default null model `fit0 = NULL` compares `fit1` to 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 to `df.residual` of model `fit1`. If that cannot be done, the procedure assumes (perhaps incorrectly) a large sample. `df.com` Deprecated

## References

Li, K. H., T. E. Raghunathan, and D. B. Rubin. 1991. Large-Sample Significance Levels from Multiply Imputed Data Using Moment-Based Statistics and an F Reference Distribution. Journal of the American Statistical Association, 86(416): 1065–73.

`testModels`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```# 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)) D1(mi1, mi0) ## Not run: # Compare two logistic regression models imp <- mice(boys, maxit = 2, print = FALSE) fit1 <- with(imp, glm(gen > levels(gen) ~ hgt + hc + reg, family = binomial)) fit0 <- with(imp, glm(gen > levels(gen) ~ hgt + hc, family = binomial)) D1(fit1, fit0) ## End(Not run) ```

### Example output

```Attaching package: ‘mice’

The following object is masked from ‘package:stats’:

filter

The following objects are masked from ‘package:base’:

cbind, rbind

test statistic df1 df2 dfcom    p.value      riv
1 ~~ 2   5.28351   1   4    20 0.08306791 0.671799
test statistic df1     df2 dfcom   p.value      riv
1 ~~ 2 0.9167355   4 36.7502   741 0.4645618 1.257083
```

mice documentation built on Nov. 24, 2021, 5:06 p.m.