Assess confounding and effect modification by analysing 2×2 tables across strata of a third variable.
Stratified analysis is a cornerstone of epidemiological methods. It separates the data into subgroups (strata) defined by a potential confounder and computes stratum-specific and pooled measures of association. This allows you to assess whether a third variable confounds the exposure-outcome relationship (the crude and adjusted estimates differ) or modifies the effect (stratum-specific estimates differ from each other).
Statulator computes stratum-specific OR/RR and chi-square tests, the Mantel–Haenszel (MH) pooled estimate, and homogeneity tests (Woolf and Breslow-Day) to assess whether pooling is appropriate.
A study examines whether Drug A reduces infection risk. The crude OR suggests a benefit, but age may confound the relationship (older patients get Drug A more often and are more prone to infection). The data are stratified by age:
Stratum 1 (Age < 60): a=30, b=70, c=20, d=80 → OR = 1.71
Stratum 2 (Age ≥ 60): a=50, b=50, c=35, d=65 → OR = 1.86
1 Open the Stratified Analysis calculator.
2 Add two strata and enter the 2×2 table values for each.
3 The calculator produces stratum-specific ORs, the MH pooled OR, homogeneity tests, and the CMH chi-square test.
If the MH pooled OR differs substantially from the crude OR, age is a confounder. If the Breslow-Day test is significant, effect modification is present and you should report stratum-specific estimates rather than a single pooled value.
Confounding: Compare the crude (unstratified) OR/RR to the MH-adjusted estimate. If they differ by more than ~10%, the stratifying variable is likely a confounder.
Effect modification: If the Breslow-Day or Woolf homogeneity test is significant (p < 0.05), stratum-specific estimates differ meaningfully. Report each stratum separately rather than the pooled value.
CMH chi-square: Tests whether the pooled association is statistically significant after controlling for the stratifying variable.
where \( N_i \) is the total count in stratum \( i \).
with df = 1, where \( E(a_i) = R_{1i}C_{1i}/N_i \) and \( \text{Var}(a_i) = R_{1i}R_{2i}C_{1i}C_{2i}/(N_i^2(N_i-1)) \). Statulator uses the uncorrected form (no −0.5 continuity correction), matching the calculator's output.
where \( \hat{a}_i \) is the expected value of \( a_i \) under the assumption that all strata share a common OR (the MH estimate). df = number of strata − 1.
An epidemiologist assesses the association between oral-contraceptive use and myocardial infarction, stratified by smoking status (smoker / non-smoker).
Stratum 1 (Smokers): OR = 2.8. Stratum 2 (Non-smokers): OR = 3.1.
Result: MH pooled OR = 2.95 (95% CI: 1.9, 4.6); Breslow-Day p = 0.78.
Interpretation: Stratum-specific ORs are homogeneous (p = 0.78). The pooled OR of ~3 indicates a three-fold increase in MI risk with OC use, adjusted for smoking.
A criminologist examines whether prior arrest (yes/no) is associated with re-offending (yes/no), stratified by offence type (violent / non-violent).
Stratum 1 (Violent): OR = 1.6. Stratum 2 (Non-violent): OR = 2.4.
Result: MH pooled OR = 2.05; Breslow-Day p = 0.15.
Interpretation: The ORs are reasonably homogeneous. Pooling across offence type, individuals with a prior arrest have about twice the odds of re-offending.
A veterinary study tests whether a feed supplement reduces mastitis (yes/no) in dairy cows, stratified by herd size (small / large).
Stratum 1 (Small herds): OR = 0.45. Stratum 2 (Large herds): OR = 0.50.
Result: MH pooled OR = 0.48 (95% CI: 0.30, 0.76); Breslow-Day p = 0.82.
Interpretation: The supplement roughly halves the odds of mastitis regardless of herd size, with homogeneous effects across strata.
Simpson's paradox scenario: a new surgical technique appears worse overall, but is actually better within each age stratum (<60, ≥60). The crude analysis is confounded by age.
Crude OR: 1.4 (technique appears harmful). Stratum <60: OR = 0.6. Stratum ≥60: OR = 0.7.
Result: MH pooled OR = 0.65 (95% CI: 0.45, 0.94); Breslow-Day p = 0.68.
Interpretation: After adjusting for age, the new technique actually reduces adverse outcomes. The crude OR was confounded because older (higher-risk) patients preferentially received the new technique.