In statistics, the variance inflation factor (VIF) is the ratio (quotient) of the variance of a parameter estimate when fitting a full model that includes other parameters to the variance of the parameter estimate if the model is fit with only the parameter on its own.[1] The VIF provides an index that measures how much the variance (the square of the estimate's standard deviation) of an estimated regression coefficient is increased because of collinearity.
Cuthbert Daniel claims to have invented the concept behind the variance inflation factor, but did not come up with the name.[2]
Consider the following linear model with k independent variables:
Y = β0 + β1 X1 + β2 X 2 + ... + βk Xk + ε.
The standard error of the estimate of βj is the square root of the j + 1 diagonal element of s2(X′X)-1, where s is the root mean squared error (RMSE) (note that RMSE2 is a consistent estimator of the true variance of the error term,
\sigma2
\widehat{\operatorname{var}}(\hat{\beta}j)=
s2 | |
(n-1)\widehat{\operatorname{var |
where Rj2 is the multiple R2 for the regression of Xj on the other covariates (a regression that does not involve the response variable Y) and
\hat{\beta}j
{\beta}j
\widehat\operatorname{var}(Xj)
The remaining term, 1 / (1 - Rj2) is the VIF. It reflects all other factors that influence the uncertainty in the coefficient estimates. The VIF equals 1 when the vector Xj is orthogonal to each column of the design matrix for the regression of Xj on the other covariates. By contrast, the VIF is greater than 1 when the vector Xj is not orthogonal to all columns of the design matrix for the regression of Xj on the other covariates. Finally, note that the VIF is invariant to the scaling of the variables (that is, we could scale each variable Xj by a constant cj without changing the VIF).
\widehat{\operatorname{var}}(\hat{\beta}j)=s2[(XTX)-1]jj
r=XTX
Xj
r-1=\begin{bmatrix}rj,j&rj,-j\ r-j,j&r-j,-j\end{bmatrix}-1
rj,j=
T | |
X | |
j |
Xj,rj,-j=
T | |
X | |
j |
X-j,r-j,j=
T | |
X | |
-j |
Xj,r-j,-j=
T | |
X | |
-j |
X-j
By using Schur complement, the element in the first row and first column in
r-1
-1 | |
r | |
1,1 |
=[rj,j-rj,-j
-1 | |
r | |
-j,-j |
r-j,j]-1
\begin{align} &\widehat{\operatorname{var}}(\hat{\beta}j)=s2[(XTX)-1]jj=s2
-1 | |
r | |
1,1 |
\\ ={}&s2
T | |
[X | |
j |
Xj-
T | |
X | |
j |
X-j
T | |
(X | |
-j |
X-j)-1
T | |
X | |
-j |
Xj]-1\ ={}&s2
T | |
[X | |
j |
Xj-
T | |
X | |
j |
X-j
T | |
(X | |
-j |
X-j)-1
T | |
(X | |
-j |
X-j)
T | |
(X | |
-j |
X-j)-1
T | |
X | |
-j |
Xj]-1\\ ={}&s2
T | |
[X | |
j |
Xj-
T | |
\hat{\beta} | |
-j |
X-j)\hat{\beta}*j]-1\\ ={}&s2
1 | |
RSSj |
\\ ={}&
s2 | |
(n-1)\widehat\operatorname{var |
(Xj)} ⋅
1 | ||||||
|
\end{align}
\hat{\beta}*j
Xj
X-j
RSSj
We can calculate k different VIFs (one for each Xi) in three steps:
First we run an ordinary least square regression that has Xi as a function of all the other explanatory variables in the first equation.
If i = 1, for example, equation would be
X1=\alpha0+\alpha2X2+\alpha3X3+ … +\alphakXk+\varepsilon
where
\alpha0
\varepsilon
Then, calculate the VIF factor for
\hat\alphai
VIFi=
1 | ||||||
|
where R2i is the coefficient of determination of the regression equation in step one, with
Xi
Analyze the magnitude of multicollinearity by considering the size of the
\operatorname{VIF}(\hat\alphai)
\operatorname{VIF}(\hat\alphai)>10
Some software instead calculates the tolerance which is just the reciprocal of the VIF. The choice of which to use is a matter of personal preference.
The square root of the variance inflation factor indicates how much larger the standard error increases compared to if that variable had 0 correlation to other predictor variables in the model.
Example
If the variance inflation factor of a predictor variable were 5.27 (√5.27 = 2.3), this means that the standard error for the coefficient of that predictor variable is 2.3 times larger than if that predictor variable had 0 correlation with the other predictor variables.
vif
function in the car R packageols_vif_tol
function in the olsrr R packagePROC REG
in SAS Systemvariance_inflation_factor
function in statsmodels Python packageestat vif
in Statavif
(non categorical) and gvif
(categorical data) functions in StatsModels Julia programing language