Answer

Odds ratio vs relative risk: what is the difference and when do they agree?

A frequently asked statistics question ·

effect sizelogistic regressionstudy design

The short answer

Relative risk (the risk ratio) divides the probability of the outcome in one group by the probability in the other; the odds ratio divides the odds instead. When the outcome is rare the two are almost equal. When it is common, the odds ratio lies further from 1 and overstates the risk ratio. Cohort studies and trials can give either, while case-control studies and logistic regression give odds ratios.

Two ways to compare groups in a 2x2 table

Suppose you follow an exposed and an unexposed group and record whether an event happens. Label the four cells of the table a (exposed, event), b (exposed, no event), c (unexposed, event) and d (unexposed, no event).

In the simulated cohort below, 86 of 300 exposed people and 41 of 300 unexposed people had the event. The risks are .287 and .137, so the relative risk is 2.10: the event was about twice as likely with exposure. The odds are 0.402 and 0.158, so the odds ratio is 2.54. Both numbers are correct; they answer different questions. An odds ratio of 2.54 means the odds were 2.54 times as high, which is not the same as the event being 2.54 times as likely.

Why the odds ratio exaggerates when the outcome is common

The two ratios are linked by a simple identity. If p0 is the risk in the unexposed group and p1 the risk in the exposed group, then OR = RR x (1 - p0) / (1 - p1). When both risks are small, the correction factor is close to 1 and the odds ratio is a good stand-in for the relative risk. This is the rare outcome (or rare disease) approximation; a common rule of thumb is that it works when the outcome occurs in fewer than about 10% of people in each group.

When the outcome is common, the factor grows and the odds ratio drifts away from 1 faster than the relative risk does. Holding the relative risk at exactly 2, the odds ratio is 2.02 when the baseline risk is 1%, 2.25 at 10%, 2.67 at 20% and 6.00 at 40%. The odds ratio is always further from 1 than the relative risk, in either direction: for a protective exposure it is the smaller of the two. Reading it as a risk ratio therefore always overstates the effect, and with common outcomes the overstatement can be large.

If you know the baseline risk, you can convert a crude odds ratio back: RR = OR / (1 - p0 + p0 x OR). For example, an odds ratio of 2.67 with a baseline risk of 20% gives 2.67 / (0.8 + 0.2 x 2.67), which is about 2. Applying the same formula to an odds ratio adjusted for covariates is only a rough approximation, and its confidence limits are not reliable, so it is better to fit a model that estimates the risk ratio directly.

Which study designs give which measure

The odds ratio also has a tidy mathematical property: the odds ratio for the event is exactly the reciprocal of the odds ratio for the non-event, which is not true of the relative risk. This symmetry, and its link to logistic regression, explains its popularity. For how the logit link compares with probit, see the page on logit vs probit.

See it in R and Python

The script computes both ratios with 95% confidence intervals from a 2x2 table, using the usual Wald intervals on the log scale. It first shows the exact relationship when the relative risk is held at 2, then simulates a cohort study with a common outcome, and finally draws a case-control sample (every case plus an equal number of controls) from a simulated population of 200,000 where the true relative risk is 2 and the true odds ratio is 2.25.

R

set.seed(3141)
# Risk ratio and odds ratio from a 2x2 table, with Wald 95% CIs on the log scale
# a = exposed with event, b = exposed without, c = unexposed with event, d = unexposed without
rr_or <- function(a, b, c, d) {
  rr <- (a / (a + b)) / (c / (c + d)); se_rr <- sqrt(1/a - 1/(a + b) + 1/c - 1/(c + d))
  or <- (a * d) / (b * c);             se_or <- sqrt(1/a + 1/b + 1/c + 1/d)
  round(c(RR = rr, RR_lo = rr * exp(-1.96 * se_rr), RR_hi = rr * exp(1.96 * se_rr),
          OR = or, OR_lo = or * exp(-1.96 * se_or), OR_hi = or * exp(1.96 * se_or)), 2)
}

# 1. Exact values (no randomness): the risk doubles with exposure, so RR = 2 every time
p0 <- c(0.01, 0.05, 0.10, 0.20, 0.30, 0.40)
p1 <- 2 * p0
round(cbind(risk_unexposed = p0, risk_exposed = p1, RR = p1 / p0,
            OR = (p1 / (1 - p1)) / (p0 / (1 - p0))), 3)

# 2. A cohort study: 300 exposed and 300 unexposed, true risks .30 vs .15
exposed <- rep(c(1, 0), each = 300)
event   <- rbinom(600, 1, ifelse(exposed == 1, 0.30, 0.15))
tab <- table(exposure = factor(exposed, c(1, 0)), event = factor(event, c(1, 0)))
tab
round(rbind(risk = tab[, 1] / rowSums(tab), odds = tab[, 1] / tab[, 2]), 3)
rr_or(tab[1, 1], tab[1, 2], tab[2, 1], tab[2, 2])

# 3. A case-control study drawn from a population of 200,000 (true RR 2, true OR 2.25)
pop_exp   <- rbinom(2e5, 1, 0.3)
pop_event <- rbinom(2e5, 1, ifelse(pop_exp == 1, 0.20, 0.10))
cases    <- which(pop_event == 1)
controls <- sample(which(pop_event == 0), length(cases))   # one control per case
cc <- c(cases, controls)
a <- sum(pop_exp[cc] == 1 & pop_event[cc] == 1); b <- sum(pop_exp[cc] == 1 & pop_event[cc] == 0)
c <- sum(pop_exp[cc] == 0 & pop_event[cc] == 1); d <- sum(pop_exp[cc] == 0 & pop_event[cc] == 0)
c(cases = length(cases), controls = length(controls))
rr_or(a, b, c, d)   # the OR is still valid; the "RR" from this table is not

Python

import numpy as np

rng = np.random.default_rng(3141)

# Risk ratio and odds ratio from a 2x2 table, with Wald 95% CIs on the log scale
# a = exposed with event, b = exposed without, c = unexposed with event, d = unexposed without
def rr_or(a, b, c, d):
    rr = (a / (a + b)) / (c / (c + d)); se_rr = np.sqrt(1/a - 1/(a + b) + 1/c - 1/(c + d))
    odr = (a * d) / (b * c);            se_or = np.sqrt(1/a + 1/b + 1/c + 1/d)
    out = {"RR": rr, "RR_lo": rr * np.exp(-1.96 * se_rr), "RR_hi": rr * np.exp(1.96 * se_rr),
           "OR": odr, "OR_lo": odr * np.exp(-1.96 * se_or), "OR_hi": odr * np.exp(1.96 * se_or)}
    return {k: round(float(v), 2) for k, v in out.items()}

# 1. Exact values (no randomness): the risk doubles with exposure, so RR = 2 every time
p0 = np.array([0.01, 0.05, 0.10, 0.20, 0.30, 0.40])
p1 = 2 * p0
print(np.round(np.column_stack([p0, p1, p1 / p0, (p1 / (1 - p1)) / (p0 / (1 - p0))]), 3))

# 2. A cohort study: 300 exposed and 300 unexposed, true risks .30 vs .15
exposed = np.repeat([1, 0], 300)
event = rng.binomial(1, np.where(exposed == 1, 0.30, 0.15))
a, b = np.sum((exposed == 1) & (event == 1)), np.sum((exposed == 1) & (event == 0))
c, d = np.sum((exposed == 0) & (event == 1)), np.sum((exposed == 0) & (event == 0))
print("table [[a, b], [c, d]]:", [[int(a), int(b)], [int(c), int(d)]])
print("risk", np.round([a / (a + b), c / (c + d)], 3), " odds", np.round([a / b, c / d], 3))
print(rr_or(a, b, c, d))

# 3. A case-control study drawn from a population of 200,000 (true RR 2, true OR 2.25)
pop_exp = rng.binomial(1, 0.3, 200_000)
pop_event = rng.binomial(1, np.where(pop_exp == 1, 0.20, 0.10))
cases = np.flatnonzero(pop_event == 1)
controls = rng.choice(np.flatnonzero(pop_event == 0), size=len(cases), replace=False)  # one per case
cc = np.concatenate([cases, controls])
e, y = pop_exp[cc], pop_event[cc]
a, b = np.sum((e == 1) & (y == 1)), np.sum((e == 1) & (y == 0))
c, d = np.sum((e == 0) & (y == 1)), np.sum((e == 0) & (y == 0))
print("cases", len(cases), "controls", len(controls))
print(rr_or(a, b, c, d))   # the OR is still valid; the "RR" from this table is not

The figures quoted here come from one seeded run of the R code. Python's random numbers differ from R's, so its simulated counts and ratios differ slightly (for example an odds ratio of 2.45 instead of 2.54 in the cohort), but the pattern is the same. The exact table in part 1 involves no randomness and is identical in both.

Which one should you report?

If your design gives real risks, report the risks in each group, the relative risk or risk difference, and add the odds ratio only if a model or a convention calls for it. If your design or your model only gives odds ratios, report them as odds ratios and describe them in terms of odds. Do not write that an exposure made an outcome 2.5 times as likely when 2.5 is an odds ratio and the outcome is common. In every case, give a confidence interval: an interval that excludes 1 indicates a difference at the matching significance level, and its width shows how precisely the ratio is known.

How to report an odds ratio or relative risk in APA style (7th edition)

State which ratio you report, the reference group, and how the interval was computed (here, Wald intervals on the log scale). Using the cohort example:

"The event occurred in 28.7% of exposed and 13.7% of unexposed participants, RR = 2.10, 95% CI [1.50, 2.93]. Expressed as odds, exposure was associated with higher odds of the event, OR = 2.54, 95% CI [1.68, 3.84]."

In a table, give the counts or percentages in each group alongside the ratio and its 95% CI, and say in a note which group is the reference. Ratios can exceed 1, so keep the leading zero for values below 1 (for example 0.62), and report p values without one (p < .001).

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Need more than an answer?

Written by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.