bma: Bayesian Model Averaging

View source: R/bma.R

bmaR Documentation

Bayesian Model Averaging

Description

Model averaging for different meta-analysis models (e.g., random-effects or fixed-effects with different priors) based on the posterior model probability.

Usage

bma(
  meta,
  prior = 1,
  parameter = "d",
  summarize = "integrate",
  ci = 0.95,
  rel.tol = .Machine$double.eps^0.5
)

Arguments

meta

list of meta-analysis models (fitted via meta_random or meta_fixed)

prior

prior probabilities over models (possibly unnormalized). For instance, if the first model is as likely as models 2, 3 and 4 together: prior = c(3,1,1,1). The default is a discrete uniform distribution over models.

parameter

either the mean effect "d" or the heterogeneity "tau" (i.e., the across-study standard deviation of population effect sizes).

summarize

how to estimate parameter summaries (mean, median, SD, etc.): Either by numerical integration (summarize = "integrate") or based on MCMC/Stan samples (summarize = "stan").

ci

probability for the credibility/highest-density intervals.

rel.tol

relative tolerance used for numerical integration using integrate. Use rel.tol=.Machine$double.eps for maximal precision (however, this might be slow).

Examples


# model averaging for fixed and random effects
data(towels)
fixed <- meta_fixed(logOR, SE, study, towels)
random <- meta_random(logOR, SE, study, towels)

averaged <- bma(list("fixed" = fixed, "random" = random))
averaged
plot_posterior(averaged)
plot_forest(averaged, mar = c(4.5, 20, 4, .3))


metaBMA documentation built on Sept. 13, 2023, 9:06 a.m.