anova
, which inherits from
data.frame
or
bdFrame
.
bdGlm
,
bdLm
,
gam
,
gamlist
,
glm
,
glmlist
,
lm
,
lmlist
,
loess
,
survreg
, and
survreglist
.
anova(object, ...)
bdGlm
,
bdLm
,
lm
,
glm
,
aov
,
loess
, and
survreg
.
test
argument with choices such as
"none"
,
"F"
,
"Chi"
,
"Cp"
.
anova
object. This class of objects inherits from the class
"data.frame"
or
"bdFrame"
, and consequently, suitable methods exist for printing, subsetting, and so on. An additional
"heading"
attribute is a character vector that is printed at the top of the table.
If called with a single object as an argument,
anova
produces a table with rows corresponding to each of the terms in the object, plus an additional row for the residuals. The method for
aov
objects is similar to
summary
.
When two or more objects are used in the call, a similar table is produced showing the effects of the pairwise differences between the models, considered sequentially from first to last.
Chambers, J.M., and Hastie, T.J. (1991). Statistical Models in S. London: Chapman and Hall.
# Create a sample glm object. glm.object <- glm(Kyphosis ~ bs(Start, 5) + Number, family = binomial, data = kyphosis) anova(glm.object) # Produces the following output: # # Analysis of Deviance Table # # Binomial model # # Response: Kyphosis # # Terms added sequentially (first to last) # Df Deviance Resid. Df Resid. Dev # NULL 80 83.23447 # bs(Start, 5) 5 23.52054 75 59.71394 # Number 1 1.71619 74 57.99775 # Create two more sample objects from ethanol dataset: gas.null <- loess(NOx ~ E, span = 1, data = gas) gas.alternative <- loess(NOx ~ E, span = 2/3, data = gas) anova(gas.null, gas.alternative) # Produces the following output: # # Model 1: # loess(formula = NOx ~ E, data = gas, span = 1) # Model 2: # loess(formula = NOx ~ E, data = gas, span = 2/3) # Analysis of Variance Table # Enp RSS Test F Value Pr(F) # 1 3.5 4.8489 1 vs 2 10.14 0.0008601 # 2 5.5 1.7769