Learn R Programming

metaSEM (version 0.9.8)

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

"anova"(object, ..., all=FALSE) "anova"(object, ..., all=FALSE) "anova"(object, ..., all=FALSE) "anova"(object, ..., all=FALSE)

Arguments

object
An object or a list of objects of either class wls, class meta, class meta3 or class reml. It will be passed to the base argument in mxCompare.
...
An object or a list of objects of either class wls, class meta, class meta3 or class reml. 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

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