This function automatically select non-correlated metrics based on a Variance Inflation Factor analysis. To do so, we exclude the metric that has the highest VIF score above a threshold value (default = 5) since the metric is the most predictable by others. We repeat an application of VIF analysis on the remaining metrics until all remaining metrics have their VIF scores below a threshold value and free from multicollinearity.
stepwise.vif(dataset, metrics, vif.threshold = 5, verbose = F)
dataset | a data frame for data |
---|---|
metrics | a characters or a vector of characters for independent variables |
vif.threshold | a numeric for a threshold of VIF score (default = 5) |
verbose | TRUE for printing |