gx.lm.vif: Estimate Variance Inflation Factosr (VIFs)

Description Usage Arguments Value Note Author(s) References Examples

Description

Function estimates Variance Inflation Factors (VIFs), measures of collinearity in a linear model. The VIF provides a measure of how much the variance of an estimated regression coefficient is increased because of collinearity. Collinearity is present when there is a high correlation between the independent, predictor, variables in a model, i.e. they tell the same ‘story’. Where collinearity exists it is often best to remove predictor variables with high VIFs from the model.

Usage

1
gx.lm.vif(object, ...)

Arguments

object

a lm object.

...

any additional parameters.

Value

A (structure) table of Variable Inflation Factors for the predictor variables.

Note

VIFs >5 are indicative of collinearity, and the information conveyed in that variable is also in the subset of the remaining variables.

Author(s)

W.N. Venables,function shared on S-News, October 21, 2002

References

http://www.biostat.wustl.edu/archives/html/s-news/2001-10/msg00164.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Make test data available
data(sind)
attach(sind)

## Model 1
sind.1 <- lm(log(Zn) ~ Fe + log(Mn) + log(Cu) + log(Cd))
summary(sind.1)
gx.lm.vif(sind.1)

## Model 2
sind.2 <- lm(log(Zn) ~ Fe + log(Mn))
summary(sind.2)
gx.lm.vif(sind.2)
AIC(sind.1, sind.2)

## Model 3
sind.3 <- lm(log(Zn) ~ log(Mn) + log(Cu))
summary(sind.3)
gx.lm.vif(sind.3)
AIC(sind.1, sind.2, sind.3) 

## Clean-up and detach test data
rm(sind.1)
rm(sind.2)
rm(sind.3)
detach(sind) 

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to gx.lm.vif in rgr...