This vignette illustrates how to use the RoBMA R package
(Bartoš & Maier,
2020) when the outcome is a count rather than an effect-size
estimate. We walk through the BCG vaccine dataset from the
metafor package (Viechtbauer, 2010), showing the
brma.glmm() call alongside its
metafor::rma.glmm() counterpart for log odds ratios. The
interface mirrors metafor::rma.glmm(): counts
(ai, bi, ci, di) are
passed in directly, and no escalc() step is needed.
All brma.glmm() calls keep the default prior
distributions; see the Prior
Distributions vignette for the prior definitions and
customization options. For the non-GLMM workflow showing more features
(also applicable to GLMM models) see the Bayesian
Meta-Analysis vignette.
brma.glmm() currently supports binomial outcomes (log
odds ratio, measure = "OR") and Poisson outcomes (log
incidence rate ratio, measure = "IRR").
The BCG vaccine dataset from the metadat package
contains 13 randomized trials on tuberculosis prevention. Treated and
control event counts (tpos, tneg,
cpos, cneg) are passed in directly.
metafor::rma.glmm() fits the random-effects logistic
model. We use model = "UM.FS" to obtain the unconditional
model with fixed study-specific intercepts, the formulation that
corresponds to the binomial GLMM in brma.glmm() (Model 4 in
Jackson et al. (2018)).
fit1_metafor <- metafor::rma.glmm(
ai = tpos, bi = tneg, ci = cpos, di = cneg, measure = "OR",
model = "UM.FS", data = dat.bcg
)
fit1_metaforThe matching Bayesian fit takes the same count columns and
measure = "OR".
fit1_brma <- brma.glmm(
ai = tpos, bi = tneg, ci = cpos, di = cneg, measure = "OR",
data = dat.bcg, seed = 1
)summary() reports posterior means, credible intervals,
and (suppressed here) MCMC convergence diagnostics for the pooled log
odds ratio mu and the heterogeneity tau.
The posterior mean for mu tracks the maximum-likelihood
estimate from the metafor package, with comparable
heterogeneity tau. pooled_effect() returns the
same summary backtransformed to the odds-ratio scale via
transform = "EXP":
The default prior distributions on mu and
tau follow the unit-information set-up as elsewhere in the
package, scaled by the known unit information standard deviation for the
chosen measure (sqrt(4) for OR
and IRR). Beyond mu and tau, GLMM
models include estimate-specific nuisance parameters for the per-study
baseline level. For binomial outcomes (measure = "OR"),
logit(pi[i]) is the midpoint of the two arm logits before
applying half of the study-specific log odds ratio to each arm. The
default prior_baserate = Beta(1, 1) is placed independently
on each pi[i]. For Poisson outcomes
(measure = "IRR"), phi[i] is the midpoint of
the two arm log incidence rates before applying half of the
study-specific log incidence rate ratio to each arm. Because this
midpoint log-rate is unbounded, there is no bounded flat default
analogous to Beta(1, 1), so the default
prior_lograte is a proper data-based unit-information
normal used independently for each phi[i]. Thus the default
nuisance-parameter prior distributions are exchangeable in the iid
sense, but they are not hierarchical prior distributions with a learned
common baseline-rate distribution. Both defaults can be overridden via
the corresponding prior_* argument; see the Prior Distributions
vignette. The Poisson model corresponds to Bagos
& Nikolopoulos (2009) and
uses event counts and exposure times (x1i,
t1i, x2i, t2i) in place of the
four-way count layout.
All inference helpers available for any other brma() fit
work the same way for a brma.glmm() fit. Meta-regression
via mods, multilevel structures via cluster,
location-scale models via scale, posterior summaries,
plots, predictions, residuals, influence, and LOO comparisons all carry
over. See the Bayesian
Meta-Analysis vignette for the full walkthrough and the Multilevel
Meta-Analysis vignette for the multilevel extension; the only
thing that changes here is the count-based input and the auxiliary
baseline-rate prior.