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)
Run the code above in your browser using DataLab