Learn R Programming

publipha

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.

Copy Link

Version

Install

install.packages('publipha')

Monthly Downloads

163

Version

0.1.2

License

GPL-3

Maintainer

Jonas Moss

Last Published

April 4th, 2023

Functions in publipha (0.1.2)

loo,mafit-method

Calculate the loo for an ma object.
ma

Meta-analysis Correcting for Publication Bias or p-hacking
dat.cuddy2018

Studies on the Effect of Power Posing
dat.anderson2010

Studies on Effect of Violent Video Games on Negative Outcomes
ExtractParameters

Extract Parameters from an mafit Object
dat.dang2018

Meta-analysis on Ego Depletion
psnorm

Publication Selection Meta-analysis Model
add_elements

Adds named elements to a list when they are not there already.
publipha-package

The 'publipha' package.
do_call

Variant of do call with that preserves argument names.
mpsnorm

Marginal Publication Selection Meta-analysis Model
mafit-class

Class mafit: Fitted Meta-analysis Model
dat.motyl2017

Effect Sizes from 875 Studies in Psychology.
alist2

Make lazy list from arguments.
arguments

Get arguments of the calling function.
snorm

Selected Normal Effect Size Distribution
normalizing_constant

Normalizing Constants for the Publication Selection Meta-Analysis Model
dat.baskerville2012

Studies on Practice Facilitation
phnorm

p-hacking Meta-analysis Model