| dfbetas.brma | R Documentation |
Computes DFBETAS (Difference in BETAS, standardized) for a fitted brma object. DFBETAS measures the influence of each observation on the estimated model coefficients. Positive values indicate that deleting the observation yields a smaller estimate, negative values indicate that deleting the observation yields a larger estimate.
## S3 method for class 'brma'
dfbetas(
model,
type = "mods",
standardized_coefficients = FALSE,
transform_factors = TRUE,
return_loo_estimates = FALSE,
...
)
model |
a fitted brma object. |
type |
type of parameters to be summarized. Defaults to |
standardized_coefficients |
whether to show standardized meta-regression coefficients.
Defaults to |
transform_factors |
whether to transform factors to their original names.
Defaults to |
return_loo_estimates |
whether to return the leave-one-out coefficient
estimates used to compute DFBETAS instead of standardized DFBETAS values.
Defaults to |
... |
additional arguments (currently ignored). |
This function computes DFBETAS values using the Leave-One-Out (LOO) approximation based on Pareto Smoothed Importance Sampling (PSIS) weights. Ideally, DFBETAS is defined as:
DFBETAS_{ij} = \frac{\hat{\beta}_j - \hat{\beta}_{j(-i)}}{SE(\hat{\beta}_{j(-i)})}
where \hat{\beta}_j is the estimate of the j-th coefficient using
the full data, \hat{\beta}_{j(-i)} is the estimate when observation i
is omitted, and SE(\hat{\beta}_{j(-i)}) is the standard error of the
coefficient when observation i is omitted.
In the Bayesian context using LOO approximation:
\hat{\beta}_{j(-i)} is estimated as the importance sampling
weighted mean of the posterior samples, using PSIS weights w_{is}.
SE(\hat{\beta}_{j(-i)}) is estimated as the importance sampling
weighted standard deviation of the posterior samples.
This approximation allows computing influence statistics without refitting
the model K times, making it computationally efficient.
For type = "bias", fixed identification parameters (e.g., the reference
\omega = 1 interval) can have zero LOO posterior standard deviation.
These parameters are retained in the output, but their DFBETAS values are
reported as NaN because the standardized diagnostic is undefined.
Note: This function requires that LOO-CV has been computed for the model
using add_loo.
If return_loo_estimates = FALSE, a data frame with K rows
(observations) and P columns (parameters), containing DFBETAS values.
If return_loo_estimates = TRUE, returns the corresponding leave-one-out
coefficient estimates. Row names correspond to study labels (if available)
or indices.
add_loo, loo_weights.brma
## Not run:
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)
inf <- dfbetas(fit)
plot(inf[, 1], type = "h")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.