| vif | R Documentation |
Computes the Variance Inflation Factors from a correlation matrix in two steps:
Applies base::solve() to transform the correlation matrix into a precision matrix, which is the inverse of the covariance matrix between all variables in predictors.
Applies base::diag() to extract the diagonal of the precision matrix, which contains the variance of the regression of each predictor against all other predictors, also known as Variance Inflation Factor
vif(m = NULL, quiet = FALSE, ...)
m |
(required, matrix) Correlation matrix generated via |
quiet |
(optional; logical) If FALSE, messages are printed. Default: FALSE. |
... |
(optional) Internal args (e.g. |
named numeric vector
VIF for predictor a is computed as 1/(1-R^2), where R^2 is
the multiple R-squared from regressing a on the other predictors.
Recommended maximums commonly used are 2.5, 5, and 10.
David A. Belsley, D.A., Kuh, E., Welsch, R.E. (1980). Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. John Wiley & Sons. DOI: 10.1002/0471725153.
Other multicollinearity_assessment:
collinear_stats(),
cor_clusters(),
cor_cramer(),
cor_df(),
cor_matrix(),
cor_stats(),
vif_df(),
vif_stats()
data(vi_smol, vi_predictors_numeric)
m <- cor_matrix(
df = vi_smol,
predictors = vi_predictors_numeric[1:5]
)
vif(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.