Stratified 2 × 2 Table Analyzer

Estimate stratum-specific, crude, and Mantel–Haenszel-adjusted associations between a binary exposure and binary outcome.

1. Stratified data

Dataset setup

Enter 2–50 independent strata using the same exposure–outcome orientation. Each cell is a nonnegative whole-number count.

Editable stratified 2 × 2 tables
StratumAExposed + outcomeBExposed + no outcomeCReference + outcomeDReference + no outcomeTotalActions

2. Study designCohort or randomized study · Risk ratio
Study design

Every stratum must use the same exposure–outcome orientation. Stratification controls only the variables represented by these tables.

Customize labels optional
3. Analysis settings95% confidence interval · Uncorrected CMH test

Stratum-specific association plot

About this analysis

Scope

This calculator analyzes independent aggregate 2 × 2 tables stratified by one or more categorical factors. It estimates stratum-specific and crude measures, Mantel–Haenszel common risk or odds ratios, a Cochran–Mantel–Haenszel test, and Breslow–Day–Tarone odds-ratio homogeneity. It is not intended for matched sets, survey-weighted data, clustered observations, person-time rates, regression adjustment, or individual-participant data.

Formula and inference

The common odds ratio is Σ(AᵢDᵢ/Nᵢ) / Σ(BᵢCᵢ/Nᵢ), with a Robins–Breslow–Greenland confidence interval. For cohort or cross-sectional data, the common risk or prevalence ratio is Σ[Aᵢ(Cᵢ+Dᵢ)/Nᵢ] / Σ[Cᵢ(Aᵢ+Bᵢ)/Nᵢ], with a Greenland–Robins confidence interval. The CMH test evaluates conditional independence. The Tarone-adjusted Breslow–Day procedure assesses equality of stratum-specific odds ratios.

Assumptions and limitations

  • Every stratum uses the same exposure, outcome, comparison direction, and observation period.
  • Observations are independent within and between strata.
  • A common Mantel–Haenszel estimate is most interpretable when stratum-specific effects are sufficiently similar.
  • A non-significant homogeneity test does not establish absence of effect modification.
  • Stratification controls only represented variables and cannot remove residual confounding or other bias.
  • Case–control sampling supports odds-ratio inference rather than direct risks or risk ratios.
  • No continuity correction is silently applied to primary estimates.

Validation

Version 1.0.0 was checked against independently coded equations, base R mantelhaen.test reference fixtures for the common odds ratio and CMH test, and Python statsmodels fixtures for the Tarone-adjusted Breslow–Day test. Stratum-specific calculations reuse the independently validated EPI01 methods. Automated tests cover null, homogeneous, confounded, heterogeneous, direction-reversal, sparse, permutation, group-swap, parsing, privacy, reporting, and responsive-interface cases. Version 1.1.0 harmonizes the interface while retaining these methods. Native PDF pagination, screen-reader listening, and owner acceptance remain separate review steps. Availability does not constitute regulatory validation.

Privacy

All calculations use aggregate values in browser memory. The app does not transmit, upload, or persist entered counts, labels, imported text, or results. Do not enter identifiable or confidential information.

References

  1. Mantel N, Haenszel W. Statistical aspects of the analysis of data from retrospective studies of disease. J Natl Cancer Inst. 1959;22:719–748.
  2. Robins J, Breslow N, Greenland S. Estimators of the Mantel–Haenszel variance consistent in both sparse data and large-strata limiting models. Biometrics. 1986;42:311–323.
  3. Greenland S, Robins JM. Estimation of a common effect parameter from sparse follow-up data. Biometrics. 1985;41:55–68.
  4. Breslow NE, Day NE. Statistical Methods in Cancer Research, Volume I: The Analysis of Case-Control Studies. IARC; 1980.
  5. CDC. Epi Info StatCalc: Stratified Analysis of 2 × 2 Tables.

Suggested citation

Yaacob, NM. Stratified 2 × 2 Table Analyzer, version 1.1.0. NajibMY; 2026. Available from: https://najibmy.com/tools/stratified-2x2-table/