Learn R Programming

datana (version 1.1.2)

vifx: Computes the variance inflation factor (VIF) for a multiple linear regression (MLR) model.

Description

Function to compute the variance inflation factor (VIF) for a multiple linear regression model.

Usage

vifx(mod = mod)

Value

This function creates a LaTeX file having the main fitting statistics of a linear regression model.

Arguments

mod

an object containing the fitted MLR model by using the lm() function.

Author

Christian Salas-Eljatib.

Details

The resulting out is a dataframe having the VIF for each of the predictor variables.

References

Salas-Eljatib, C. 2021. Análisis de datos con el programa estadístico R: una introducción aplicada. Ediciones Universidad Mayor, Santiago, Chile. 170 p. https://eljatib.com/rlibro

Examples

Run this code
##Two fitted models
mod1 <- stats::lm(mpg ~ cyl+disp + hp + wt + drat, data = mtcars)
mod2 <- stats::lm(mpg ~ disp + hp + wt + drat, data = mtcars)
##The VIF values for each regression model
vifx(mod=mod1)
vifx(mod=mod2)

Run the code above in your browser using DataLab