Time for action – addressing the multicollinearity problem for the Gasoline data
The multicollinearity problem is addressed using the
vif function, which is available from two libraries:
faraway. We will use it from the
- Load the
faraway package with
- We need to find the variance inflation factor (VIF) of the independent variables only. The covariate X11 is a character variable, and the first column of the Gasoline dataset is the regressand. Hence, run
vif(Gasoline[,-c(1,12)]) to find the VIF of the eligible independent variables.
- The VIF for x3 is highest at 217.587. Hence, we remove it to find the VIF among the remaining variables with
vif(Gasoline[,-c(1,4,12)]). Remember that x3 is the fourth column in ...