Learn R Programming

semEff (version 0.1.0)

VIF: Generalised Variance Inflation Factors

Description

Calculate generalised variance inflation factors for terms in a fitted model via the variance-covariance matrix of coefficients.

Usage

VIF(mod, data = NULL, ...)

Arguments

mod

A fitted model object of class "lm", "glm", or "merMod", or a list or nested list of such objects.

data

An optional dataset used to first re-fit the model(s).

...

Not currently used.

Value

A numeric vector of the VIF's, or an array, list of vectors/arrays, or nested list.

Details

VIF calculates generalised variance inflation factors (GVIF) as described in Fox & Monette (1992), and also implemented in the vif function in the car package. However, whereas vif returns both GVIF and GVIF^(1/(2*Df)) values, VIF simply returns the squared result of the latter measure, which equals the standard VIF for single-coefficient terms and is the equivalent measure for multi-coefficient terms (e.g. categorical or polynomial). Also, while vif returns values per model term (i.e. predictor variable), VIF returns values per coefficient, meaning that the same VIF will be returned per coefficient for multi-coefficient terms. Finally, NA is returned for any coefficients which could not be estimated in the model (e.g. aliased terms).

References

Fox, J. and Monette, G. (1992) Generalized Collinearity Diagnostics. Journal of the American Statistical Association 87, 178-183. https://doi.org/dm9wbw

See Also

vif (web)

Examples

Run this code
# NOT RUN {
## Model with two correlated terms
m <- Shipley.Growth[[3]]
VIF(m)  # Date & DD somewhat correlated
VIF(update(m, . ~ . - DD))  # drop DD

## Model with different types of predictor (some multi-coefficient terms)
x1 <- poly(rnorm(100), 2)  # polynomial
x2 <- as.factor(rep(c("a", "b", "c", "d"), each = 25))  # categorical
x3 <- rep(1, 100)  # no variation
m <- lm(rnorm(100) ~ x1 + x2 + x3)
VIF(m)
# }

Run the code above in your browser using DataLab