| ranef.brma | R Documentation |
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().
## S3 method for class 'brma'
ranef(object, bias_adjusted = FALSE, probs = c(0.025, 0.975), ...)
object |
a fitted brma object |
bias_adjusted |
whether to adjust for publication bias. Defaults to
|
probs |
quantiles of the posterior distribution to be displayed.
Defaults to |
... |
additional arguments forwarded to |
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.
For 2-level models, a brma_samples object. For 3-level
models, a named list of brma_samples objects (one per variance
component).
blup.brma(), predict.brma(), pooled_effect()
## Not run:
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)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.