rmulticollinearity

VIF Test for Multiple Multivariate Regression


I would like to test for the Multicollinearity by using the VIF function. I have a model with 13 measures and 4 predictors, created like so:

M <- lm(cbind(S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13) ~ x1 + x2 + x3 + x4, data = dat)
M

When I try to run the vif function on this model, it gives an error.

if (names(coefficients(mod)[1]) == "(Intercept)") { : argument is of length 0
vif(M)

I also tried doing each measure separately, but it is pretty repetitive to test 13 models on all assumptions, though vif() works then.

Is there a way to make this work for the whole model? I am sorry for not including a set of data to test this on. I hope it still conveys my problem.


Solution

  • The VIF doesn't involve the dependent variable - it's only about the independent variables, so if you ran, for instance

    m1 = lm(S1 ~ x1 + x2 + x3 + x4, data = dat)
    vif(m1)
    

    that should tell you all you need.