R package for Bayesian meta-analysis that accounts for publication
bias or p-hacking.
publipha is an package for doing Bayesian meta-analysis that accounts for publication bias or p-hacking. Its main functions are:
psmadoes 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)
phmadoes 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).
cmadoes classical random effects meta-analysis with the same priors as
Use the following command from inside
# install.packages("devtools") devtools::install_github("JonasMoss/publipha")
library function and use it like a barebones
phma where they should place the cutoffs
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 = metafor::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 = metafor::dat.bangertdrowns2004) # Classical model set.seed(313) model_cma = publipha::cma(yi = yi, vi = vi, alpha = c(0, 0.025, 0.05, 1), data = metafor::dat.bangertdrowns2004)
You can calculate the posterior means of the meta-analytic mean with
extract_theta0(model_psma) #>  0.1241181
extract_theta0(model_cma) #>  0.2206233
If you wish to plot a histogram of the posterior distribution of
the standard deviation of the effect size distribution, you can do it
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.