| vif.brma | R Documentation |
Computes variance inflation factors (VIF) and generalized VIF (GVIF) for a fitted brma meta-regression model. Also optionally returns the posterior correlation matrix of regression coefficients.
## S3 method for class 'brma'
vif(object, posterior_correlation = TRUE, ...)
object |
a fitted brma object with moderators |
posterior_correlation |
logical; whether to also compute and return
the posterior correlation matrix of regression coefficients. Defaults
to |
... |
additional arguments (currently ignored) |
VIF is computed from the correlation matrix derived from the
coefficient variance-covariance matrix (X'WX)^{-1}. For standard
meta-regression models, W = \mathrm{diag}(w_i/(v_i + \hat\tau^2))
with \hat\tau equal to the posterior mean heterogeneity. For scale
and multilevel models, the coefficient covariance is averaged across
posterior heterogeneity draws, using observation-specific \tau_i
and block-structured multilevel covariance where applicable.
A VIF of 1 indicates no collinearity; values above 5 or 10 are commonly considered problematic.
For multi-column terms, such as factor contrasts,
the Generalized VIF (GVIF) of \insertCitefox1992generalized;textualRoBMA
is reported. GVIF captures the joint inflation for all coefficients
belonging to the same term. To enable comparison across terms with different
degrees of freedom, GVIF^{1/(2 \cdot df)} is also reported; this
value can be compared against the usual VIF thresholds (after squaring).
When posterior_correlation = TRUE, the function also returns the
posterior correlation matrix of the regression coefficients. This
Bayesian diagnostic complements VIF: while VIF diagnoses the
potential for collinearity problems (a data property), the
posterior correlation shows the realized identification
given the data and priors. Informative priors can mitigate
collinearity, reducing posterior correlations even when VIF is high.
An object of class vif.brma containing:
vif |
A data frame with columns |
posterior_correlation |
A correlation matrix of posterior regression
coefficient samples when requested and available; otherwise |
regplot(), summary.brma()
## Not run:
if (requireNamespace("metadat", quietly = TRUE) &&
requireNamespace("metafor", quietly = TRUE)) {
data(dat.bcg, package = "metadat")
dat <- metafor::escalc(
measure = "RR",
ai = tpos,
bi = tneg,
ci = cpos,
di = cneg,
data = dat.bcg
)
fit <- brma(
yi = yi,
vi = vi,
mods = ~ ablat + year,
data = dat,
measure = "RR",
seed = 1,
silent = TRUE
)
vif(fit)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.