add1.BTm {BradleyTerry2} | R Documentation |
Add or drop single terms within the limit specified by the scope
argument. For models with no random effects, compute an analysis of deviance
table, otherwise compute the Wald statistic of the parameters that have been
added to or dropped from the model.
## S3 method for class 'BTm'
add1(object, scope, scale = 0, test = c("none", "Chisq", "F"), x = NULL, ...)
object |
a fitted object of class inheriting from |
scope |
a formula specifying the model including all terms to be considered for adding or dropping. |
scale |
an estimate of the dispersion. Not implemented for models with random effects. |
test |
should a p-value be returned? The F test is only appropriate for models with no random effects for which the dispersion has been estimated. The Chisq test is a likelihood ratio test for models with no random effects, otherwise a Wald test. |
x |
a model matrix containing columns for all terms in the scope.
Useful if |
... |
further arguments passed to |
The hierarchy is respected when considering terms to be added or dropped: all main effects contained in a second-order interaction must remain, and so on.
In a scope formula ‘.’ means ‘what is already there’.
For drop1
, a missing scope
is taken to mean that all terms in
the model may be considered for dropping.
If scope
includes player covariates and there are players with
missing values over these covariates, then a separate ability will be
estimated for these players in all fitted models. Similarly if there
are missing values in any contest-level variables in scope
, the
corresponding contests will be omitted from all models.
If formula
includes random effects, the same random effects structure
will apply to all models.
An object of class "anova"
summarizing the differences in fit
between the models.
Heather Turner
result <- rep(1, nrow(flatlizards$contests))
BTmodel1 <- BTm(result, winner, loser,
~ throat.PC1[..] + throat.PC3[..] + (1|..),
data = flatlizards,
tol = 1e-4, sigma = 2, trace = TRUE)
drop1(BTmodel1)
add1(BTmodel1, ~ . + head.length[..] + SVL[..], test = "Chisq")
BTmodel2 <- update(BTmodel1, formula = ~ . + head.length[..])
drop1(BTmodel2, test = "Chisq")