O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: car and faraway. We will use it from the faraway package.

  1. Load the faraway package with library(faraway).
  2. 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.
  3. 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required