7

I am using the vif function in the R package car to test for multicollinearity. I am a little confused at the output given. For example, I have 5 variables (x1, x2, x3, x4 and x5) does the GVIF represent the effect of multicollinearity of all variables against each other? For example, GVIF number for X1 calculates multicollinearity against x2, x3, x4 and x5 and GVIF number for X2 calculates multicollinearity against x1, x3, x4 and x5, or does it choose the first variable given and all other GIF values are compared to just the first variable (x2 compared to x1, x3 compared to x1, x4 compared to x1, etc.)?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
fosulli
  • 71
  • 1
  • 1
  • 3

1 Answers1

7

The vif function in the car package works like this:

  1. Run an OLS regression that has for example $X_1$ as a dependent variable on the left hand side and all your other independent variables on the right hand side.
  2. Take the $R^2$ from the regression in 1 and stick it into this equation: ${\rm VIF} = \frac{1}{1-R_i^2}$.

This is done for every independent variable of your regression.

gung - Reinstate Monica
  • 132,789
  • 81
  • 357
  • 650
Metamatics
  • 79
  • 2
  • This answer is correct that each predictor is examined separately against all the others. This, however, isn't the formula that `vif()` in the `car` package uses. See the code by typing `getAnywhere(vif.default)` at the R command prompt once the `car` package is loaded. The calculation is based on the variance-covariance matrix among the coefficient estimates. The VIF value returned should agree with the above calculation for an ordinary least squares model, but it won't for generalized linear models. – EdM Jul 31 '20 at 16:39