Odds Ratio Calculator
Calculate the odds ratio of a case-control study from exposed and unexposed cases and controls, with a Woolf 95% confidence interval, a p value and an optional conversion to an approximate risk ratio.
Why case-control studies use odds
A case-control study starts from the outcome. Researchers recruit people who have a disease (cases) and people who do not (controls) and look back at who was exposed. The default example has 200 cases and 400 controls; 120 of the cases (60%) and 160 of the controls (40%) were exposed. The odds of exposure among cases are 120 ÷ 80 = 1.5 and among controls 160 ÷ 240 = 0.667, and their ratio is 2.25. The same number comes out of the cross product ad ÷ bc = (120 × 240) ÷ (160 × 80) = 28,800 ÷ 12,800. Because the investigator chose to recruit two controls per case, the proportion of exposed people who are cases means nothing, and a risk ratio cannot be calculated. The odds ratio survives the design choice: recruit 800 controls with the same 40% exposure, 320 exposed and 480 not, and the odds ratio is still (120 × 480) ÷ (320 × 80) = 2.25. Only its interval narrows, from 1.59–3.18 to 1.64–3.09.
The Woolf interval
As with the risk ratio, the interval is built on the log scale. Woolf’s standard error is √(1/a + 1/b + 1/c + 1/d); for the example that is √(1/120 + 1/160 + 1/80 + 1/240) = √0.03125 = 0.177. The natural log of 2.25 is 0.811, and 0.811 ± 1.96 × 0.177 gives 0.464 to 1.157, which exponentiates to an interval of 1.59 to 3.18. The interval excludes 1 and the two-sided p value is below 0.001. The smallest cell dominates the standard error, so a study with only a handful of exposed controls has a wide interval however many cases it recruits. When any cell is zero, 0.5 is added to all four cells so that the ratio can be computed, and the calculator says so; for such sparse tables an exact or mid-p interval from statistical software is better.
When the odds ratio exaggerates
Odds and risks are close when the outcome is uncommon and drift apart when it is common, and the odds ratio always lies further from 1 than the risk ratio. Zhang and Yu’s 1998 formula, RR = OR ÷ (1 − P₀ + P₀ × OR), shows the effect for an odds ratio of 2.25 once you know the risk P₀ in the unexposed. At P₀ = 1% the risk ratio is 2.22, almost the same. At 10% it is 2.00, at 30% it is 1.64 and at 50% only 1.38. Reports of cohort studies and trials with common outcomes sometimes quote odds ratios from logistic regression, and readers who treat them as risk ratios overstate the effect. The formula is an approximation, less reliable for adjusted odds ratios, but it shows the size of the gap.
Common misreadings
An odds ratio of 2.25 does not mean the exposed are 2.25 times as likely to get the disease unless the disease is rare. An odds ratio from a case-control study is only as good as the control group: controls must come from the population that produced the cases, or selection bias moves the ratio in either direction. And an association, however strong, is not by itself evidence of cause; confounding, recall bias and reverse causation all have to be considered before drawing that conclusion.
How to use it
- Enter the exposed and unexposed counts among the cases.
- Enter the exposed and unexposed counts among the controls.
- Read the odds ratio, its 95% Woolf interval and the p value.
- If you know how common the outcome is among unexposed people, enter it to see the approximate risk ratio.
- Check the note for a zero-cell correction before relying on the interval.
Questions from journal club
How do you calculate an odds ratio from a 2×2 table?
Multiply the exposed cases by the unexposed controls, then divide by the product of the exposed controls and the unexposed cases: OR = ad ÷ bc. With 120 exposed and 80 unexposed cases and 160 exposed and 240 unexposed controls, OR = (120 × 240) ÷ (160 × 80) = 2.25.
When is the odds ratio a good estimate of relative risk?
When the outcome is rare in the population studied, roughly under 10%. For an odds ratio of 2.25 the corresponding risk ratio is 2.22 if 1% of unexposed people develop the outcome, 2.00 at 10% and 1.64 at 30%, so the odds ratio increasingly overstates the effect as the outcome becomes common.
What does it mean if the confidence interval includes 1?
An odds ratio of 1 means no association between exposure and outcome. If the 95% interval includes 1, the data are compatible with no association as well as with the effects inside the interval, and the two-sided p value is above 0.05. It does not prove there is no effect; a small study may simply lack precision.
Why is 0.5 added when a cell is zero?
With a zero in the table the odds ratio is either zero or infinite and the log standard error cannot be calculated. Adding 0.5 to all four cells, the Haldane correction, gives a finite estimate and interval. It is a rough fix; for very sparse tables, exact methods such as Fisher’s test give more trustworthy intervals.
Disclaimer: These calculators are for education and for reading published research only. They work with summary counts from studies and populations and do not diagnose disease, interpret an individual’s test result or advise on treatment, testing or vaccination. Study measures such as relative risk, NNT and predictive values describe groups, not individuals, and confidence intervals use standard approximations that can differ from exact methods in small tables. Do not use the results for personal health decisions: consult a qualified health professional, and follow national and local public health agencies on outbreaks, screening and vaccination.