phnorm: p-hacking Meta-analysis Model

phnormR Documentation

p-hacking Meta-analysis Model

Description

Density, distribution, and random variate generation for the p-hacking meta- analysis model.

Usage

dphnorm(x, theta, sigma, alpha = c(0, 0.025, 0.05, 1), eta, log = FALSE)

rphnorm(n, theta, sigma, alpha = c(0, 0.025, 0.05, 1), eta)

pphnorm(
  q,
  theta,
  sigma,
  alpha = c(0, 0.025, 0.05, 1),
  eta,
  lower.tail = TRUE,
  log.p = FALSE
)

Arguments

x, q

vector of quantiles.

theta

vector of means.

sigma

vector of study standard deviations.

alpha

vector of thresholds for p-hacking.

eta

vector of p-hacking probabilities, normalized to sum to 1.

log, log.p

logical; If TRUE, probabilities are given as log(p).

n

number of observations. If length(n) > 1, the length is taken to be the number required.

lower.tail

logical; If TRUE (default), the probabilities are P[X\leq x] otherwise, P[X\geq x].

Details

These functions assume one-sided selection on the effects. alpha contains the selection thresholds and eta the vector of p-hacking probabilities. theta is the true effect, while sigma is the true standard deviation before selection.

Value

dphnorm gives the density, pphnorm gives the distribution function, and rphnorm generates random deviates.

References

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

Examples

rphnorm(100, theta = 0, sigma = 0.1, eta = c(1, 0.5, 0.1))

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