0

I want to check the multicolinearity of variables in my lm model using vif().

It is throwing error and hence I am not able to use:

> library(car)  
Error in library(car) : there is no package called ‘car’
> vif(mymodel3)
Error in vif(mymodel3) : could not find function "vif"

I have tried to install 'car' package many times. It gives some warnings like below:

> install.packages("car",dependencies = TRUE)
Installing package into ‘C:/Users/HP/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘pbkrtest’ is not available

  There is a binary version available but the source version is later:
    binary source needs_compilation
car  3.0-7  3.0-8             FALSE

installing the source package ‘car’

trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-8.tar.gz'
Content type 'application/x-gzip' length 499932 bytes (488 KB)
downloaded 488 KB

ERROR: dependency 'pbkrtest' is not available for package 'car'
* removing 'C:/Users/HP/Documents/R/win-library/3.5/car'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘car’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\HP\AppData\Local\Temp\Rtmpw3noJW\downloaded_packages’

kindly suggest how to fix this issue with car package in R.

Also, please suggest if there is any alternative function other than using vif() that can be used in R Studio for multicolinearity of variables in my lm model.

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 1
    It says that *"dependency 'pbkrtest' is not available"*, have you tried `install.packages("pbkrtest")`? – r2evans Jul 02 '20 at 04:23
  • @r2evans Yes, it gives another error. install.packages("pbkrtest") Installing package into ‘C:/Users/HP/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘pbkrtest’ is not available (for R version 3.5.2) – sudip narayan Choudhury Jul 02 '20 at 05:29
  • If you look at the [CRAN page for `pbkrtest`](https://cran.r-project.org/web/packages/pbkrtest/index.html), you'll see that it requires `R (≥ 3.6.0)`. This means you'll need to find the next previous version that does not have this requirement, and then either grab it's source targz file and install it manually or use `devtools::install_version` to do that for you. – r2evans Jul 02 '20 at 05:54
  • See https://cran.r-project.org/src/contrib/Archive/pbkrtest/ for previous versions, I don't know which version changed the required version of R. – r2evans Jul 02 '20 at 05:56
  • 1
    Installed 3.6.0 now. Resolves the issue. Thanks @r2evans – sudip narayan Choudhury Jul 02 '20 at 08:53

0 Answers0