meta_sensitivity: Sensitivity Analysis for Bayesian Meta-Analysis

View source: R/meta_sensitivity.R

meta_sensitivityR Documentation

Sensitivity Analysis for Bayesian Meta-Analysis

Description

Sensitivity analysis assuming different prior distributions for the two main parameters of a Bayesian meta-analysis (i.e., the overall effect and the heterogeneity of effect sizes across studies).

Usage

meta_sensitivity(
  y,
  SE,
  labels,
  data,
  d_list,
  tau_list,
  analysis = "bma",
  combine_priors = "crossed",
  ...
)

Arguments

y

effect size per study. Can be provided as (1) a numeric vector, (2) the quoted or unquoted name of the variable in data, or (3) a formula to include discrete or continuous moderator variables.

SE

standard error of effect size for each study. Can be a numeric vector or the quoted or unquoted name of the variable in data

labels

optional: character values with study labels. Can be a character vector or the quoted or unquoted name of the variable in data

data

data frame containing the variables for effect size y, standard error SE, labels, and moderators per study.

d_list

a list of prior distributions specified via prior() for the overall effect size (mean) across studies

tau_list

a list of prior distributions specified via prior() for the heterogeneity (SD) of effect sizes across studies

analysis

which type of meta-analysis should be performed for analysis? Can be one of the following:

  • "fixed" for fixed-effects model, see meta_fixed()

  • "random" for random-effects model, see meta_random()

  • "bma" for model averaging, see meta_bma()

combine_priors

either "matched", in which case the analysis includes the matched pairwise combinations of the prior distributions specified in d_list and tau_list, or crossed, in which case the analysis uses all possible pairwise combinations of priors.

...

further arguments passed to the function specified in analysis.

Value

an object of the S3 class meta_sensitivity, that is, a list of fitted meta-analysis models. Results can be printed or plotted using plot.meta_sensitivity().

See Also

plot.meta_sensitivity()

Examples


data(towels)
sensitivity <- meta_sensitivity(
  y = logOR, SE = SE, labels = study, data = towels,
  d_list = list(prior("cauchy", c(0, .707)),
                prior("norm", c(0, .5)),
                prior("norm", c(.5, .3))),
  tau_list = list(prior("invgamma", c(1, 0.15), label = "tau"),
                  prior("gamma", c(1.5, 3), label = "tau")),
  analysis = "random",
  combine_priors = "crossed")

print(sensitivity, digits = 2)

par(mfrow = c(1,2))
plot(sensitivity, "d", "prior")
plot(sensitivity, "d", "posterior")

plot(sensitivity, "tau", "prior")
plot(sensitivity, "tau", "posterior")



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