anova.mitml.result: Compare several nested models

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/anova.mitml.result.R

Description

Performs model comparisons for a series of nested statistical models fitted using with.mitml.list.

Usage

1
2
3
4
## S3 method for class 'mitml.result'
anova(object, ..., method = c("D3", "D4", "D2"),
  ariv = c("default", "positive", "robust"),
  data = NULL)

Arguments

object

An object of class mitml.result as produced by with.mitml.list.

...

Additional objects of class mitml.result to be compared.

method

A character string denoting the method used for the model comparison. Can be "D3", "D4" or "D2" (see 'Details'). Default is "D3".

ariv

A character string denoting how the ARIV is calculated. Can be "default", "positive", or "robust" (see 'Details').

data

(optional) A list of imputed data sets (see 'Details').

Details

This function performs likelihood-based comparisons between multiple statistical models fitted with with.mitml.list. If possible, the models are compared using the D_3 statistic (Meng & Rubin, 1992). If this method is unavailable, the D_4 or D_2 statistic is used instead (Chan & Meng, 2019; Li, Meng, Raghunathan, & Rubin, 1991).

This function is essentially a wrapper for testModels with the advantage that several models can be compared simultaneously. For a list of supported models and further options for more specific model comparisons, see testModels.

The ariv argument affects how the average relative increase in variance is calculated (see also testModels). Note that the D_4 method can fail if the data to which the model was fitted cannot be found. In such a case, the data argument can be used to specify the list of imputed data sets directly (see also testModels).

Value

A list containing the results of each model comparison. A print method is used for more readable output.

Author(s)

Simon Grund

References

Meng, X.-L., & Rubin, D. B. (1992). Performing likelihood ratio tests with multiply-imputed data sets. Biometrika, 79, 103-111.

Laird, N., Lange, N., & Stram, D. (1987). Maximum likelihood computations with repeated measures: Application of the em algorithm. Journal of the American Statistical Association, 82, 97-105.

Li, K. H., Raghunathan, T. E., & Rubin, D. B. (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, 1065-1073.

See Also

with.mitml.list, testModels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require(lme4)
data(studentratings)

fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula = fml, n.burn = 1000, n.iter = 100, m = 5)

implist <- mitmlComplete(imp)

# simple comparison (same as testModels)
fit0 <- with(implist, lmer(ReadAchiev ~ (1|ID), REML = FALSE))
fit1 <- with(implist, lmer(ReadAchiev ~ ReadDis + (1|ID), REML = FALSE))
anova(fit1, fit0)

## Not run: 
# multiple comparisons
fit2 <- with(implist, lmer(ReadAchiev ~ ReadDis + (1 + ReadDis|ID), REML = FALSE))
anova(fit2, fit1, fit0)

## End(Not run)

Example output

*** This is beta software. Please report any bugs!
*** See the NEWS file for recent changes.
Loading required package: lme4
Loading required package: Matrix
Running burn-in phase ...
Creating imputed data set ( 1 / 5 ) ...
Creating imputed data set ( 2 / 5 ) ...
Creating imputed data set ( 3 / 5 ) ...
Creating imputed data set ( 4 / 5 ) ...
Creating imputed data set ( 5 / 5 ) ...
Done!

Call:

anova.mitml.result(object = fit1, fit0)

Model comparison calculated from 5 imputed data sets.
Combination method: D3 

Model 1: ReadAchiev~ReadDis+(1|ID)
Model 2: ReadAchiev~(1|ID)

         F.value     df1     df2   P(>F)     RIV 
 1 vs 2:  29.243       1  19.449   0.000   0.830 

boundary (singular) fit: see ?isSingular
boundary (singular) fit: see ?isSingular
boundary (singular) fit: see ?isSingular
boundary (singular) fit: see ?isSingular
boundary (singular) fit: see ?isSingular

Call:

anova.mitml.result(object = fit2, fit1, fit0)

Model comparison calculated from 5 imputed data sets.
Combination method: D3 

Model 1: ReadAchiev~ReadDis+(1+ReadDis|ID)
Model 2: ReadAchiev~ReadDis+(1|ID)
Model 3: ReadAchiev~(1|ID)

         F.value     df1     df2   P(>F)     RIV 
 1 vs 2:   1.269       2 178.759   0.284   0.134 
 2 vs 3:  29.243       1  19.449   0.000   0.830 

mitml documentation built on Oct. 5, 2021, 5:07 p.m.