Skip to contents

Native closed form: \(Z = \sum w_i \Phi^{-1}(1 - p_i) / \sqrt{\sum w_i^2}\) (unit weights by default, which reproduces poolr::stouffer with adjust = "none").

Usage

stouffer_combined(p_values, weights = NULL)

Arguments

p_values

Numeric vector of raw p-values.

weights

Optional non-negative weights (any scale).

Value

An object of class "morie_multiple_testing_result".

Examples

p <- c(0.001, 0.008, 0.02, 0.04, 0.2, 0.5)

res <- stouffer_combined(p)
res$statistic                # combined Z
#> [1] 4.141762
res$p_value
#> [1] 1.723238e-05

# `weights` up-weights more trustworthy / larger studies.
w <- c(10, 8, 5, 5, 2, 1)
stouffer_combined(p, weights = w)$p_value
#> [1] 8.357232e-07

# Compare Fisher (log-based) vs Stouffer (z-based) on the same inputs.
c(stouffer = stouffer_combined(p)$p_value,
  fisher   = fisher_combined(p)$p_value)
#>     stouffer       fisher 
#> 1.723238e-05 2.920076e-05