Learn R Programming

performance (version 0.3.0)

check_collinearity: Check for multicollinearity of model terms

Description

check_collinearity() checks regression models for multicollinearity by calculating the variance inflation factor (VIF).

Usage

check_collinearity(x, ...)

# S3 method for glmmTMB check_collinearity(x, component = c("all", "conditional", "count", "zi", "zero_inflated"), ...)

Arguments

x

A model object (that should at least respond to vcov(), and if possible, also to model.matrix() - however, it also should work without model.matrix()).

...

Currently not used.

component

For models with zero-inflation component, multicollinearity can be checked for the conditional model (count component, component = "conditional" or component = "count"), zero-inflation component (component = "zero_inflated" or component = "zi") or both components (component = "all"). Following model-classes are currently supported: hurdle, zeroinfl, zerocount, MixMod and glmmTMB.

Value

A data frame with three columns: The name of the model term, the variance inflation factor and the factor by which the standard error is increased due to possible correlation with other terms.

Details

The variance inflation factor is a measure to analyze the magnitude of multicollinearity of model terms. A VIF less than 5 indicates a low correlation of that predictor with other predictors. A value between 5 and 10 indicates a moderate correlation, while VIF values larger than 10 are a sign for high, not tolerable correlation of model predictors. The Increased SE column in the output indicates how much larger the standard error is due to the correlation with other predictors.

References

James, G., Witten, D., Hastie, T., & Tibshirani, R. (Hrsg.). (2013). An introduction to statistical learning: with applications in R. New York: Springer.

Examples

Run this code
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_collinearity(m)

# plot results
x <- check_collinearity(m)
plot(x)

# }

Run the code above in your browser using DataLab