Confounding vs Effect Modification interactive lab
Definitions
Visual
Scenarios
Calculator
Quiz
Cheat‑sheet

Confounding Bias • Remove it

A third variable is associated with both the exposure and the outcome, creating a spurious or distorted association. Proper control (e.g., stratification or regression adjustment) brings the estimate toward the truth.

Mnemonic: Confounding = a variable is connected to exposure & outcome → distorts.

Effect modification Heterogeneity • Describe it

The true effect of the exposure differs across levels of another variable (e.g., stronger in smokers than nonsmokers). This is not a bias; we should report stratum‑specific effects or include an interaction term.

Mnemonic: Modification = effect morphs by subgroup.

Adjustment vs Stratification Methods

Stratification splits data by levels of a variable to examine subgroup effects. Adjustment controls for variables (e.g., via regression or Mantel–Haenszel) to estimate the association as if groups were similar on those variables.

Mantel–Haenszel OR Logistic regression Interaction term

Confounding diagram

Exposure Outcome Confounder

A confounder is linked to both exposure and outcome, creating a backdoor path that distorts the crude estimate.

Effect modification diagram

Exposure Outcome Effect modifier

An effect modifier changes the strength/direction of the exposure → outcome effect (a true interaction). The arrow points to the relationship, not directly to outcome.

Quick 2×2 Calculator

Enter cell counts to compute crude OR/RR and 95% CI. Use the scenario editor above for stratified (Mantel–Haenszel) estimates.

Disease (+) Disease (−)
Exposed
Unexposed

Interpretation tips

  • Confounding: crude OR ≠ adjusted OR; after proper adjustment the estimate moves toward the stratum‑specific values (often toward 1.0).
  • Effect modification: stratum‑specific ORs differ (sometimes opposite directions). Report them; pooling can mislead.
  • Both: the variable is imbalanced (confounding) and the stratum‑specific effects differ (modification). Show both: report stratum effects and state the crude was confounded.
95% CI for OR uses SE = √(1/a+1/b+1/c+1/d) on the log scale.

Mini‑quiz 1

Crude OR = 2.0 (significant). After adjusting for age, OR = 1.05 (NS). What is age here?

A. A confounder
B. An effect modifier
C. A collider

Mini‑quiz 2

RR of treatment on outcome is 0.6 in men and 1.0 in women. Best description?

A. Confounding by sex
B. Effect modification by sex
C. Selection bias

Cheat‑sheet & reporting

Confounding

  • Associated with exposure and outcome
  • Distorts crude estimate
  • Address with stratification / regression
  • Report adjusted effect

Effect modification

  • True heterogeneity of effect
  • Identify via stratum‑specific estimates or interaction
  • Report stratum‑specific effects

Both

  • Imbalance + heterogeneity
  • Show stratified results
  • Explain why crude was misleading

Scenarios below are didactic and mirror patterns described in epidemiology teaching (coffee–smoking–lung cancer; aspirin–sex–MI; asbestos–smoking–lung cancer).

Toggle Mode for light/dark.