statsExpressions (version 0.5.1)

expr_meta_bayes: Making expression containing Bayesian random-effects meta-analysis.

Description

Making expression containing Bayesian random-effects meta-analysis.

Usage

expr_meta_bayes(
  data,
  d = prior("norm", c(mean = 0, sd = 0.3)),
  tau = prior("invgamma", c(shape = 1, scale = 0.15)),
  k = 2L,
  messages = TRUE,
  ...
)

Arguments

data

A dataframe. It must contain columns named estimate (effect sizes or outcomes) and std.error (corresponding standard errors). These two columns will be used for yi and sei arguments in metafor::rma (for parametric analysis) or metaplus::metaplus (for robust analysis).

d

prior distribution on the average effect size d. The prior probability density function is defined via prior.

tau

prior distribution on the between-study heterogeneity tau (i.e., the standard deviation of the study effect sizes dstudy in a random-effects meta-analysis. A (nonnegative) prior probability density function is defined via prior.

k

Number of digits after decimal point (should be an integer) (Default: k = 2L).

messages

Deprecated. Retained only for backward compatibility.

...

Arguments passed on to metaBMA::meta_random

labels

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

rscale_contin

scale parameter of the JZS prior for the continuous covariates.

rscale_discrete

scale parameter of the JZS prior for discrete moderators.

centering

whether continuous moderators are centered.

logml

how to estimate the log-marginal likelihood: either by numerical integration ("integrate") or by bridge sampling using MCMC/Stan samples ("stan"). To obtain high precision with logml="stan", many MCMC samples are required (e.g., logml_iter=10000, warmup=1000).

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).

logml_iter

number of iterations (per chain) from the posterior distribution of d and tau. The samples are used for computing the marginal likelihood of the random-effects model with bridge sampling (if logml="stan") and for obtaining parameter estimates (if summarize="stan"). Note that the argument iter=2000 controls the number of iterations for estimation of the random-effect parameters per study in random-effects meta-analysis.

silent_stan

whether to suppress the Stan progress bar.

Examples

Run this code
# NOT RUN {
# setup
set.seed(123)
library(metaplus)

# renaming to what `statsExpressions` expects
df <- dplyr::rename(mag, estimate = yi, std.error = sei)

# making subtitle
expr_meta_bayes(
  data = df,
  k = 3,
  # additional arguments given to `metaBMA`
  iter = 5000,
  summarize = "integrate",
  control = list(adapt_delta = 0.99, max_treedepth = 15)
)
# }

Run the code above in your browser using DataLab