metaBMA: Bayesian model-averaging for meta-analysis

Fixed-effects meta-analyses assume that the effect size d is identical in all studies. In contrast, random-effects meta-analyses assume that effects vary according to a normal distribution with mean d and standard deviation tau. Both models can be compared in a Bayesian framework by assuming specific prior distribution for d and tau. Given the posterior model probabilities, the evidence for or against an effect (i.e., whether d = 0) and the evidence for or against random effects can be evaluated (i.e., whether tau = 0). By using Bayesian model averaging (i.e., inclusion Bayes factors), both types of tests can be performed by marginalizing over the other question. Most importantly, this allows to test whether an effect exists while accounting for uncertainty whether study heterogeneity exists or not.

The Package metaBMA The R package

metaBMA is available on GitHub at The most general functions in metaBMA are meta_bma and meta_default, which fit random- and fixed-effects models, compute the inclusion Bayes factor for the presence of an effect and the averaged posterior distribution of the mean effect d (which accounts for uncertainty regarding study heterogeneity). Moreover, meta_fixed and meta_random fit a single meta-analysis models. The model-specific posteriors for d can be averaged by bma and inclusion Bayes factors be computed by inclusion. Finally, the function prior facilitates the construction and visual inspection of prior distributions.

Installing metaBMA

metaBMA requires the software JAGS. To install the latest stable release of metaBMA from CRAN, run:


To install the latest developer version from GitHub, use:

### Dependencies:
# install.packages("devtools", "mvtnorm", "runjags", "LaplacesDemon", "logspline")
install_github("danheck/metaBMA", build_vignettes = TRUE)


If you use metaBMA, please cite the software as follows:

The package was used in:

  • Gronau, Q. F., Erp, S. V., Heck, D. W., Cesario, J., Jonas, K. J., & Wagenmakers, E.-J. (2017). A Bayesian model-averaged meta-analysis of the power pose effect with informed and default priors: The case of felt power. Comprehensive Results in Social Psychology, 2, 123–138. doi:10.1080/23743603.2017.1326760