MyNixOS website logo
Description

Bayesian Meta-Analysis with Publications Bias and P-Hacking.

Tools for Bayesian estimation of meta-analysis models that account for publications bias or p-hacking. For publication bias, this package implements a variant of the p-value based selection model of Hedges (1992) <doi:10.1214/ss/1177011364> with discrete selection probabilities. It also implements the mixture of truncated normals model for p-hacking described in Moss and De Bin (2019) <arXiv:1911.12445>.

publipha

CRAN_Status_Badge R-CMD-check

An R package for Bayesian meta-analysis that accounts for publication bias or p-hacking.

Overview

publipha is an package for doing Bayesian meta-analysis that accounts for publication bias or p-hacking. Its main functions are:

  • psma does random effects meta-analysis under publication bias with a one-sided p-value based selection probability. The model is roughly the same as that of (Hedges, 1992)
  • phma does random effects meta-analysis under a certain model of p-hacking with a one-sided p-value based propensity to p-hack. This is based on the forthcoming paper of by Moss and De Bin (2019).
  • cma does classical random effects meta-analysis with the same priors as psma and cma.

Installation

Use the following command from inside R:

# install.packages("devtools")
devtools::install_github("JonasMoss/publipha")

Usage

Call the library function and use it like a barebones metafor::rma. The alpha tells psma or phma where they should place the cutoffs for significance.

library("publipha")
# Publication bias model
set.seed(313) # For reproducibility
model_psma = publipha::psma(yi = yi,
                            vi = vi,
                            alpha = c(0, 0.025, 0.05, 1),
                            data = metadat::dat.bangertdrowns2004)

# p-hacking model
set.seed(313)
model_phma = publipha::phma(yi = yi,
                          vi = vi,
                          alpha = c(0, 0.025, 0.05, 1),
                          data = metadat::dat.bangertdrowns2004)

# Classical model
set.seed(313)
model_cma = publipha::cma(yi = yi,
                          vi = vi,
                          alpha = c(0, 0.025, 0.05, 1),
                          data = metadat::dat.bangertdrowns2004)

You can calculate the posterior means of the meta-analytic mean with extract_theta0:

extract_theta0(model_psma)
#> [1] 0.1277197
extract_theta0(model_cma)
#> [1] 0.2212093

If you wish to plot a histogram of the posterior distribution of tau, the standard deviation of the effect size distribution, you can do it like this:

extract_tau(model_psma, hist)

References

How to Contribute or Get Help

If you encounter a bug, have a feature request or need some help, open a Github issue. Create a pull requests to contribute.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows