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.
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 alignedRalignedmatrix (orNULL).- results
Named list keyed by method, each element a list with
methodandpval.
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.
Examples
combinePValues(pvals = c(0.01, 0.2, 0.5), methods = "fisher", R = diag(3))
#> $input
#> $input$nPvalsIn
#> [1] 3
#>
#> $input$nZScoresIn
#> [1] 0
#>
#> $input$nValid
#> [1] 3
#>
#> $input$Raligned
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#>
#> $results
#> $results$fisher
#> $results$fisher$method
#> [1] "fisher"
#>
#> $results$fisher$pval
#> [1] 0.0002885617
#>
#>
#>