Regression Variance Inflation Factor (VIF)

  1. Correct. GLM.jl currently does not have a vif function.
  2. RegTools.jl, has it, but is no longer maintained…
  3. It’s easy to do w/ linear algebra or to define your own function
using Statistics, LinearAlgebra
vifm = diag(inv(cor(X[:,2:end])))
vifm ≈ [vif_X1; vif_X2; vif_X3;]  # verify result above

# own function 
vif_GLM(mod) = diag(inv(cor(mod.model.pp.X[:,2:end])))

julia> vif_GLM(m_y) ≈ vifm ≈ [vif_X1; vif_X2; vif_X3;]
true
2 Likes