anova: Compare Nested Models with Likelihood Ratio Statistic

anovaR Documentation

Compare Nested Models with Likelihood Ratio Statistic

Description

It compares nested models with the likelihood ratio statistic from various objects. It is a wrapper of mxCompare.

Usage

## S3 method for class 'wls'
anova(object, ..., all=FALSE)
## S3 method for class 'meta'
anova(object, ..., all=FALSE)
## S3 method for class 'meta3LFIML'
anova(object, ..., all=FALSE)
## S3 method for class 'reml'
anova(object, ..., all=FALSE)
## S3 method for class 'osmasem'
anova(object, ..., all=FALSE)
## S3 method for class 'osmasem2'
anova(object, ..., all=FALSE)
## S3 method for class 'mxsem'
anova(object, ..., all=FALSE)

Arguments

object

An object or a list of objects of various classes. It will be passed to the base argument in mxCompare.

...

An object or a list of objects of various classes. It will be passed to the comparison argument in mxCompare.

all

A Boolean value on whether to compare all bases with all comparisons. It will be passed to the all argument in mxCompare.

Value

A table of comparisons between the models in base and comparison.

Note

When the objects are class wls, the degrees of freedom in the base and comparison models are incorrect, while the degrees of freedom of the difference between them is correct. If users want to obtain the correct degrees of freedom in the base and comparison models, they may individually apply the summary function on the base and comparison models.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

Examples

## Test the significance of a predictor with likelihood ratio test
## Model0: No predictor
model0 <- meta(y=yi, v=vi, data=Hox02, model.name="No predictor")

## Model1: With a predictor
model1 <- meta(y=yi, v=vi, x=weeks, data=Hox02, model.name="One predictor")

## Compare these two models
anova(model1, model0) 

metaSEM documentation built on Sept. 30, 2024, 9:21 a.m.