Learn R Programming

metaSEM (version 0.9.4)

anova: Compare Nested Models with Likelihood Ratio Statistic

Description

It compares nested models with the likelihood ratio statistic from either wls, meta, meta3X or reml objects. It is a wrapper of mxCompare.

Usage

## S3 method for class 'wls':
anova(object, \dots, all=FALSE)
## S3 method for class 'meta':
anova(object, \dots, all=FALSE)
## S3 method for class 'meta3X':
anova(object, \dots, all=FALSE)
## S3 method for class 'reml':
anova(object, \dots, all=FALSE)

Arguments

object
An object or a list of objects of either class wls, class meta, class meta3 or class
...
An object or a list of objects of either class wls, class meta, class meta3 or class
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.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab