Compute analysis of variance table for one or more structural equation models.

# S3 method for psem
anova(mod, mod2 = NULL, digits = 3,
  anovafun = car::Anova, ...)

Arguments

mod

a psem object

mod2

a psem object for comparison. Defaults to NULL to allow for a LRT or F tables of all fit model pieces.

digits

number of digits to round results. Default is 3

anovafun

The function used for ANOVA. Defaults to car::Anova

...

additional arguments passed to anovafun

Value

an F, LRT, or other table for a single model, or a list of comparisons between multiple models

See also

The model fitting function psem

Examples

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)
#> Response Predictor Sum Sq Df F value Pr(>F) #> 1 rich cover 2200.083191 1 10.69180 1.536849e-03 ** #> 2 rich Residuals 18108.016809 88 NA NA <NA> #> 3 cover firesev 1.711520 1 20.78792 1.648353e-05 *** #> 4 cover Residuals 7.245252 88 NA NA <NA> #> 5 firesev age 50.054888 1 22.83036 7.027847e-06 *** #> 6 firesev Residuals 192.937362 88 NA NA <NA>
# conduct LRT mod2 <- psem( lm(rich ~ cover, data = keeley), lm(cover ~ firesev, data = keeley), age ~ 1, data = keeley ) anova(mod1, mod2)
#> Chi square difference test #> #> AIC BIC Fisher.C Fisher.C.Diff DF.diff P.value #> 1 35.136 57.634 17.136 #> vs 2 32.052 47.051 20.052 2.916 0 0 *** #>