Regression - Diagnostic - Multicollinearity (VIF) extension

From Q
Jump to: navigation, search

Computes the variance inflation factors (VIF) of linear models and generalized variance-inflation factors (GCIF) for generalized linear models. See the blog for an introduction to VIFs.


The below table contains the output from running this QScript on a Regression - Binary Logitbinary logit output.

Technical details

A score of 10 or above indicates high multicollinearity.


Uses the vif function from the car package.


Fox, J., & Monette, G. (1992). Generalized collinearity diagnostics. Journal of the American Statistical Association, 87(417), 178-183.

Bock, T. (2018, April 6). What are Variance Inflation Factors (VIFs)? [Blog post]. Retrieved from


includeWeb("QScript R Output Functions");

var is_displayr = (!!Q.isOnTheWeb && Q.isOnTheWeb());
if (!is_displayr)
    if (Q.fileFormatVersion() >= 17.13)
        alert("Please update Q to use this feature from the extension button, or run it from the menu via Create > Regression > Diagnostic > Multicollinearity (VIF).");

function main() {

    // The following 2 variables contain information specific to this diagnostic.
    var required_class = "Regression";
    var output_name_suffix = "multicolinearity";
    var item = checkSelectedItemClass(required_class);
    if (item == null)
        return false;
    var r_name = stringToRName(item.referenceName);

    // The following lines contain the R code to run
    var expression = "car::vif(" + r_name + ")"

    return createROutput(item, expression, output_name_suffix);