vibhuti verma
vibhuti verma

Reputation: 41

unable to find an inherited method for function ‘vif’ for signature ‘"integer"’

I am unable to run the vif command

mData = read.csv(file.choose())
attach(mData)
head(mData)
reg1= lm(MPG~Weight)
plot(reg1)
summary(reg1)
vif(Weight)

It throws an error like:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘vif’ for signature ‘"integer"’

Upvotes: 4

Views: 9103

Answers (1)

Qinjun
Qinjun

Reputation: 61

The command vif exists at both package car and package usdm, and the command objects in these packages are also different. R can't identify which vif you are trying to use.

To solve the problem, try below command:

detach("package:usdm", unload=TRUE)
library(car)

Then run

vif(your_model) 

Upvotes: 6

Related Questions