Learn R Programming

publipha (version 0.1.2)

phnorm: 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 )

Value

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

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.

References

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

Examples

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

Run the code above in your browser using DataLab