Learn R Programming

README

Robust Bayesian Meta-Analysis (RoBMA)

The RoBMA R package fits a comprehensive collection of Bayesian meta-analytic models (Bartoš & Maier, 2020). It provides single-model fits, meta-regression, location-scale models, multilevel models, fully Bayesian model-averaged ensembles, and built-in publication-bias adjustment using selection models, PET-PEESE, and Robust Bayesian Meta-Analysis (RoBMA). Posterior sampling is performed by JAGS through a custom C++ module that implements the weighted distributions used in selection models. Prior handling, plotting, and Bayesian diagnostics are delegated to the companion BayesTools package.

This introduction maps the package at a high level and points to the more detailed vignettes that follow.

System Requirements

The RoBMA R package requires JAGS 4.3.1 or newer (Plummer, 2003). Install JAGS from https://mcmc-jags.sourceforge.io/ before installing the R package.

install.packages("RoBMA")

Note on backwards compatibility. The 4.0 release is not backwards compatible with earlier versions of the package. The Manuscript Companions section accompanies the methodological papers in which the RoBMA R package was originally developed and illustrated; the vignettes there have been updated to the 4.0 version of the package, and the numerical results differ from the published values because the underlying algorithms have changed. To reproduce the published analyses exactly, install RoBMA version 3.6.1 together with BayesTools version 0.2.23:

remotes::install_version("BayesTools", version = "0.2.23")
remotes::install_version("RoBMA",      version = "3.6.1")

Main Functions

The package exposes a small set of high-level fitting functions.

FunctionWhat it fits
brma(), brma.norm()Bayesian random-effects meta-analysis
brma.glmm()Bayesian GLMM meta-analysis (binomial / log OR or Poisson / log IRR)
bselmodel()Bayesian weight-function selection model
bPET(), bPEESE()Bayesian PET / PEESE publication-bias adjustment
BMA(), BMA.norm()Bayesian model-averaging across presence / absence of effect and heterogeneity (no bias adjustment)
BMA.glmm()Bayesian model-averaging for GLMM meta-analysis
RoBMA()Robust Bayesian model-averaging including publication-bias models

brma() and RoBMA() are the main workhorses. brma() fits a single model in the same spirit as metafor::rma(); RoBMA() averages across an ensemble that includes publication-bias adjustment. BMA() is RoBMA() without the bias-adjustment models.

All fitting functions

  • share an effect-size interface (yi, sei / vi, measure arguments; apart from glmm),
  • can be extended into a meta-regression (mods argument),
  • can be extended into a location-scale model (scale argument),
  • can be extended into a multilevel model (cluster argument),
  • and all produce objects that work with the same set of inference helpers (summary(), plot(), predict(), loo(), funnel(), regplot(), residuals and influence diagnostics, …).

Vignette Map

The vignettes are organized into four sections.

Foundations

VignetteTopic
Introduction to RoBMAPackage overview, fitting functions, and vignette map
Prior DistributionsDefault, informed, and custom prior distributions; rescaling guidance
Bayesian Meta-AnalysisRandom-effects meta-analysis with brma(), compared with metafor::rma()
Feature CoverageOverview of available functionality across model families

The foundations section gives the package overview, prior specification, a baseline brma() workflow, and current feature coverage. The Bayesian Meta-Analysis vignette walks through the BCG-vaccine example from the metafor package in brma(), covering summaries, meta-regression, marginal means, residuals, influence, LOO, and the standard meta-analytic plots.

Correspondence with metafor

VignetteTopic
Multilevel Meta-Analysisbrma() with cluster and metafor::rma.mv() for 3-level data
Publication-Bias Adjustmentbselmodel() / bPET() / bPEESE() and metafor::selmodel()
Location-Scale Modelsbrma() with scale and metafor::rma.ls()
Generalized Linear Mixed-Effects Meta-Analysisbrma.glmm() and metafor::rma.glmm() for binomial and Poisson outcomes

Each vignette starts from a metafor package analysis and shows the matching RoBMA R package syntax, output, and diagnostics.

Bayesian Model Averaging

VignetteTopic
Bayesian Model AveragingAccounting for model uncertainty across presence and absence of effect and heterogeneity, with posterior model probabilities and inclusion Bayes factors
Robust Bayesian Meta-AnalysisExtending the ensemble to publication-bias models used in RoBMA(), with PSMA, PP, and bespoke ensemble specifications

The first vignette introduces model averaging on an ensemble of models with and without effect and heterogeneity. The second extends the ensemble to publication-bias models used in RoBMA().

Manuscript Companions

VignetteCompanion paper / dataset
Adjusting for Publication Bias TutorialBartoš et al. (2022), JASP / R tutorial on Lui2015
Robust Bayesian Meta-RegressionBartoš et al. (2025), RoBMA-reg on Andrews2021
Multilevel Robust Bayesian Meta-AnalysisBartoš et al. (2026), Multilevel RoBMA on Johnides2025
Multilevel Robust Bayesian Meta-RegressionMultilevel RoBMA-reg on Kroupova2021
Informed Bayesian Meta-Analysis in MedicineBartoš et al. (2021), informed prior distributions for medical meta-analysis (continuous outcomes)
Informed Bayesian Meta-Analysis with Binary OutcomesBartoš et al. (2023), informed prior distributions for medical meta-analysis (binary and time-to-event outcomes)
Zplot Publication-Bias DiagnosticsBartoš & Schimmack (2025), zplot diagnostics on Hoppen2025

These vignettes reproduce or update analyses from published papers and serve as references when citing the corresponding methodological work.

Where to Start

References

Bartoš, F., Gronau, Q. F., Timmers, B., Otte, W. M., Ly, A., & Wagenmakers, E.-J. (2021). Bayesian model-averaged meta-analysis in medicine. Statistics in Medicine, 40(30), 6743–6761. https://doi.org/10.1002/sim.9170

Bartoš, F., & Maier, M. (2020). RoBMA: An R package for robust Bayesian meta-analyses. https://CRAN.R-project.org/package=RoBMA

Bartoš, F., Maier, M., Quintana, D. S., & Wagenmakers, E.-J. (2022). Adjusting for publication bias in JASP and R — Selection models, PET-PEESE, and robust Bayesian meta-analysis. Advances in Methods and Practices in Psychological Science, 5(3), 1–19. https://doi.org/10.1177/25152459221109259

Bartoš, F., Maier, M., Stanley, T., & Wagenmakers, E.-J. (2025). Robust Bayesian meta-regression: Model-averaged moderation analysis in the presence of publication bias. Psychological Methods. https://doi.org/10.1037/met0000737

Bartoš, F., Maier, M., & Wagenmakers, E.-J. (2026). Robust Bayesian multilevel meta-analysis: Adjusting for publication bias in the presence of dependent effect sizes. Behavior Research Methods. https://doi.org/10.31234/osf.io/9tgp2_v1

Bartoš, F., Otte, W. M., Gronau, Q. F., Timmers, B., Ly, A., & Wagenmakers, E.-J. (2023). Empirical prior distributions for Bayesian meta-analyses of binary and time-to-event outcomes. https://doi.org/10.48550/arXiv.2306.11468

Bartoš, F., & Schimmack, U. (2025). Zplot: A visual diagnostic for publication bias in meta-analysis. In arXiv. https://doi.org/10.48550/arXiv.2509.07171

Plummer, M. (2003). JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), 1–10.

Copy Link

Version

Install

install.packages('RoBMA')

Monthly Downloads

591

Version

4.0.0

License

GPL-3

Maintainer

Franti<c5><a1>ek Barto<c5><a1>

Last Published

May 7th, 2026

Functions in RoBMA (4.0.0)

RoBMA_control

Control MCMC fitting process
Wang2025

70 effect sizes from a meta-analysis of ChatGPT's impact on student learning by wang2025effect;textualRoBMA
add_loo.brma

Add LOO-PSIS to brma Objects
Weingarten2018

582 effect sizes examining the ease-of-retrieval effect from a meta-analysis by weingarten2018does;textualRoBMA
ManyLabs16

55 effect sizes from Many Labs 2 replication studies of tversky1981framing;textualRoBMA framing effects
Poulsen2006

5 studies with a tactile outcome assessment from poulsen2006potassium;textualRoBMA of the effect of potassium-containing toothpaste on dentine hypersensitivity
RoBMA_options

Options for the RoBMA package
blup

Best Linear Unbiased Predictions (BLUPs)
bPEESE

Bayesian Precision-Effect Estimate with Standard Errors (PEESE) Model
as.matrix.brma_samples

Convert brma_samples to Matrix
bf.brma

Bayes Factor for brma Objects
bPET

Bayesian Precision-Effect Test (PET) Model
add_marglik.brma

Add Marginal Likelihood to brma Objects
add_waic.brma

Add WAIC to brma Objects
as_zplot.brma

Transform brma Object to Zplot
as_draws.brma_samples

Convert brma_samples to posterior Draws Formats
as_draws.brma

Convert brma Objects to posterior Draws Formats
bridge_sampler.brma

Bridge Sampling for brma Objects
blup.brma

Best Linear Unbiased Predictions for brma Objects
brma

Bayesian Meta-Analysis
brma.glmm

Bayesian Generalized Meta-Analysis
influence.brma

Measure Influence for brma Objects
data_input

Input Data Specification
hist.zplot_brma

Histogram of Z-Statistics
check_loo.brma

Check LOO Diagnostics for brma Objects
bselmodel

Bayesian Selection Model
fitting_specification

Fitting specification
dfbetas.brma

DFBETAS for brma Objects
cooks.distance.brma

Cook's Distance for brma Objects
fitted.brma

Fitted Values for brma Objects
covratio.brma

COVRATIO for brma Objects
estimate_unit_information_sd

Estimate Unit Information Standard Deviation
dffits.brma

DFFITS for brma Objects
funnel.brma

Funnel Plot for brma Object
hatvalues.brma

Hat Values for brma Objects
contr.BayesTools

BayesTools Contrast Matrices
coef.brma

Extract Model Coefficients for brma Objects
lines.zplot_brma

Add Zplot Density Lines
interpret

Interpret brma Results
logml.brma

Log Marginal Likelihood for brma Objects
logLik.brma

Extract Log-Likelihood Matrix from brma Object
loo.brma

LOO-PSIS for brma Objects
loo_compare.brma

Compare brma Models Using LOO
loo_weights.brma

Extract Normalized PSIS Weights from brma Object
loo_compare.loo

Compare loo Objects Using LOO
nobs.brma

Number of Observations for brma Objects
plot.brma

Plots brma Object
plot.marginal_means.brma

Plot Estimated Marginal Means
pooled_effect

Pooled Effect Size
plot.zplot_brma

Plot Zplot Results
marginal_means

Estimated Marginal Means
marginal_means.brma

Estimated Marginal Means for brma Objects
pooled_effect.brma

Pooled Effect Size for brma Objects
plot_pet_peese

Plot PET-PEESE Fit of brma Object
plot_diagnostic

Plot MCMC Diagnostics
post_prob.brma

Posterior Model Probabilities for brma Objects
plot_weightfunction

Plots Weight Function of brma Object
plot_prior

Plot Prior Distributions
print.summary.zplot_brma

Print Zplot Summary
print.summary.marginal_means.brma

Print Summary of Estimated Marginal Means
pooled_heterogeneity

Pooled Heterogeneity
print.RoBMA_data

Print method for RoBMA_data objects
prior_none

Empty Prior
pooled_heterogeneity.brma

Pooled Heterogeneity for brma Objects
print_prior

Print Prior Distributions
prior

Prior Distribution
ranef

Random Effects
ranef.brma

Random Effects for brma Objects
prior_specification

Prior specification
rstandard.brma

Internally Standardized Residuals for brma Objects
predict.brma

Predict From brma Object
residuals.brma

Residuals for brma Objects
qqnorm.brma

Normal QQ Plot for brma Object
prior_PEESE

PEESE Prior
prior_PET

PET Prior
radial.brma

Radial (Galbraith) Plot for brma Object
summary_heterogeneity

Summary of Heterogeneity
summary.zplot_brma

Summarize Zplot Results
true_effects.brma

True Effects for brma Objects
true_effects

True Effects
rstudent.brma

Externally Standardized (Studentized) Residuals for brma Objects
summary.brma

Summarize brma Object
print.vif.brma

Print VIF Results
print.summary_heterogeneity.brma

Print Summary of Heterogeneity
print.marginal_means.brma

Print Estimated Marginal Means
reexports

Objects exported from other packages
print.summary.brma_samples

Print summary.brma_samples Object
print.brma_samples

Print brma_samples Object
prior_informed

Informed Prior
publication_bias_prior_specification

Publication-bias prior specification
summary_models

Summarize Model-Averaged Component Weights
regplot.brma

Regression Plot (Bubble Plot) for brma Object
prior_weightfunction

Weightfunction Prior
summary_heterogeneity.brma

Summary of Heterogeneity for brma Objects
prior_factor

Factor Prior
update.brma

Update a brma Fit
summary.marginal_means.brma

Summarize Estimated Marginal Means
zplot.brma

Plot Zplot Diagnostics Directly
vif

Variance Inflation Factors
summary.brma_samples

Summarize brma_samples Object
vif.brma

Variance Inflation Factors for brma Objects
waic.brma

WAIC for brma Objects
Kroupova2021

881 estimates from 69 studies of a relationship between employment and educational outcomes collected by kroupova2021student;textualRoBMA
BMA

Bayesian Model-Averaged Meta-Analysis
BMA.glmm

Bayesian Model-Averaged Generalized Meta-Analysis
Lui2015

18 studies of a relationship between acculturation mismatch and intergenerational cultural conflict collected by lui2015intergenerational;textualRoBMA
Anderson2010

23 experimental studies from anderson2010violent;textualRoBMA that meet the best practice criteria
Hoppen2025

37 studies from a meta-analysis of social comparison as a behavior change technique by hoppen2025meta;textualRoBMA
Bem2011

9 experimental studies from bem2011feeling;textualRoBMA as described in bem2011must;textualRoBMA
Havrankova2025

1159 effect sizes from a meta-analysis of beauty and professional success by havrankova2025beauty;textualRoBMA
Johnides2025

412 effect sizes from a meta-analysis of secondary benefits of family-based treatments by johnides2025secondary;textualRoBMA
Andrews2021

39 study rows on household chaos and child executive functions from a meta-analysis by andrews2021examining;textualRoBMA
RoBMA_prior_specification

Prior specification for model-averaging
RoBMA

Robust Bayesian Model-Averaged Meta-Analysis
RoBMA-package

RoBMA: Robust Bayesian Meta-Analysis