Description Usage Arguments Details Value Author(s) References See Also Examples
The VIF for predictor i is 1/(1R_i^2), where R_i^2 is the R^2 from a regression of predictor i against the remaining predictors.
1 2 3 4 5 6 7 8 9 10  vif(xx, ...)
## Default S3 method:
vif(xx, y.name, na.action = na.exclude, ...) ## xx is a data.frame
## S3 method for class 'formula'
vif(xx, data, na.action = na.exclude, ...) ## xx is a formula
## S3 method for class 'lm'
vif(xx, na.action = na.exclude, ...) ## xx is a "lm" object computed with x=TRUE

xx 

na.action 
See

... 
additional arguments. 
y.name 
Name of Yvariable to be excluded from the computations. 
data 
A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way. 
A simple diagnostic of collinearity is the variance inflation factor, VIF one for each regression coefficient (other than the intercept). Since the condition of collinearity involves the predictors but not the response, this measure is a function of the X's but not of Y. The VIF for predictor i is 1/(1R_i^2), where R_i^2 is the R^2 from a regression of predictor i against the remaining predictors. If R_i^2 is close to 1, this means that predictor i is well explained by a linear function of the remaining predictors, and, therefore, the presence of predictor i in the model is redundant. Values of VIF exceeding 5 are considered evidence of collinearity: The information carried by a predictor having such a VIF is contained in a subset of the remaining predictors. If, however, all of a model's regression coefficients differ significantly from 0 (pvalue < .05), a somewhat larger VIF may be tolerable.
Vector of VIF values, one for each Xvariable.
Richard M. Heiberger <[email protected]>
Heiberger, Richard M. and Holland, Burt (2004). Statistical Analysis and Data Display: An Intermediate Course with Examples in SPlus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0387402705.
lm
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  data(usair)
if.R(s={usair < usair}, r={})
usair$lnSO2 < log(usair$SO2)
usair$lnmfg < log(usair$mfgfirms)
usair$lnpopn < log(usair$popn)
usair.lm < lm(lnSO2 ~ temp + lnmfg + wind + precip, data=usair, x=TRUE)
vif(usair.lm) ## the lm object must be computed with x=TRUE
vif(lnSO2 ~ temp + lnmfg + wind + precip, data=usair)
vif(usair)
vif(usair, y.name="lnSO2")

Loading required package: lattice
Loading required package: grid
Loading required package: latticeExtra
Loading required package: RColorBrewer
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS
Attaching package: 'TH.data'
The following object is masked from 'package:MASS':
geyser
Loading required package: gridExtra
NULL
temp lnmfg wind precip
1.373342 1.115383 1.253309 1.204027
temp lnmfg wind precip
1.373342 1.115383 1.253309 1.204027
SO2 temp mfgfirms popn wind precip raindays lnSO2
21.649700 6.090131 47.530627 50.924112 2.124705 4.274058 3.806131 20.177457
lnmfg lnpopn
12.044417 19.708620
SO2 temp mfgfirms popn wind precip raindays lnmfg
3.123775 4.699786 44.006584 50.209386 1.474314 4.195029 3.748426 12.027037
lnpopn
19.522242
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.