How to use it
- Arrange the data with exposure in rows and outcome in columns.
- Enter a, b, c and d and choose the confidence level.
- Read the odds ratio, its interval and the p-value.
| Outcome | No outcome | |
|---|---|---|
| Exposed | a | b |
| Not exposed | c | d |
Formulas
- Odds ratio: OR = (a × d) ÷ (b × c)
- Standard error: SE = √(1/a + 1/b + 1/c + 1/d), on the log scale
- Confidence interval: exp(ln OR ± z × SE), with z = 1.645, 1.960 or 2.576 for 90%, 95% or 99%
- Test of OR = 1: z = ln OR ÷ SE, two-sided p from the normal distribution
- If any cell is 0, ½ is added to all four cells first.
Worked example
20 of 100 exposed people and 10 of 100 unexposed people have the outcome: a = 20, b = 80, c = 10, d = 90.
OR = (20 × 90) ÷ (80 × 10) = 1800 ÷ 800 = 2.25. SE = √(1/20 + 1/80 + 1/10 + 1/90) = √0.1736 = 0.4167. ln 2.25 = 0.811, so the 95% interval is exp(0.811 ± 1.960 × 0.4167) = exp(−0.0057) to exp(1.628) = 0.99 to 5.09. It just includes 1, and p = 0.052.
Common mistakes
- Swapping b and c inverts the odds ratio. Check that a and d are the “exposed with outcome” and “unexposed without outcome” cells.
- Reporting an odds ratio as if it were a risk ratio overstates the effect when the outcome is common.