title: Why I am getting an error when running the vif() function in R?
body: <p>I am checking multicollinearity for my data and am using 3 tests which are Spearman correlation, the condition number and Variance Information Factors (VIF). When I am trying to run the VIF code in R and error is being prompted.</p>
  
  <p>I have managed to run the Spearman correlation and condition number and have removed highly correlated variables where the <code>r-value</code> with a cut-off of 0.3. Next I have tried to check the vif of every variable using the the <code>vif()</code> function in <code>R</code>.</p>
  
  <pre><code>Data &lt;- read.csv("Data.csv")
  names(Data)
  attach(Data)
  dim(Data)
  
  sapply(Data,class)
  
  #selecting explanatory variables
  DataRed &lt;- Data[,c(4:8,10:73)]
  dim(PrepaidMatRed)
  #setting my data as a data frame
  DataDF &lt;- data.frame(DataRed,row.names = NULL,check.rows = FALSE,check.names = TRUE)
  
  VIF &lt;- vif(DataDF)
  </code></pre>
  
  <p>The expected out is to have a VIF value for all variable but I am getting the below mentioned error:</p>
  
  <pre><code>Error in vcov.default(mod) : 
  there is no vcov() method for models of class data.frame
  </code></pre>