Skip to contents

Introduction

The Gaussian random-effects model is the default meta-analysis model in bayesma. It assumes that the true effects across studies are exchangeable draws from a normal distribution, with between-study variability governed by a heterogeneity parameter τ\tau. This is the correct starting point when there is no strong reason to assume that every study estimates an identical effect.

The common-effect model (all studies share one θ\theta) is a limiting case at τ=0\tau = 0. See Common-Effect Model for when it is preferable.

Model specification

Let yiy_i be the effect estimate and sis_i the known standard error from study i=1,,ki = 1, \ldots, k. The two-level hierarchy is:

Likelihood: yiθi𝒩(θi,si2) y_i \mid \theta_i \sim \mathcal{N}(\theta_i,\; s_i^2)

Random-effects distribution: θiμ,τ𝒩(μ,τ2) \theta_i \mid \mu, \tau \sim \mathcal{N}(\mu,\; \tau^2)

Marginalising over the study-specific effects θi\theta_i gives the integrated likelihood used for inference:

yiμ,τ𝒩(μ,si2+τ2) y_i \mid \mu, \tau \sim \mathcal{N}(\mu,\; s_i^2 + \tau^2)

Studies with smaller sis_i still receive more weight, but the weight differential narrows as τ\tau grows.

Priors

bayesma defaults:

μ𝒩(0,1),τHalf-Cauchy(0,0.5) \mu \sim \mathcal{N}(0,\; 1), \qquad \tau \sim \text{Half-Cauchy}(0,\; 0.5)

The Half-Cauchy(0, 0.5) prior on τ\tau is weakly informative: it assigns most prior mass to small heterogeneity while keeping moderate-to-large values within the plausible range. For effect sizes on standardised scales (log-OR, SMD), heterogeneity above τ=1\tau = 1 is already very large.

Priors can be overridden via the prior_mu and prior_tau arguments:

#| eval: false
fit <- bayesma(
  data,
  prior_mu  = normal(0, 0.5),
  prior_tau = half_normal(0, 0.5)
)

See Prior Predictive Checks and Sensitivity Analysis for guidance.

Fitting the model

#| eval: false
fit_re <- bayesma(data)  # Gaussian RE is the default

summary(fit_re)

The summary() output reports the posterior median and 95% credible interval for μ\mu, τ\tau, and I2I^2, along with convergence diagnostics.

Key estimands

Overall effect μ\mu

The posterior for μ\mu quantifies the mean of the distribution of true effects. This is the best estimate of what a new, exchangeable study would find on average.

Between-study heterogeneity τ\tau

τ\tau is the standard deviation of the true-effect distribution. Larger τ\tau means more variation in true effects across studies. The posterior for τ\tau should be examined directly — if it has substantial mass near zero, the data are consistent with negligible heterogeneity.

I2I^2

bayesma reports the posterior distribution of I2I^2, defined as:

I2=τ2τ2+s̃2 I^2 = \frac{\tau^2}{\tau^2 + \tilde{s}^2}

where s̃2\tilde{s}^2 is the typical within-study variance. I2I^2 is a relative measure: the proportion of total observed variance attributable to between-study heterogeneity. It depends on both τ\tauand the precision of the primary studies, so it should be interpreted alongside τ\tau rather than in isolation.

Prediction interval

The 95% prediction interval for a new study’s true effect is

μ±1.96τ \mu \pm 1.96\,\tau

This is wider than the credible interval for μ\mu and is reported by summary() when prediction_interval = TRUE.

Assumptions

The Gaussian random-effects model assumes:

  1. Exchangeability: the true effects θi\theta_i are drawn from the same distribution. This requires that the studies are sufficiently similar in population, intervention, comparator, and outcome to justify pooling.
  2. Normal random-effects distribution: the distribution of true effects is symmetric. When this is implausible — for example, when outlier studies are suspected — consider Alternative RE Distributions or RE Mixture Models.
  3. Known within-study variances: si2s_i^2 is treated as fixed at the estimated value. This approximation deteriorates for very small studies.

Heterogeneity assessment

#| eval: false
bayesma_output(fit_re, type = "heterogeneity")

This produces a table of τ\tau, I2I^2, and H2H^2 with posterior intervals. For a visual assessment see Funnel Plots and Posterior Predictive Checks.

Choosing between common-effect and random-effects

The random-effects model is the appropriate default for most meta-analyses. Reserve the common-effect model for planned sensitivity analyses, when exchangeability is genuinely implausible to question (e.g., replications of the same study by the same team), or when the number of studies is very small and τ\tau cannot be estimated reliably.

Bayesian model comparison via compare_models() provides formal evidence for or against heterogeneity:

#| eval: false
fit_ce <- bayesma(data, model = "common_effect")
compare_models(fit_ce, fit_re, labels = c("Common-effect", "Random-effects"))