The vif() function, part of the car package, can be used to compute variance inflation
factors. Most VIF’s are low to moderate for this data. The car package is
not part of the base R installation so it must be downloaded the first time
you use it via the install.packages option in R.
install.packages("car")
Once the package is installed on your computer, then you can load it and use the functions that are part of that package.
library(car)
vif(lm.fit)
crim zn indus chas nox rm age dis rad tax
1.792192 2.298758 3.991596 1.073995 4.393720 1.933744 3.100826 3.955945 7.484496 9.008554
ptratio black lstat
1.799084 1.348521 2.941491
Try calling the vif function from the given model:
Assume that:
MASS and car libraries have been loadedBoston dataset has been loaded and attached