Add the variance inflation factor (VIF) or
generalized VIF (GVIF) to the regression table.
Function uses car::vif() to calculate the VIF.
add_vif(x, statistic = NULL, estimate_fun = label_style_sigfig(digits = 2))'tbl_regression' object
"VIF" (variance inflation factors, for models with no categorical terms) or one of/combination of "GVIF" (generalized variance inflation factors), "aGVIF" 'adjusted GVIF, i.e. GVIF^[1/(2*df)] and/or "df" (degrees of freedom).
See car::vif() for details.
Default is label_style_sigfig(digits = 2).
Review list, formula, and selector syntax used throughout gtsummary
# Example 1 ----------------------------------
lm(age ~ grade + marker, trial) |>
tbl_regression() |>
add_vif()
Characteristic
Beta
95% CI
p-value
GVIF
Adjusted GVIF1
Abbreviations: CI = Confidence Interval, GVIF = Generalized Variance Inflation Factor
1 GVIF^[1/(2*df)]
# Example 2 ----------------------------------
lm(age ~ grade + marker, trial) |>
tbl_regression() |>
add_vif(c("aGVIF", "df"))
Characteristic
Beta
95% CI
p-value
Adjusted GVIF1
df
Abbreviations: CI = Confidence Interval, GVIF = Generalized Variance Inflation Factor, df = degrees of freedom
1 GVIF^[1/(2*df)]