ma: Meta-analysis Correcting for Publication Bias or p-hacking

View source: R/ma.R

maR Documentation

Meta-analysis Correcting for Publication Bias or p-hacking

Description

Bayesian random effects meta-analysis. Correct for publication bias, correct for p-hacking, or run an ordinary meta-analysis without any correction.

Usage

ma(
  yi,
  vi,
  bias = c("publication selection", "p-hacking", "none"),
  data,
  alpha = c(0, 0.025, 0.05, 1),
  prior = NULL,
  tau_prior = c("half-normal", "uniform", "inv_gamma"),
  ...
)

psma(
  yi,
  vi,
  data,
  alpha = c(0, 0.025, 0.05, 1),
  prior = NULL,
  tau_prior = c("half-normal", "uniform", "inv_gamma"),
  ...
)

phma(
  yi,
  vi,
  data,
  alpha = c(0, 0.025, 0.05, 1),
  prior = NULL,
  tau_prior = c("half-normal", "uniform", "inv_gamma"),
  ...
)

cma(
  yi,
  vi,
  data,
  prior = NULL,
  tau_prior = c("half-normal", "uniform", "inv_gamma"),
  ...
)

allma(
  yi,
  vi,
  data,
  alpha = c(0, 0.025, 0.05, 1),
  prior = NULL,
  tau_prior = c("half-normal", "uniform", "inv_gamma"),
  ...
)

Arguments

yi

Numeric vector of length codek with observed effect size estimates.

vi

Numeric vector of length codek with sampling variances.

bias

String; If "publication bias", corrects for publication bias. If "p-hacking", corrects for p-hacking.

data

Optional list or data frame containing yi and vi.

alpha

Numeric vector; Specifies the cutoffs for significance. Should include 0 and 1. Defaults to (0, 0.025, 0.05, 1).

prior

Optional list of prior parameters. See the details.

tau_prior

Which prior to use for tau, the heterogeneity parameter. Defaults to "half-normal"; "uniform" and "inv_gamma are also supported.

...

Passed to rstan::sampling.

Details

ma does a Bayesian meta-analysis with the type of correction used specified by bias. psma is a wrapper for ma with bias = "publication selection", phma is a wrapper with bias = "p-hacking", while cma has bias = "none". The function allma runs all bias options and returns a list.

The bias options are:

  1. ⁠publication selection⁠: The model of publication bias described in Hedges (1992).

  2. p-hacking: The model for p-hacking described in Moss & De Bin (2019).

  3. none: Classical random effects meta-analysis with no correction for selection bias.

The effect size distribution is normal with mean theta0 and standard deviation tau. The prior for theta0 is normal with parameters theta0_mean (default: 0), theta0_sd (default: 1). eta is the vector of K normalized publication probabilities (publication bias model) or K p-hacking probabilities (p-hacking model). The prior of eta is Dirchlet with parameter eta0, which defaults to rep(1, K) for the publication bias model and the p-hacking model. eta0 is the prior for the Dirichlet distribution over the non-normalized etas in the publication bias model, and they are forced to be decreasing.

The standard prior for tau is half-normal with parameters tau_mean (default: 0), tau_sd (default: 1). If the uniform prior is used, the parameter are u_min (default: 0), and u_max with a default of 3. The inverse Gamma has parameters shape (default: 1) and scale default: 1.

To change the prior parameters, pass them to prior in a list.

Value

An S4 object of class mafit when ma, psma, phma or cma is run. A list of mafit objects when allma is run.

References

Hedges, Larry V. "Modeling publication selection effects in meta-analysis." Statistical Science (1992): 246-255.

Moss, Jonas and De Bin, Riccardo. "Modelling publication bias and p-hacking" (2019) arXiv:1911.12445

Examples


phma_model <- phma(yi, vi, data = metadat::dat.begg1989)

prior <- list(
  eta0 = c(3, 2, 1),
  theta0_mean = 0.5,
  theta0_sd = 10,
  tau_mean = 1,
  tau_sd = 1
)

psma_model <- psma(yi, vi, data = metadat::dat.begg1989, prior = prior)


cma_model <- psma(yi, vi, data = metadat::dat.begg1989, prior = prior)


model <- allma(yi, vi, data = metadat::dat.begg1989, prior = prior)


publipha documentation built on April 4, 2023, 5:19 p.m.