anova.psem {piecewiseSEM} | R Documentation |
ANOVA and chi-squared difference test for model comparison
Description
Compute analysis of variance table for one or more structural equation models.
Usage
## S3 method for class 'psem'
anova(object, ..., digits = 3, anovafun = "Anova")
Arguments
object |
a |
... |
additional objects of the same type |
digits |
number of digits to round results. Default is 3 |
anovafun |
The function used for ANOVA. Defaults to |
Details
Additional models will be tested against the first model using a Chi-squared difference test.
Value
an F, LRT, or other table for a single model, or a list of comparisons between multiple models
Author(s)
Jon Lefcheck <lefcheckj@si.edu>, Jarrett Byrnes <jarrett.byrnes@umb.edu>
See Also
Examples
data(keeley)
mod1 <- psem(
lm(rich ~ cover, data = keeley),
lm(cover ~ firesev, data = keeley),
lm(firesev ~ age, data = keeley),
data = keeley
)
# get type II Anova
anova(mod1)
# conduct LRT
mod2 <- psem(
lm(rich ~ cover, data = keeley),
lm(cover ~ firesev, data = keeley),
age ~ 1,
data = keeley
)
anova(mod1, mod2)
[Package piecewiseSEM version 2.3.0.1 Index]