Editverse Free Calculator
Odds Ratio & Relative Risk Calculator
Turn a 2×2 table into an odds ratio or relative risk — with the 95% confidence interval, the formula, and the reproducible R command. Read a full interpretation guide below. Validated against R 4.3.3.
In Simple Words
An odds ratio (OR) and a relative risk (RR) both compare how often an outcome happens in an exposed group versus an unexposed one — but they are not the same number. RR compares probabilities (the chance of disease if exposed divided by the chance if not). OR compares odds (the ratio of disease to no-disease in each group).
When the outcome is rare, OR and RR are close. When the outcome is common, the OR is further from 1 than the RR — so reading an OR as if it were a risk ratio overstates the effect. Use RR for cohort and trial designs where you can measure risk directly; the OR is the natural measure for case-control studies and logistic regression.
When to Use OR vs RR
Use relative risk when your design lets you estimate the actual probability of the outcome in each group — cohort studies and randomised trials. Use the odds ratio for case-control studies, where outcome status is fixed by sampling and risk cannot be estimated directly, and as the effect measure produced by logistic regression.
The practical rule: do not interpret an OR as a risk ratio when the outcome is common (above roughly 10%), because the OR will exaggerate the association. Always report the point estimate with its 95% confidence interval; an interval that crosses 1 indicates the association is not statistically significant. For sparse 2×2 tables with small or zero cells, Fisher’s exact test is the safer significance test. Not sure which measure your design calls for? Our interactive Test Selector can help.
tbl <- matrix(c({a},{b},{c},{d}), nrow = 2, byrow = TRUE)
fisher.test(tbl) # or epitools::oddsratio(tbl)User guide
When to use. Quantify association in a 2×2 table; OR for case-control, RR for cohort designs.
Assumptions. Counts are independent; cells are non-zero (else apply continuity correction).
Common mistakes. Do not interpret OR as RR when the outcome is common (>10%).
Worked example
Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.
References
- Woolf B. On estimating the relation between blood group and disease. Ann Hum Genet. 1955;19:251-253.
Worked Examples
Example 1 — A 2×2 exposure study
With 30 exposed cases, 70 exposed non-cases, 10 unexposed cases and 90 unexposed non-cases, the odds ratio is (30×90)/(70×10) = 3.86. Because the outcome here is common, the relative risk is smaller (about 3.0). Report the OR with its 95% confidence interval, and state which measure you used.
Example 2 — Why a zero cell needs care
If any cell is zero the odds ratio is undefined or infinite. A common fix is the Haldane–Anscombe correction (add 0.5 to each cell), but for sparse tables the cleaner approach is Fisher’s exact test for the p-value and an exact confidence interval.
Assumptions to Check
Correct design for the measure. Use RR only when you can estimate risk (cohort, trial). For case-control data, the OR is the valid measure; an RR cannot be computed from case-control sampling.
Independent observations. Each subject contributes once. Matched or clustered data need conditional or mixed-effects methods, not a plain 2×2 OR.
Adequate cell counts. The normal-approximation confidence interval (Woolf’s method) is unreliable when expected counts are small; use an exact interval instead.
Common Mistakes
Reading an OR as a risk ratio
When the outcome is common (above ~10%), the OR is further from 1 than the RR. Calling a high OR a “3-fold higher risk” overstates the effect.
Ignoring the confidence interval
An OR of 2.0 means little without its interval. If the 95% confidence interval includes 1, the association is not statistically significant.
Computing RR from case-control data
Case-control studies fix the number of cases by design, so they cannot estimate absolute risk. Only the odds ratio is valid there.
Confusing association with causation
A large OR or RR signals association, not cause. Confounding can produce or distort either measure; adjust for it before drawing causal conclusions.
Frequently Asked Questions
When are the odds ratio and relative risk approximately equal?
When the outcome is rare (roughly below 10%) in both groups. As the outcome becomes common, the OR increasingly exceeds the RR in magnitude.
Which should I report?
Report the measure that matches your design: RR for cohort studies and trials, OR for case-control studies and logistic regression. State clearly which one you used.
What does an odds ratio of 1 mean?
An OR of 1 means the odds of the outcome are the same in both groups — no association. Values above 1 indicate higher odds with exposure, below 1 indicate lower.
Does the result match SPSS, R, and Stata?
Yes. The calculator uses the standard 2×2 formulas and Woolf’s log method for the interval, and shows the exact R command so you can reproduce it.
Related Calculators
References
- Zhang J, Yu KF. What’s the relative risk? A method of correcting the odds ratio in cohort studies of common outcomes. JAMA. 1998;280(19):1690–1691. PMID 9832001.
- Andrade C. Understanding relative risk, odds ratio, and related terms: as simple as it can get. J Clin Psychiatry. 2015;76(7):e857–e861. PMID 26231012.
- Woolf B. On estimating the relation between blood group and disease. Ann Hum Genet. 1955;19(4):251–253.
Need This Analysis Done for Your Manuscript?
Our PhD biostatisticians compute your odds ratios and risk ratios, fit the logistic models, and deliver publication-ready tables with reproducible R output.
