Skip to contents

Unified dispatcher for combining a vector of p-values (and/or z-scores) into a single combined p-value. Supports independent-test methods (ACAT, HMP, Bonferroni) and correlation-adjusted methods (Fisher / Stouffer / inverse-chi-square via poolr; GBJ / BJ / HC / GHC / minP / GBJ-omnibus via GBJ; aSPU / GATES via aSPU). Multiple methods may be requested in a single call; the function returns a per-method result list keyed by method name.

Usage

combinePValues(pvals = NULL, zScores = NULL, methods, R = NULL, naRm = TRUE)

Arguments

pvals

Optional numeric vector of p-values. Required for methods that work on p-values; derivable from zScores.

zScores

Optional numeric vector of signed z-scores.

methods

Character vector of combination method names; see above for the menu (lowercase).

R

Optional correlation matrix aligned to pvals / zScores. Required for the correlation-adjusted methods.

naRm

Logical; if TRUE (default), drop NA p-values before combination.

Value

A list with two elements:

input

Summary of the call: nPvalsIn, nZScoresIn, nValid, and the aligned Raligned matrix (or NULL).

results

Named list keyed by method, each element a list with method and pval.

Details

Either pvals or zScores may be supplied. If only zScores is given, two-sided p-values are derived as p = 2 * (1 - pnorm(|z|)). Methods that require signed zScores (gbj, bj, hc, ghc, minp, gbj_omni, aspu) cannot be derived from p-values alone and error if zScores is missing.

Methods that require a correlation matrix R (fisher, stouffer, invchisq, gbj, bj, hc, ghc, minp, gbj_omni, aspu, gates) error if R is missing. Methods that do not use R silently ignore it. When R is named, it is realigned to match the order of pvals / zScores, with a hard error if any entry is missing from R's names.

An internal validity filter drops entries where !is.finite(pvals) | pvals <= 0 | pvals >= 1; a warning is emitted when any are dropped.