metaSEM (version 1.2.4)

anova: 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 wls
anova(object, …, all=FALSE)
# S3 method for meta
anova(object, …, all=FALSE)
# S3 method for meta3X
anova(object, …, all=FALSE)
# S3 method for reml
anova(object, …, all=FALSE)
# S3 method for osmasem
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.

Examples

Run this code
# NOT RUN {
## 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 DataCamp Workspace