TL;DR — Almost every clinical comparison starts as a 2×2 table: treatment vs control, event vs no-event, cells a, b, c, d. From those four numbers you compute the whole family of effect measures. RR (relative risk) is the ratio of risks — easy to explain. OR (odds ratio) is the ratio of odds — it overstates the effect versus RR whenever the event is common, but it is the natural output of logistic regression and case-control studies. RD (risk difference) is the absolute gap, and its reciprocal NNT (
1/|RD|, rounded up) is the most clinically honest number — "treat this many to prevent one event." IRR uses person-time; HR comes from survival analysis and respects when events happen. For every ratio measure, build the confidence interval on the log scale — that is where the sampling distribution is symmetric — then exponentiate back. Report an effect with its CI, never a lonely point estimate.
1. Simple explanation
Every trial or cohort study, no matter how big, can be squeezed into four numbers. You split people two ways: did they get the treatment or the control, and did they have the event (death, stroke, infection) or not. Count each of the four boxes and you have a 2×2 table. Every effect measure in this article is just a different way of dividing or subtracting those four counts.
Analogy — two batches of light bulbs. A factory ships two batches. Batch A got a new coating (treatment), batch B did not (control). You switch them all on and count how many burn out in a year. Say 15 of 100 coated bulbs fail versus 30 of 100 plain bulbs. Now, how do you report that?
- "Coated bulbs fail half as often" → that is a ratio (relative risk, RR = 0.5).
- "Coating cuts the failure rate by 15 percentage points" → that is a difference (risk difference, RD = −0.15).
- "You have to coat 7 bulbs to save one from failing" → that is NNT.
All three are true. They answer different questions. The ratio tells you how much the risk changed proportionally; the difference tells you how big the change is in absolute terms; the NNT tells you how much work the treatment is per life saved. A good analyst reports all of them, because a big ratio on a tiny baseline risk can be clinically trivial, and a small ratio on a huge baseline can be enormous.
The three questions this article answers: What do the four cells give me? Why do OR and RR disagree? And why do I build the interval on the log scale?
2. Diagram
THE 2x2 CONTINGENCY TABLE
┌─────────────┬─────────────┐
│ Event │ No event │ Row total
┌──────────────┼─────────────┼─────────────┤
│ Treatment │ a │ b │ a + b
├──────────────┼─────────────┼─────────────┤
│ Control │ c │ d │ c + d
└──────────────┴─────────────┴─────────────┘
Risk_treat = a/(a+b) Odds_treat = a/b
Risk_ctrl = c/(c+d) Odds_ctrl = c/d
┌──────── from the four cells ────────────────────────────────┐
│ RR = Risk_treat / Risk_ctrl (ratio of RISKS) │
│ OR = (a/b)/(c/d) = ad/bc (ratio of ODDS) │
│ RD = Risk_treat − Risk_ctrl (absolute difference) │
│ NNT = 1 / |RD| (round UP) (patients per event) │
│ IRR = (E_t/PT_t)/(E_c/PT_c) (uses person-time) │
│ HR = ratio of hazard rates over time (from survival/Cox) │
└─────────────────────────────────────────────────────────────┘
CONFIDENCE INTERVAL for a RATIO (RR, OR, HR, IRR):
work on the LOG scale, then exponentiate
lnOR ─┬─ SE(lnOR) = sqrt(1/a + 1/b + 1/c + 1/d)
└─ 95% CI = exp( lnOR ± 1.96 · SE )
log axis: 0.2 0.5 1.0 2.0 5.0
├─────────┼─────────┼─────────┼─────────┤
<-- favours treatment | favours control -->
▲ no-effect line (ratio = 1)
3. How it works
3.1 Risk versus odds — the split that causes half the confusion
Risk (a probability) is events divided by everyone in the group: a/(a+b). Odds is events divided by non-events: a/b. They answer the same question in different currencies.
| Quantity | Formula | Reads as | Range |
|---|---|---|---|
| Risk (probability) | a/(a+b) | "15 in 100 failed" | 0 to 1 |
| Odds | a/b | "15 failures per 85 survivors" | 0 to ∞ |
Everyday analogy — 15 rainy days in 100. Risk = 15/100 = 15% ("out of all days, 15% rained"). Odds = 15 rainy : 85 dry = 15/85 ≈ 0.18 ("about 1 rainy day for every 5–6 dry ones"). Same weather, two currencies: risk is out of everyone, odds is events per non-event.
When the event is rare, risk and odds are almost equal (a/b ≈ a/(a+b) because b ≈ a+b). When the event is common, they diverge sharply. That single fact drives the OR-vs-RR gap below.
3.2 The ratio measures — RR, OR, IRR, HR
| Measure | Formula | Question it answers | Where it comes from |
|---|---|---|---|
| RR (relative risk) | Risk_t / Risk_c | "How many times the risk?" | Cohort studies, RCTs |
| OR (odds ratio) | ad / bc | "How many times the odds?" | Case-control, logistic regression, meta-analysis |
| IRR (incidence rate ratio) | (E_t/PT_t)/(E_c/PT_c) | "How many times the rate per person-time?" | Rates with varying follow-up |
| HR (hazard ratio) | ratio of hazard rates | "How many times the instantaneous rate, over time?" | Survival analysis, Cox model |
- RR is the most intuitive: "half the risk" (RR = 0.5) is a sentence anyone understands. But you can only compute it when you know the denominators of everyone — you cannot get it from a case-control study, where the number of non-cases is set by design.
- OR works in any design, including case-control, and is symmetric (the OR for the event equals the reciprocal of the OR for the non-event). It is the currency of logistic regression and therefore of most meta-analyses. Its price: it is harder to explain and it exaggerates when events are common (§3.4).
Why can't you get RR from a case-control study? Because that design fixes the group sizes by outcome, not exposure — so "risk" is meaningless and only the OR survives. If that isn't obvious yet, read Study Designs & the Evidence Hierarchy first — it explains the forward-vs-backward split that decides which measure is even valid.
- IRR replaces headcount denominators with person-time (100 people followed 1 year = 100 person-years, same as 50 people for 2 years). Use it when follow-up varies or people enter and leave.
- HR goes further: it uses when each event happened and handles censoring (people who leave the study or never have the event). It is the ratio of the instantaneous event rates, assumed roughly constant over time (the proportional-hazards assumption).
3.3 The difference measures — RD and NNT
| Measure | Formula | Reads as |
|---|---|---|
| RD (risk difference / absolute risk reduction) | Risk_t − Risk_c | "15 fewer events per 100 treated" |
| NNT (number needed to treat) | 1/|RD|, round UP | "treat 7 to prevent 1 event" |
RD keeps the baseline in view. A treatment that cuts risk from 2% to 1% has the same RR (0.5) as one that cuts risk from 40% to 20%, but the RDs are −0.01 versus −0.20 — wildly different clinical value. NNT turns RD into a workload: NNT = 7 means seven patients must be treated for one to benefit. Always round NNT up (you cannot treat a fraction of a patient), and always attach the time horizon ("NNT = 7 over 2 years"). If the treatment causes harm, the mirror image is NNH (number needed to harm).
3.4 Why OR and RR disagree — and by how much
OR is always further from 1 than RR (more extreme). The gap is negligible when the event is rare and grows as the event becomes common.
event rare → OR ≈ RR (odds ≈ risk)
event common → OR pulls away from 1, exaggerating the apparent effect
Concrete: if control risk is 30% and treatment risk is 15%, RR = 0.50 but OR = 0.41. A journalist who reports the OR as if it were a risk ratio would claim the treatment cuts risk by 59% when it really cuts it by 50%. This is the classic "odds ratios overstate risk ratios when the outcome is common" trap. Rule of thumb: below ~10% baseline risk, OR ≈ RR and the shortcut is safe; above that, they must not be conflated.
3.5 Why the confidence interval lives on the log scale
A ratio cannot be negative, so its sampling distribution is skewed — squashed against 0 on the left, stretched out to the right. A symmetric estimate ± 1.96·SE interval on the raw ratio would be wrong (it could even dip below 0). Take the logarithm and the distribution becomes approximately symmetric and normal. So you: (1) take ln(ratio), (2) build a symmetric interval there, (3) exponentiate the two endpoints back. The result is a multiplicatively symmetric interval — the point estimate sits at the geometric center, e.g. 0.41 (0.21, 0.83) where 0.41/0.21 ≈ 0.83/0.41.
| Measure | SE on the log scale |
|---|---|
| ln(OR) | sqrt(1/a + 1/b + 1/c + 1/d) |
| ln(RR) | sqrt(1/a + 1/c − 1/(a+b) − 1/(c+d)) |
| ln(IRR) | sqrt(1/E_t + 1/E_c) |
| RD (already a difference — no log) | sqrt( R_t(1−R_t)/n_t + R_c(1−R_c)/n_c ) |
RD is a difference, not a ratio, so it stays on the natural scale and uses a normal ± 1.96·SE interval directly.
4. The math
Definitions from the four cells:
Risk_treat = a/(a+b) Risk_ctrl = c/(c+d)
RR = Risk_treat / Risk_ctrl
OR = (a/b)/(c/d) = ad/bc
RD = Risk_treat − Risk_ctrl
NNT = 1 / |RD| (round UP)
CI (ratio): ln(ratio) ± 1.96 · SE(ln ratio), then exp(·)
CI (RD): RD ± 1.96 · SE(RD)
Worked numeric example. A trial with a = 15, b = 85 (treatment: 15 events in 100) and c = 30, d = 70 (control: 30 events in 100).
Risk_treat = 15/100 = 0.15
Risk_ctrl = 30/100 = 0.30
Relative risk and its CI:
RR = 0.15 / 0.30 = 0.50
ln(RR) = ln(0.50) = −0.6931
SE = sqrt(1/15 + 1/30 − 1/100 − 1/100)
= sqrt(0.06667 + 0.03333 − 0.01 − 0.01) = sqrt(0.08) = 0.2828
95% CI = exp(−0.6931 ± 1.96·0.2828) = exp(−0.6931 ± 0.5544)
= (exp(−1.2475), exp(−0.1388)) = (0.29, 0.87)
RR = 0.50 (95% CI 0.29 to 0.87)
Odds ratio and its CI:
OR = (15·70)/(85·30) = 1050/2550 = 0.4118
ln(OR) = −0.8873
SE = sqrt(1/15 + 1/85 + 1/30 + 1/70)
= sqrt(0.06667 + 0.01176 + 0.03333 + 0.01429) = sqrt(0.12605) = 0.3550
95% CI = exp(−0.8873 ± 1.96·0.3550) = exp(−0.8873 ± 0.6959)
= (exp(−1.5832), exp(−0.1914)) = (0.21, 0.83)
OR = 0.41 (95% CI 0.21 to 0.83)
Risk difference, NNT, and RD's CI:
RD = 0.15 − 0.30 = −0.15 (15 fewer events per 100 treated)
NNT = 1/|−0.15| = 6.67 → round UP → 7
SE(RD) = sqrt( 0.15·0.85/100 + 0.30·0.70/100 )
= sqrt(0.001275 + 0.0021) = sqrt(0.003375) = 0.0581
95% CI = −0.15 ± 1.96·0.0581 = (−0.264, −0.036)
RD = −0.15 (95% CI −0.264 to −0.036)
Read the results together. RR = 0.50 says the treatment halves the risk. OR = 0.41 looks like a bigger effect — but that is the exaggeration of §3.4, because a 15–30% event is "common." Report the RR (0.50) to a clinician, not the OR. The RD = −0.15 gives the absolute win (15 per 100), and NNT = 7 says treat seven to prevent one event. All three CIs exclude the no-effect value (RR/OR exclude 1, RD excludes 0), so the result is statistically significant at the 5% level.
5. Real code
Pure numpy/scipy, no special libraries. Given a 2×2 table it returns every measure with a 95% CI, all ratio CIs computed on the log scale.
"""Effect measures from a 2x2 table (treatment/control x event/no-event).
Cells: a = treat & event, b = treat & no-event, c = ctrl & event, d = ctrl & no-event.
Ratio CIs are built on the LOG scale then exponentiated; RD stays on the natural scale."""
import numpy as np
from scipy.stats import norm
Z = norm.ppf(0.975) # 1.959964... the 95% two-sided z-multiplier
def effect_measures(a, b, c, d, correction=0.5):
"""Return RR, OR, RD, NNT (+95% CIs). Adds a small continuity correction if any cell is 0."""
if min(a, b, c, d) == 0: # Haldane-Anscombe fix: avoids divide-by-zero
a, b, c, d = a + correction, b + correction, c + correction, d + correction
n_t, n_c = a + b, c + d
risk_t, risk_c = a / n_t, c / n_c
# ---- Relative risk (log scale) ----
rr = risk_t / risk_c
se_lnrr = np.sqrt(1/a + 1/c - 1/n_t - 1/n_c)
rr_lo, rr_hi = np.exp(np.log(rr) - Z*se_lnrr), np.exp(np.log(rr) + Z*se_lnrr)
# ---- Odds ratio (log scale) ----
orr = (a * d) / (b * c)
se_lnor = np.sqrt(1/a + 1/b + 1/c + 1/d)
or_lo, or_hi = np.exp(np.log(orr) - Z*se_lnor), np.exp(np.log(orr) + Z*se_lnor)
# ---- Risk difference (natural scale) and NNT ----
rd = risk_t - risk_c
se_rd = np.sqrt(risk_t*(1-risk_t)/n_t + risk_c*(1-risk_c)/n_c)
rd_lo, rd_hi = rd - Z*se_rd, rd + Z*se_rd
nnt = int(np.ceil(1/abs(rd))) # round UP; report the sign as benefit/harm
return {
"RR": (rr, rr_lo, rr_hi),
"OR": (orr, or_lo, or_hi),
"RD": (rd, rd_lo, rd_hi),
"NNT": nnt,
}
def incidence_rate_ratio(e_t, pt_t, e_c, pt_c):
"""IRR with a log-scale CI; denominators are person-time, not headcount."""
irr = (e_t / pt_t) / (e_c / pt_c)
se = np.sqrt(1/e_t + 1/e_c) # SE of ln(IRR)
return irr, np.exp(np.log(irr) - Z*se), np.exp(np.log(irr) + Z*se)
if __name__ == "__main__":
r = effect_measures(a=15, b=85, c=30, d=70)
for k in ("RR", "OR", "RD"):
est, lo, hi = r[k]
print(f"{k:3s} = {est:5.3f} (95% CI {lo:.3f} to {hi:.3f})")
print(f"NNT = {r['NNT']} (treat this many to prevent one event)")
# IRR example: 20 events / 950 person-years vs 35 / 900 person-years
irr, lo, hi = incidence_rate_ratio(20, 950, 35, 900)
print(f"IRR = {irr:.3f} (95% CI {lo:.3f} to {hi:.3f})")
Expected output:
RR = 0.500 (95% CI 0.287 to 0.870)
OR = 0.412 (95% CI 0.205 to 0.826)
RD = -0.150 (95% CI -0.264 to -0.036)
NNT = 7 (treat this many to prevent one event)
IRR = 0.541 (95% CI 0.313 to 0.938)
The Haldane-Anscombe continuity correction (add 0.5 to every cell) matters in practice: a zero cell makes OR either 0 or infinite with an undefined SE, and the +0.5 fix keeps the estimate finite and the CI computable.
6. Real-world example
A cardiology RCT reported to three different audiences.
- Setup. A statin is tested against placebo for preventing a first heart attack over 2 years. In 100 statin patients, 15 have an event; in 100 placebo patients, 30 do. That is exactly
a=15, b=85, c=30, d=70. - To the trial statistician: the OR = 0.41 (0.21–0.83). Logistic regression outputs this directly, and it is the number that will be pooled if this trial enters a meta-analysis. The CI excludes 1, so the effect is significant.
- To the treating cardiologist: the RR = 0.50 (0.29–0.87) — "the statin halves the 2-year heart-attack risk." This is the honest ratio; quoting the OR (0.41) here would overstate the benefit because a 15–30% event rate is common.
- To the patient and the payer: the RD = −0.15 and NNT = 7 over 2 years — "treat seven similar patients for two years to prevent one heart attack." This is what decides whether the drug is worth its cost and side effects. A drug with a dazzling RR but an NNT of 500 might not be.
- A twist — varying follow-up. Suppose patients enrolled at different times, so total exposure differs: 20 events in 950 statin person-years versus 35 events in 900 placebo person-years. Now headcount risk is misleading; use the IRR = 0.54 (0.31–0.94), which correctly credits the longer-followed group's extra exposure.
- A further twist — timing matters. If the statin delays heart attacks rather than preventing them, a plain RR over 2 years hides that. A Cox model gives an HR that uses each event's timing and handles patients who dropped out (censored), revealing whether the survival curves separate early, late, or steadily.
- Decision. Reviewers see RR = 0.50, NNT = 7, all CIs excluding no-effect, and a consistent HR. The drug is recommended, and its trial-level OR feeds the next systematic review.
7. Interview questions companies actually ask
Q [Pfizer / clinical biostatistics] "What is the difference between an odds ratio and a relative
risk, and when does it matter?"
A RR is the ratio of RISKS (a/(a+b) over c/(c+d)); OR is the ratio of ODDS (ad/bc). When the
event is rare they are nearly equal. When the event is common the OR is further from 1 than
the RR, so it OVERSTATES the effect. Example: control risk 30%, treatment 15% gives RR 0.50
but OR 0.41. Report RR to clinicians; OR is the natural output of logistic regression and
case-control studies, which is why meta-analyses often pool it.
Q [a health-tech startup] "A trial reports NNT = 7. Explain it to a non-statistician."
A You must treat about seven similar patients, over the trial's time window, for one of them to
avoid the bad outcome who otherwise would have had it. It is 1 divided by the absolute risk
difference, rounded up. Lower NNT = more effective. Always state the time horizon and remember
it depends on baseline risk: the same relative effect gives a smaller NNT in higher-risk
patients.
Q [Genentech / epidemiology] "Why do we build confidence intervals for ratios on the log scale?"
A A ratio can't go below zero and its sampling distribution is skewed, so a symmetric estimate
± 1.96·SE on the raw ratio is invalid and could even cross zero. Taking the log makes the
distribution roughly symmetric and normal; you build the interval there and exponentiate the
endpoints. The result is multiplicatively symmetric, e.g. 0.41 (0.21, 0.83) where the point
estimate is the geometric mean of the bounds.
Q [a CRO / medical affairs] "What is a hazard ratio and how does it differ from a relative risk?"
A An HR is the ratio of instantaneous event RATES over time, from survival analysis / a Cox
model. RR is a ratio of cumulative risks over a fixed period. The HR uses WHEN events happen
and handles censoring (people lost to follow-up or event-free at the end); RR ignores timing.
HR ≈ RR when the event is rare and follow-up short. The HR relies on the proportional-hazards
assumption — that the rate ratio is roughly constant over time.
Q [UnitedHealth / actuarial-clinical] "Same drug, two populations: RR is 0.5 in both, but you're
told to prefer treating one. Why?"
A Because RR ignores baseline risk. If population A has 40% baseline risk, RR 0.5 gives RD −0.20
and NNT 5. If population B has 2% baseline risk, RR 0.5 gives RD −0.01 and NNT 100. The
absolute benefit — RD and NNT — is 20x larger in the high-risk group, so treat there first.
Relative effects travel across populations; absolute effects tell you who actually benefits.
Q [Moderna / vaccine epidemiology] "When would you use an incidence rate ratio instead of a risk
ratio?"
A When follow-up time varies across people — staggered enrollment, dropouts, or recurrent events
— a simple headcount denominator is unfair. The IRR uses person-time (E_t/PT_t over E_c/PT_c),
correctly crediting longer exposure. Its log-scale SE is sqrt(1/E_t + 1/E_c). Vaccine efficacy
is often 1 − IRR because person-years, not just people, drive exposure.
Q [a diagnostics company] "One cell of your 2x2 is zero. What breaks and what do you do?"
A A zero cell makes the OR either 0 or infinite and its log-scale SE undefined (1/0). Apply a
continuity correction — the Haldane-Anscombe fix adds 0.5 to every cell — which keeps the
estimate finite and the CI computable. Note it in the methods; with sparse data an exact
method or a Bayesian model is preferable to relying on the +0.5 patch.
Q [Bristol Myers Squibb] "The press release says 'cuts risk by 59%' from an OR of 0.41 on a common
outcome. What's wrong?"
A They treated an odds ratio as if it were a risk ratio. 1 − 0.41 = 59% is the odds reduction,
not the risk reduction. On this common outcome the true RR is 0.50, a 50% risk reduction. On
common outcomes OR always looks more dramatic than RR; conflating them inflates the claim. The
correct headline uses the RR or the absolute RD/NNT.
8. When to use / tradeoffs
PICK THE RIGHT MEASURE FOR THE JOB:
✓ RR — cohort/RCT, talking to clinicians ("half the risk"); needs full denominators
✓ OR — case-control, logistic regression, meta-analysis; symmetric, any design
✓ RD — when absolute impact matters (cost, policy); keeps the baseline visible
✓ NNT — patient/payer communication ("treat 7 to prevent 1"); always round UP + time horizon
✓ IRR — follow-up varies / person-time denominators / recurrent events
✓ HR — time-to-event matters, censoring present (survival, Cox)
HONEST LIMITS:
✗ OR overstates RR on common outcomes — never quote OR as if it were a risk reduction
✗ a big RR on a tiny baseline can be clinically trivial — always show RD/NNT too
✗ NNT is meaningless without a time horizon and a defined population
✗ HR assumes proportional hazards; if curves cross, a single HR misleads
✓ ALWAYS report the CI (on the log scale for ratios); a point estimate alone is not evidence
THE REPORTING RULE:
give a ratio AND an absolute measure AND a CI — one number can always mislead.
A single effect measure is a single viewpoint. The ratio can dazzle while the absolute effect is trivial; the OR can look bigger than the RR on the same data. Report a ratio, an absolute measure, and a confidence interval together, and state the population and time horizon. These trial-level estimates are the raw material that gets pooled in the next article.
9. Summary + related articles
- Every comparison collapses to a 2×2 table with cells a, b, c, d; all measures come from those four counts.
- Risk =
a/(a+b), odds =a/b; they agree when events are rare and diverge when events are common. - RR (ratio of risks) is the clinician's number; OR (
ad/bc) is the regression/meta-analysis number and overstates RR on common outcomes. - RD =
Risk_t − Risk_ckeeps the baseline in view; NNT =1/|RD|(round up, with a time horizon) is the workload per event prevented. - IRR uses person-time; HR uses event timing and censoring from survival analysis.
- Build every ratio CI on the log scale —
exp(ln(ratio) ± 1.96·SE)— then exponentiate; RD stays on the natural scale. - Always report a ratio + an absolute measure + a CI; one number alone can mislead.
Related: Meta-Analysis: Pooling Studies (Fixed vs Random Effects) · Heterogeneity & Forest Plots · Probability & Statistics Foundations
Resources
- Cochrane Handbook, Ch. 6 "Choosing effect measures and computing estimates" — https://training.cochrane.org/handbook/current/chapter-06
- Rothman, Greenland & Lash, Modern Epidemiology — measures of effect and their variances
- Altman & Bland, "Statistics Notes: absolute risk reduction, relative risk and NNT" — https://www.bmj.com/content/318/7196/1499
- Cook & Sackett, "The number needed to treat" — https://www.bmj.com/content/310/6977/452
- Grant, "Converting an odds ratio to a range of plausible relative risks" — https://www.bmj.com/content/348/bmj.f7450