Relative Risk and Odds Ratio Calculator
Calculate Relative Risk (RR), Odds Ratio (OR), Absolute Risk Reduction (ARR), and Number Needed to Treat (NNT) from a 2×2 contingency table.
The 2×2 Contingency Table
In epidemiology, we compare outcomes between exposed and unexposed groups using a 2×2 table:
| Outcome (+) | No Outcome (−) | |
|---|---|---|
| Exposed | a | b |
| Unexposed | c | d |
Key Measures
Relative Risk (RR) — the ratio of risks between the two groups: RR = [a ÷ (a + b)] ÷ [c ÷ (c + d)]
- RR = 1: No difference in risk
- RR > 1: Exposure increases risk
- RR < 1: Exposure is protective (like a treatment)
Odds Ratio (OR) — the ratio of odds: OR = (a × d) ÷ (b × c)
The OR approximates the RR when the outcome is rare (prevalence < 10%). For common outcomes, OR always overestimates RR.
Absolute Risk Reduction (ARR) — the absolute difference in risk: ARR = Risk in Unexposed − Risk in Exposed (when treatment reduces risk)
Number Needed to Treat (NNT) — how many people need treatment to prevent one additional case: NNT = 1 ÷ ARR
A lower NNT means more effective treatment. An NNT of 1 is perfect (every treated patient benefits). An NNT of 20 means 20 people must be treated to prevent 1 event.
Example
A clinical trial: 200 exposed, 200 unexposed.
- Exposed: 40 had the outcome (a=40, b=160)
- Unexposed: 20 had the outcome (c=20, d=180)
RR = (40/200) ÷ (20/200) = 0.20 ÷ 0.10 = 2.0 (exposure doubles the risk) OR = (40 × 180) ÷ (160 × 20) = 7200 ÷ 3200 = 2.25