BCompare groups · Guide test 271
Edgington sum of p test
Combines independent p values through their sum.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Combine p-values (global test across studies) — Taken together, do several independent tests of the same question show an effect anywhere?
In Combine p-values (global test across studies), choose Combination method = Edgington.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Edgington sum-of-p test
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how S varies across samples when H₀ is true, Irwin–Hall: the sum of 10 uniforms.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .153).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
How the studies combine
Every p counts equally: small sums S = Σp are evidence, so many moderately small p-values add up. Dashed gray: what k uniform p-values would look like.
The formula
With your numbers
- the sum of the p-values: small sums are evidence
- the Irwin–Hall distribution of a sum of k uniforms, the curve drawn
The verdict
S = 4.06, p = .153
p > α = .050: compatible with H₀
Rewards consistency: several moderate p-values can reject while one tiny p-value among large ones cannot. One study near 1 pulls the sum up, so align directions first.
- Statistic
- 4.058
- p-value
- 0.1535
Edgington sum-of-p test on p-values: n = 10: S = 4.06, p = .153. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: all component null hypotheses hold; H1: at least one fails.
Assumptions
Valid component p values for the individual nulls; a prespecified combination and study/test set. Exact formulas below generally assume independent continuous Uniform(0,1) p values under the complete null; dependence requires a justified adjustment.
Formula
Parameters and notation
S has an Irwin–Hall distribution for independent uniform p values; restrict j≤k and use a stable numerical implementation.
Structure of the method
Sum component p values and evaluate the lower tail of the Irwin–Hall distribution for k independent continuous uniforms. A direct alternating-polynomial expression exists, but a stable distribution implementation is preferable when cancellation becomes substantial or k is large.
Estimated and nuisance parameters
The sum and its count k are computed, not learned. There is no effect-size coefficient or fitted alternative distribution. Nuisance estimation occurs inside each component test; the combination requires the resulting p values to have the stated joint null behavior.
Settings and design choices
Prespecify which tests enter and how missing results are treated. Distinguish the complete Irwin–Hall calculation from the conservative s^k/k! shortcut, especially when the sum exceeds one. A normal approximation uses k/2 and k/12, but approximation quality must be checked in the tail of interest.
Fitting and adaptation
There is no fine-tuning stage. If components are dependent or discrete, calibrate the whole summed statistic under an appropriate null model rather than retaining the independent uniform variance automatically. A proposed weighted version requires its own distribution; it is not implemented by changing k.
Sensitivity and robustness
A very small p value may be diluted by many large p values, while widespread moderate evidence can accumulate. Check numerical precision by comparison with simulation when feasible. Selective study inclusion, positively correlated endpoints and dependence introduced by shared parameter estimates can materially change the nominal tail probability.
How to use and calibrate
Use the lower tail of the sum. The mean-p version is the same ordering; a normal approximation uses mean k/2 and variance k/12.
Example application
Aggregate modest evidence spread over several studies.
Interpretation and pitfalls
Watch out
A very small individual p can be diluted by large others. Direct alternating-sum computation can suffer cancellation.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
These standard calibrations assume independent, valid null p-values. Combine tests of a coherent global null and align directional alternatives before aggregation.
Validated — Executed successfully in the validation environment · needs numpy, scipy
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
p=np.array([.01,.04,.2,.5,.1])
print((p.sum(),stats.irwinhall.cdf(p.sum(),len(p))))
Output
(np.float64(0.85), np.float64(0.0036975442708333333))
Not run — Syntax checked; runtime not verified in the final environment · needs metap
p<-c(.01,.04,.2,.5,.1)
print(metap::sump(p))
Sources
- metap — metap · sumpAuthor documentation/source reviewed: metap 1.14.search.r-project.org
- metap — metap · meanpAuthor documentation/source reviewed: metap 1.14.search.r-project.org
- sumpsearch.r-project.org
- meanpsearch.r-project.org
- Statistics guide v4 (historical):
- R: Syntax checked; runtime not verified in the final environment
- Reference's record:
- Edition 2 review: Python: executed · R: not executed (Rscript unavailable). Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 271, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT271.