Computes Cook's distance for a fitted brma object. Cook's distance measures the aggregate influence of each observation on the model coefficients.
Usage
# S3 method for class 'brma'
cooks.distance(model, ...)Details
Cook's distance is computed as a PSIS leave-one-out deletion diagnostic. For each observation \(i\), normalized PSIS weights estimate the fitted values under the leave-one-out posterior. The distance is the squared posterior Mahalanobis distance between the full-data and leave-one-out fitted-value vectors: $$D_i = \Delta_i' V_\mu^+ \Delta_i$$
where \(\Delta_i = \hat{\mu} - \hat{\mu}_{(-i)}\), \(V_\mu^+\) is the
generalized inverse of the full-posterior fitted-value covariance. This uses
the unscaled meta-analytic convention of metafor and
Viechtbauer and Cheung (2010)
, without division by the
fixed-effect model rank. Values can differ from metafor because RoBMA
uses posterior moments and PSIS deletion rather than classical refits.
For brma.mv() known-V models, Cook's distance uses
estimate-unit PSIS weights. With correlated known-V, deletion is
conditional estimate deletion and the reported fitted-value target is the
fixed-location mean \(\mu = X\beta\); sampled or marginalized random
effects are not included in the reported fitted value.
Selection brma.mv() influence is currently unavailable. The PSIS
fixed-location moments do not require the inverse marginal covariance used
by hatvalues().
Examples
if (FALSE) { # \dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
data(dat.lehmann2018, package = "metadat")
fit <- bPET(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
fit <- add_loo(fit)
cooks.distance(fit)
}
} # }