levi_jeans <- read_csv("https://raw.githubusercontent.com/kaitlyncook/data-sets/main/levis-jeans-1.csv")
# Calculating the VIF for height by hand
height_inseam_lm <- lm(height ~ inseam + age, data = levi_jeans)
height_inseam_lm |>
glance() |>
mutate(vif = 1 / (1 - r.squared)) |>
select(r.squared, vif)# A tibble: 1 × 2
r.squared vif
<dbl> <dbl>
1 0.931 14.6


