Extracts random effect deviations from a fitted brma object.
These are posterior-sample offsets from the fixed-effect predictions,
analogous to random-effect deviations returned by metafor::ranef().
Arguments
- object
a fitted brma object
- bias_adjusted
whether to adjust for publication bias. Defaults to
FALSE. Seeblup.brmafor details.- probs
quantiles of the posterior distribution to be displayed. Defaults to
c(.025, .975)for 95% credible intervals.- ...
additional arguments forwarded to
predict.brmafor supported options such asconditional.newdata,type,quiet,output_measure, andtransformare controlled by this method.
Value
For 2-level models, a brma_samples object. For 3-level
models, a named list of brma_samples objects (one per variance
component).
Details
Random effects are computed as the difference between the true effects (BLUPs) and the fixed-effect predictions: $$u_i = \hat{\theta}_i - \hat{\mu}_i$$
For standard (2-level) models, returns a single brma_samples
object with the estimate-level random effects.
For multilevel (3-level) models, returns a list with two observation-aligned
brma_samples matrices, one column per estimate row:
clusterCluster-level random effects (\(\gamma_j \cdot \tau_{between}\)), representing between-cluster deviations from the fixed effects.
estimateEstimate-level random effects (\(\theta_i - \mu_i - \gamma_j \cdot \tau_{between}\)), representing within-cluster deviations from the cluster means.
Examples
if (FALSE) { # \dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
data(dat.lehmann2018, package = "metadat")
fit <- brma(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
seed = 1,
silent = TRUE
)
ranef(fit)
}
} # }