我想使用 vif() 检查我的 lm 模型中变量的多重共线性。
它抛出错误,因此我无法使用:
> library(car)
Error in library(car) : there is no package called ‘car’
> vif(mymodel3)
Error in vif(mymodel3) : could not find function "vif"
我曾多次尝试安装“汽车”包。它给出了一些警告,如下所示:
> 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’
请建议如何使用 R 中的汽车包解决此问题。
另外,请建议是否有任何替代函数vif()
可以在 R Studio 中用于我的 lm 模型中变量的多重共线性。