Svet Lana
Svet Lana

Reputation: 11

vif, multicollinearity, Error in as.vector(y) - mean(y) : non-numeric argument to binary operator,

Please help! By using vif for multicollinearity come those errors:

vif (M1) Error in as.vector(y) - mean(y) : non-numeric argument to binary operator

In addition: Warning message: In mean.default(y) : argument is not numeric or logical: returning NA

My script:

library(lmtest) 
M1 <- lm(y ~ x + x1 + x2,           
          data = Mydata)
summary(M1)
library(VIF)
vif (M1)

Upvotes: 1

Views: 1739

Answers (1)

You should do the following steps:

install.packages("car") 
library(car)
vif(M1)

It works for me

Upvotes: 2

Related Questions