pbayes: Map p-values to posterior probabilities

View source: R/pbayes.R

pbayesR Documentation

Map p-values to posterior probabilities

Description

Given a vector of p-values from independent hypothesis tests, calculate the Bayesian posterior probability of the alternative hypothesis being true. The method implemeted is similar to the method described by Erikson et al., 2010 and Allison et al., 2002.

Usage

pbayes(
  p,
  n_boots = 1000,
  alpha = 0.01,
  n_cores = 1,
  subsample = 1,
  max_comp = 4,
  min_null = 0.4,
  opt_method = "L-BFGS-B",
  monotone = TRUE,
  mask_flagpole = TRUE,
  level_pvals = FALSE,
  ...
)

Arguments

p

A numeric vector of p-values

n_boots

A number providing the number of bootstraps used to calculate the convergence statistic.

alpha

A number representing the convergence statistic for fitting the uniform-beta mixture model.

n_cores

A number representing the number of cores to use for the bootstrap calculation.

subsample

The proportion of p to subsample to calculate the beta mixture

max_comp

A number representing the maximum number of non-uniform components to include in the mixture distribution.

min_null

The lower bound on the null distribution mixing fraction.

opt_method

Optimization method. Options are "L-BFGS-B" or "SANN".

monotone

Logical. Only use monotonically-decreasing beta components in the mixture model

mask_flagpole

Logical. During the fitting procedure, mask p-values that are equal to 1. These values can be overrepresented due to p-value calulations on discrete distributions.

level_pvals

Logical. Apply a cubic polynomial fit to a portion of the p-value histogram to level non-uniform trends.

...

Additional parameters to be passed to bbmle::mle2.

Value

A list of 1) the original p-values, 2) the posterior probabilities corresponding to each p-value, and 3) parameters of the fitted mixture model.

References

Allison, D. B., et al. (2002). A mixture model approach for the analysis of microarray gene expression data. Computational Statistics & Data Analysis, 39(1), 1-20. https://doi.org/10.1016/S0167-9473(01)00046-9

Erikson S., et al. (2010). Composite hypothesis testing: an approach built on intersection-union tests and Bayesian posterior probabilities. In Guerra, R., and Goldstein, D. R., (Ed.), Meta-analysis and Combining Information in Genetics and Genomics. (pp. 83-93). Chapman & Hall/CRC.


stevehoang/pbayes documentation built on Feb. 16, 2024, 2:20 p.m.