EProportions · Guide test 070
Breslow–Day test
Tests whether odds ratios are equal across strata of two by two tables.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Cochran–Mantel–Haenszel test (stratified 2 × 2) — Are group and outcome associated after adjusting for a stratifying variable?
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 · Breslow–Day test
Your data
Edit the counts| Event | No event | Total | |
|---|---|---|---|
| Stratum 1: exposed | 16E = 29.0 | 44E = 31.0 | 60 |
| Stratum 1: unexposed | 13E = 29.0 | 47E = 31.0 | 60 |
| Stratum 2: exposed | 37E = 29.0 | 23E = 31.0 | 60 |
| Stratum 2: unexposed | 23E = 29.0 | 37E = 31.0 | 60 |
| Stratum 3: exposed | 54E = 29.0 | 6E = 31.0 | 60 |
| Stratum 3: unexposed | 31E = 29.0 | 29E = 31.0 | 60 |
| Total | 174 | 186 | 360 |
E is the count expected if rows and columns were unrelated.
If H₀ were true
- The reference: how χ² varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .016).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- Mantel–Haenszel common odds ratio
- expected exposed events if every stratum had that odds ratio
The verdict
χ²(2) = 8.31, p = .016
p ≤ α = .050: reject H₀
If it rejects, the common odds ratio is a misleading summary: report stratum-specific odds ratios (effect modification).
- Statistic
- 8.314
- p-value
- 0.0157
Breslow–Day test on a 6 × 2 table of 360 counts: χ²(2) = 8.31, p = .016. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: all stratum-specific 2×2 odds ratios share one value.
Assumptions
Independent stratified tables; sufficiently large counts for conditional approximations.
Formula
Parameters and notation
θ̂ estimates the common odds ratio. Expected cells solve the fixed margin table equation with that odds ratio; variances are conditional approximations.
Structure of the method
Fit a common odds ratio across independent 2-by-2 strata, obtain expected first cells under that value and fixed margins, and aggregate squared observed-minus-expected deviations using approximate conditional variances. Tarone adjustment removes a residual component attributable to estimating the common parameter.
Estimated and nuisance parameters
The shared odds ratio is an estimated nuisance under the homogeneity null; stratum margins remain fixed for the conditional construction. Expected cells and their variances depend nonlinearly on the fitted odds ratio. Alternative parameters are stratum-specific odds ratios.
Settings and design choices
Choose the common-odds-ratio estimator and whether Tarone correction is applied, and report the choice explicitly. The usual reference uses one fewer degree of freedom than the number of informative strata. Zero-cell handling should follow the specified implementation rather than arbitrary added constants.
Fitting and adaptation
Refit the common effect for each new dataset and for every parametric null replicate. A calibration study simulates tables under a common odds ratio with the relevant margins, then repeats the full fit and heterogeneity statistic. There is no neural fine-tuning analogue.
Sensitivity and robustness
Small stratum counts, extreme common odds ratios, and sparse discordant cells can invalidate approximations. A nonsignificant result may simply reflect low power to detect interaction. Compare estimated stratum effects and intervals; it is not evidence that all populations have identical scientific effects.
How to use and calibrate
Compare with χ²S−1 for S strata; the Tarone adjustment removes a residual common-parameter component. State whether used.
Example application
Check whether treatment odds ratios vary across centers before presenting a common effect.
Interpretation and pitfalls
Watch out
Low power does not establish homogeneity. Zero cells and small strata can undermine the approximation.
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
Three independent 2×2 strata; maintain the same category ordering in every stratum. Homogeneity tests assess whether a common odds ratio is tenable.
Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: DescTools
# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
tab <- array(c(18,9,12,21,15,7,15,23,20,12,10,18),dim=c(2,2,3))
print(DescTools::BreslowDayTest(tab))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
text=True, capture_output=True)
print(result.stdout)
if result.stderr:
print(result.stderr)
result.check_returncode()
Not run — Syntax checked; runtime not verified in the final environment · needs DescTools
tab <- array(c(18,9,12,21,15,7,15,23,20,12,10,18),dim=c(2,2,3))
print(DescTools::BreslowDayTest(tab))
Sources
- DescTools — DescTools · BreslowDayTestAuthor documentation/source reviewed: DescTools 0.99.60.search.r-project.org
- BreslowDayTestsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
- Reference's record:
- Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 070, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT070.