1

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.

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Christina
  • 73
  • 6

1 Answers1

2

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.

DaveArmstrong
  • 18,377
  • 2
  • 13
  • 25
  • thank you, I even tested it for 2 dependent variables. Just totally overlooked that those are the same numbers. Sometimes you get just lost in them. – Christina Jan 30 '21 at 14:27