Learn R Programming

relevance (version 2.1)

drop1Wald: Drop Single Terms of a Model and Calculate Respective Wald Tests

Description

drop1Wald calculates tests for single term deletions based on the covariance matrix of estimated coefficients instead of re-fitting a reduced model. This helps in cases where re-fitting is not feasible, inappropriate or costly.

Usage

drop1Wald(object, scope=NULL, scale = NULL, test = NULL, k = 2, ...)

Value

An object of class 'anova' summarizing the differences in fit between the models.

Arguments

object

a fitted model.

scope

a formula giving the terms to be considered for dropping. If 'NULL', 'drop.scope(object)' is obtained

scale

an estimate of the residual mean square to be used in computing Cp. Ignored if '0' or 'NULL'.

test

see drop1

k

the penalty constant in AIC / Cp.

...

further arguments, ignored

Author

Werner A. Stahel

Details

The test statistics and Cp and AIC values are calculated on the basis of the estimated coefficients and their (unscaled) covariance matrix as provided by the fit object. The function may be used for all model fitting objects that contain these two components as $coefficients and $cov.unscaled.

See Also

Examples

Run this code
data(d.blast)
r.blast <- lm(log10(tremor)~location+log10(distance)+log10(charge),
              data=d.blast)
drop1(r.blast)
drop1Wald(r.blast)

## Example from example(glm)
dd <- data.frame(treatment = gl(3,3), outcome = gl(3,1,9),
           counts = c(18,17,15,20,10,20,25,13,12)) 
r.glm <- glm(counts ~ outcome + treatment, data = dd, family = poisson())
drop1(r.glm, test="Chisq")
drop1Wald(r.glm)

Run the code above in your browser using DataLab