drop1
Investigate models by dropping single terms

Description

Returns information about dropping each term of a model.

Usage

drop1(object, scope, ...) 
## Default S3 method:
drop1(object, scope, scale = 0,
    test = c("none", "Chisq"), k = 2, trace = FALSE, ...)
## S3 method for class 'lm':
drop1(object, scope, scale = 0, all.cols = TRUE,
    test = c("none", "Chisq", "F"), k = 2, ...)
## S3 method for class 'glm':
drop1(object, scope, scale = 0,
    test = c("none", "Rao", "LRT", "Chisq", "F"), k = 2, ...) 

Arguments

object A fitted model, from which new models can be formed by dropping terms found in its formula.
scope A description of the range of new terms to drop. This can be either a formula or a character vector.
  • If scope is a formula, it should contain the terms to omit. A dot in the formula specifies all the terms in the original model.
  • If scope is a character vector, drop1 omits the named terms.
  • If scope is NULL (or missing), drop1 omits all terms that can be omitted without violating the marginality constraint. (For example, if x:y is in the model, so must x and y.)

Methods for drop1 defined in add-on packages can use different parameterizations of scope.

scale a number passed to extractAIC to compute the AIC for a model. If 0, then the scale is estimated from the original model.
test A character string specifying which test statistic to return. One of "none", "Rao", "LRT", "Chisq", "F", and possibly others, depending on the type of model.
  • "LRT" and "Chisq" both refer to the likelihood ratio test.
  • test="Rao" is not currently implemented.
all.cols The all.cols argument to drop1.lm is ignored.
x the model.matrix for the original model. Some methods can use this to save some time.
k a number passed to extractAIC to modify how the AIC is computed.
... other arguments are silently ignored.

Details

If the data contains missing values, remove the rows containing missing values before fitting the original model.
Value
returns an anova object comparing the original model to models derived from it by dropping single terms.
See Also
add1, step.
Examples
fit1 <- lm(Yield ~ Temp * Conc, data=Sdatasets::catalyst)
# All single term deletions satisfying marginality principle
drop1(fit1)
Package stats version 6.1.1-7
Package Index