R/diagnostics.R
compute_vif.Rd
For each column j of X, regresses column j on the remaining columns (plus an intercept) and returns 1/(1 - R^2).
compute_vif(X, column_names = NULL)
Design matrix (without intercept).
Optional character vector of names.
Named numeric vector of VIFs.
set.seed(5) X <- matrix(rnorm(300), 100, 3) colnames(X) <- c("a", "b", "c") compute_vif(X) #> a b c #> 1.017408 1.017908 1.006675