multicollinearity: multicollinearity

Description Usage Arguments Value Examples

View source: R/multicollinearity.R

Description

This function receives aan input dat, linear regression model and vif threshold, and outputs VIF for each feature along with a statement whether or not the multicollinearity assumption is violated.

Usage

1
multicollinearity(data, formula, vif_threshold = 10)

Arguments

data

a dataframe containing predictor data

formula

a formula in the format "y ~ x1 + x2 + ..." indicating regression variables

vif_threshold

a float indicating threshold for VIF

Value

a dataframe containing VIF coefficients and a statement whether the assumption is violated.

Examples

1
2
3
4
library(tibble)
data <- tibble(X1 = c(1,2,3,4,5), X2 = c(2,5,7,8,8), y = c(1,3,5,3,7))
formula <- "y ~ X1 + X2"
multicollinearity(data, formula, 10)

UBC-MDS/linregasm documentation built on Feb. 6, 2022, 7 a.m.