ancovaReg: Diagnostics for Analysis of Covariance

View source: R/ancovareg.R

ancovaRegR Documentation

Diagnostics for Analysis of Covariance

Description

Computes diagnostic statistics for an analysis of covariance (ANCOVA) with a single factor variable.

Usage

ancovaReg(object, find.best = TRUE, trace = FALSE)

Arguments

object

the linear regression model object.

find.best

select the "best" subset of terms in the model?

trace

print the results of the selection process if find.best is TRUE?

Details

The input model object (object) can be the complete ancova model including all interaction terms or it can be any form of an ANCOVA model. Most often, if it is not the complete ancova model, then find.best should be FALSE.
The find.best option uses the step function to select the "best" subset of terms in the model. In general, this can be used to retain or drop significant interaction terms. It will not look at individual factor levels in the model.

Value

A list of class "ancovaReg" containing these components:

aovtab

the analysis of variance table from the original model

parmests

a summary of the final object.

vif

a named vector of variance inflation factors.

diagstats

a data.frame containing the observed values, predicted values, residuals, standardized residuals, studentized residuals, leverage, Cook's D, and dfits for each observation.

crit.val

a named vector of the critical values for leverage, Cook's D, and dfits.

flagobs

a logical vector indicating which observations exceeded at least one of the critical values.

object

the lm object.

x

the model matrix of explanatory variables.

factor.var

the name of the factor variable

x.fr

the model frame of explanatory variables.

If no factor variable is found in the final model, either because one was not specified or it was dropped from the model, then an object of class "multReg" is returned instead. See multReg for details.

Note

Objects of class "ancovaReg" have print and plot methods.

References

Draper, N.R. and Smith, H., 1998, Applied Regression Analysis, (3rd ed.): New York, Wiley, 724 p.

See Also

lm, plot.ancovaReg, multReg,


USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.