Source-linked AI summary
Bayesian random-effects meta-analysis using the bayesmeta R package
Christian Röver
TL;DR
Meta-analysis often involves few studies, where heterogeneity and its uncertainty complicate inference and frequentist plug-in approaches can be problematic. The paper presents bayesmeta, a fully Bayesian NNHM implementation that provides accessible, reproducible posterior analysis with flexible priors and advanced procedures. It illustrates the approach with posterior summaries and shows how Bayesian and frequentist results can correspond through a shared likelihood.
Problem
Few-study meta-analyses require inference that accounts for heterogeneity uncertainty, because plug-in estimation and improper prior choices can create problems.
Method
The paper introduces bayesmeta as an accessible fully Bayesian implementation of the normal-normal hierarchical model with flexible priors and quasi-analytical posterior computations.
Results
The package provides fast, reproducible posterior summaries and supports prediction and shrinkage estimation; an example reports a posterior median log-OR of −1.57 with a 95% credible interval of [−2.23, −0.93].
Takeaways & Limitations
bayesmeta enables practical Bayesian meta-analysis with accessible posterior distributions, advanced analyses, and results comparable to frequentist estimates through a shared likelihood.
Takeaways & Limitations
Improper priors can yield improper posteriors: the uniform effect prior does not produce a proper posterior when k ≤2, and some heterogeneity priors require k≥4 studies.
Abstract
from arXiv · showhide
The random-effects or normal-normal hierarchical model is commonly utilized in a wide range of meta-analysis applications. A Bayesian approach to inference is very attractive in this context, especially when a meta-analysis is based only on few studies. The bayesmeta R package provides readily accessible tools to perform Bayesian meta-analyses and generate plots and summaries, without having to worry about computational details. It allows for flexible prior specification and instant access to the resulting posterior distributions, including prediction and shrinkage estimation, and facilitating for example quick sensitivity checks. The present paper introduces the underlying theory and showcases its usage.
1. Introduction
Meta-analysis combines evidence from separate investigations, while the NNHM models between-study heterogeneity and Bayesian inference accounts for uncertainty in all parameters. The bayesmeta package makes this framework accessible with fast, reproducible posterior summaries and advanced analyses.
- Meta-analysis mathematically combines information from individual investigations into a joint result for evidence-based decision-making.
- The NNHM is a random-effects model for combining estimates with standard errors while representing between-study variability through an additional variance component.
- Few-study meta-analyses make Bayesian modeling especially relevant because large-sample approximations may not apply and heterogeneity uncertainty can be substantial.
- Bayesian inference marginalizes over uncertain heterogeneity rather than conditioning on a plug-in estimate, avoiding dependence on a single heterogeneity estimator.
- A coherent Bayesian framework also supports sequential meta-analyses, future-experiment design, and incorporation of historical data through posterior-to-prior updating.
- The bayesmeta package provides accurate, fast, reproducible posterior summaries without requiring MCMC expertise, alongside prediction, shrinkage estimation, and posterior-distribution access.
2. Random-effects meta-analysis
The normal-normal hierarchical model combines study estimates and known standard errors while allowing study-specific effects to vary around an overall mean through heterogeneity. Bayesian inference requires priors for the effect and heterogeneity, with prior choice especially consequential when few studies provide limited information about heterogeneity.
- Model: Each study estimate y_i is modeled as normally distributed around its true parameter θ_i with known standard error σ_i.
- Model: Between-study heterogeneity is represented by normally distributed deviations of θ_i from the overall mean µ, with variance τ^2 ≥ 0.This second hierarchy level implements the random-effects assumption.
- Model: Integrating out θ_i yields a marginal formulation whose main unknowns are the mean effect µ and heterogeneity τ; shrinkage estimates of θ_i may also be inferred.When τ = 0, the model becomes fixed-effect with identical study-specific means.
- Prior specification: The prior is factorized as p(µ, τ) = p(µ) × p(τ), with uniform or normal priors considered for µ and several informative or non-informative choices available for τ.A normal prior for µ is conditionally conjugate, while an improper uniform prior is the non-informative location-prior option.
- Prior specification: Informative heterogeneity priors may be valuable with few studies, because the data may provide limited information about between-study variability.Exponential, log-normal, half-normal, and related priors are discussed; inverse-Gamma priors are generally not recommended.
3. Using the bayesmeta package
The example demonstrates a complete bayesmeta workflow, from deriving study-level log-ORs and standard errors to examining posterior, predictive, shrinkage, sensitivity, and hypothesis-testing outputs.
- Example data: The immunosuppression example combines six studies of paediatric liver-transplantation rejection using study-specific log-OR estimates and standard errors.The data originate from 2×2 contingency tables and summarize treatment versus control AR events.
- Example data: Effect sizes and squared standard errors can be calculated from the binary data with metafor::escalc(), with continuity correction required for one zero cell.The resulting data frame contains yi and vi, where vi is the squared standard error.
- Posterior summaries: The example’s posterior median effect is a log-OR of −1.57 with a 95% credible interval of [−2.23, −0.93].The analysis used k = 6 studies and proper priors for both parameters.
- Plots and estimates: The default forest plot displays study estimates and 95% intervals alongside overall-effect, predictive, and study-specific shrinkage intervals.The plot also presents credible intervals for the overall effect and predictive distribution.
- Prior sensitivity: The package supports prior sensitivity checks: alternative heterogeneity priors produced very similar results in this example.Prior predictive distributions are interpreted on the exponentiated scale for log-OR effects.
- Subgroup and predictive checks: For the two randomized studies, the absolute effect estimate was slightly larger but its credible interval was wider than in the six-study analysis.Posterior predictive p-value analyses returned 0.01 for the overall effect, approximately 16.1% for one study-specific effect, and 22.2% for a Bayes-factor comparison.
4. Summary
Bayesian inference offers advantages for meta-analysis with few studies, and bayesmeta makes Bayesian random-effects analyses accessible without requiring users to manage computational details.
- Bayesian modeling coherently processes uncertainty in the heterogeneity parameter while focusing inference on effect parameters.
- Small numbers of studies do not pose a difficulty for Bayesian meta-analysis.
- Bayesian results are straightforward to interpret once the model and prior are specified.
- The bayesmeta package performs Bayesian random-effects meta-analyses without requiring users to manage computational details.
- The package supports quick, accurate, reproducible computation for the normal-normal hierarchical model across many input data types and effect measures.
Logarithmic odds ratios (log-OR)
The log-OR section describes standard-error construction from 2×2 contingency tables and heuristic unit-information priors under neutral and general event-probability settings.
- For a log-OR, the standard error is derived from the four 2×2 table counts a, b, c, and d and total sample size N.
- Under equal allocation and a neutral effect, the contingency-table counts are set to a = b = c = d = N/4.
- With N = 1, this construction heuristically yields a zero-mean log-OR unit-information prior with standard deviation 4.
- The resulting log-OR prior places 95% probability within ±7.84, corresponding to odds ratios roughly between 1/2500 and 2500.
- For event probability p, a = c = pN/2 and b = d = (1−p)N/2 define a more general unit-information prior construction.
Logarithmic relative risks (log-RR)
The log-RR section gives the associated standard-error construction and evaluates it under equal allocation, including dependence on the event probability.
- Under equal allocation with a = b = c = d = N/4, the resulting standard deviation is 2.
- With event probability p and a + b = c + d = N/2, the error is expressed using the corresponding probability-based allocation.
- The error becomes smaller for p > 1/2.
A.2. Conservatism of the uniform heterogeity prior
The appendix establishes a conservatism property for the improper uniform heterogeneity prior: under specified conditions, it yields stochastically larger posterior values than decreasing-density alternatives.
- Defining an uninformative prior for the heterogeneity parameter τ is difficult.
- Increasing heterogeneity generally increases the marginal posterior variance of the effect.
- The derivation assumes a bounded domain [a, ∞], a nonnegative likelihood with finite integral, and a finite-intercept monotonically decreasing prior density.
- Under these conditions, the posterior cumulative distribution using the decreasing prior satisfies Fp(y) ≥ F1(y) for all y > a.
- Consequently, the improper uniform prior produces a stochastically larger posterior, with larger quantiles or expectations than the specified decreasing-density priors.
- The property covers exponential, half-normal, half-Student-t, half-Cauchy, Lomax, and bounded uniform priors.
A.3. Marginal likelihood derivation
This subsection derives the marginal likelihood under an improper uniform prior for the effect and introduces the corresponding conditional posterior summaries. It also notes the extension to an informative normal prior.
- With the improper uniform prior p(µ) ∝ 1, the marginal likelihood is obtained by marginalizing over µ.
- The functions bµ(τ) and bσ(τ) are the conditional posterior mean and standard deviation of µ|τ.
- The derivation is extended to an informative normal prior for the effect with mean µp and variance σ2.
A.4. Mixture implementation details
The package approximates marginal effect, shrinkage, and predictive distributions as mixtures of conditionally normal distributions. A direct algorithm constructs discrete mixtures using divergence-based grid selection, while predictive distributions reuse the effect grid without loss of accuracy.
- Marginal effect, shrinkage, and predictive distributions are approximated as mixtures of conditionally normal distributions.The approximation covers the overall effect µ, shrinkage estimates θi, and predictions θk+1.
- The direct algorithm constructs the approximate discrete mixture by evaluating symmetrized divergences.
- The effect posterior grid can also be used for the predictive distribution because their conditional means are identical and predictive variance is never smaller.This reuse is stated to preserve accuracy.
- The general algorithm is extended to avoid constructing separate τ grids for different shrinkage distributions.
A.5. Calibration check
The calibration check evaluates whether Bayesian posterior probabilities produce uniformly distributed PIT values under repeated prior-predictive simulation. In the reported simulations, the empirical PIT distributions closely matched uniformity, and one-sided 95% credible limits had coverage close to 95%.
- Calibration is assessed by repeatedly generating parameters from the prior, data conditionally on those parameters, and posterior PIT values.Accurate implementation should yield uniformly distributed PIT values.
- The simulation varied study counts k from 2 to 20 and standard errors σi from 0.2 to 1.0 across 1000 replications.The PIT matrix recorded marginal effect µ and heterogeneity τ values.
- Figure 8 displays empirical cumulative distribution functions for PIT values of the effect and heterogeneity parameters against a uniform reference line.
- The empirical PIT distributions were in close agreement with the uniform distribution.
- One-sided 95% credible limits had empirical coverage close to 95% in the simulations.The plots also provide a way to assess empirical coverage directly.
- For heterogeneity, a curve above the diagonal indicates conservative behavior, whereas conservative effect intervals produce a characteristic below-then-above-diagonal curve.
Journal of Statistical Software http://www.jstatsoft.org/
The supplied passages contain publication and journal metadata only: a Journal of Statistical Software URL, publication date placeholders, volume and issue placeholders, submission and acceptance dates, and a DOI.
- The paper is associated with the Journal of Statistical Software website at http://www.jstatsoft.org/.
- The metadata lists submission on 2017-11-23 and acceptance on 2018-09-02.
- The record includes the DOI 10.18637/jss.v000.i00 and placeholder volume and issue fields.