Learn R Programming

metaBMA (version 0.3.9)

bma: Bayesian Model Averaging

Description

Model averaging of meta-analysis models according to their posterior model probability.

Usage

bma(meta, prior = 1, parameter = "d", summarize = "integrate")

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

eiher the mean effect "d" or the heterogeneity across studies "tau"

summarize

whether and to compute parameter summaries (mean, median, SD, 95% quantile interval, HPD interval). If summarize = "integrate", numerical integration is used (which is precise but can require some seconds of computing time), summarize = "jags" summarizes the JAGS samples, and summarize = "none" suppresses parameter summaries.

Examples

Run this code
# NOT RUN {
data(towels)
fix1 <- meta_fixed(towels$logOR, towels$SE, towels$study,
                   d = "halfnorm", d.par = c(mean=0, sd=.2))
fix2 <- meta_fixed(towels$logOR, towels$SE, towels$study,
                   d = "beta", d.par = c(alpha=1, beta=1))
fix3 <- meta_fixed(towels$logOR, towels$SE, towels$study,
                   d = "triangular",
                   d.par = c(min=0, peak=.3, max=1))

averaged <- bma(list(Halfnormal = fix1, Uniform = fix2,
                     Triangular = fix3))
averaged
plot_posterior(averaged)
plot_forest(averaged, mar = c(4.5,20,4,.3))
# }

Run the code above in your browser using DataLab