Computes the variance inflation factor (VIF) of the colums in a data frame. Warning: variables in preference.order
not in colnames(x)
, and non-numeric columns are removed silently from x
and preference.order
. The same happens with rows having NA values (na.omit()
is applied). The function issues a warning if zero-variance columns are found.
vif(x)
Data frame with numeric columns, typically containing a set of model predictors.
A data frame with two columns having the name of the variables in 'x' and their respective VIF values.
if(interactive()){
data(plant_richness_df)
vif(plant_richness_df[, 5:21])
}