Learn R Programming

preputils (version 1.0.3)

vifx: Compute Variance inflation factor

Description

Calculate variance inflation factors (VIF) for all numeric variables contained in data set

Usage

vifx(x)

Arguments

x

name of data frame for which the VIFs should be computed

Value

A named vector with names given by the contained numeric variables and values by the computed respective VIFs

Details

The function reads in the object named in x, builds a linear model for each of the contained variables in the data set, regressing the selected variable on all other numeric variables contained in the data set.

The multiple R-squared is computed and transformed to VIF using following formula: \(VIF_i=\frac{1}{1-R_i^2}\)

Examples

Run this code
# NOT RUN {
    vifx(iris)
# }

Run the code above in your browser using DataLab