anova {metaSEM} | R 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 'mxRAMmodel'
anova(object, ..., all=FALSE)
Arguments
object |
An object or a list of objects of various classes. It will be passed to the
|
... |
An object or a list of objects of various classes. It will be passed to the
|
all |
A Boolean value on whether to compare all bases with all
comparisons. It will be passed to the |
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)