Delegates to poolr::stouffer when installed and no weights
are supplied; otherwise computes the weighted z-sum inline.
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
