med study partner

Articles & Guides › Articles › Biostatistics & Public Health

Relative risk, odds ratio and number needed to treat

How to set up the exposure-outcome 2 by 2 table and calculate relative risk and odds ratios, why case-control studies need the odds ratio and when it approximates relative risk, how attributable risk and absolute and relative risk reduction differ, and how to calculate and interpret the number needed to treat and number needed to harm.

Biostatistics & Public Health · 7 min read · Reviewed 2026-11-17

Almost every risk calculation starts from the same 2 by 2 table. Set it up the same way every time and the formulas become simple fractions. The harder skill is knowing which measure a study design allows and what each number means for a patient. This article covers relative risk and the odds ratio, attributable risk and absolute and relative risk reduction, and the number needed to treat and to harm.

Key points

  • With exposure in the rows and outcome in the columns, relative risk is (a ÷ (a + b)) ÷ (c ÷ (c + d)) and the odds ratio is ad ÷ bc.
  • Cohort studies and trials give relative risk; case-control studies give only the odds ratio, which approximates relative risk when the outcome is rare.
  • Attributable risk is the difference in risk; attributable risk percent, (RR − 1) ÷ RR, is the share of disease in the exposed that the exposure causes.
  • Absolute risk reduction is a difference in percentage points; relative risk reduction is 1 − RR and sounds larger, especially when baseline risk is low.
  • The number needed to treat is 1 ÷ absolute risk reduction and the number needed to harm is 1 ÷ absolute risk increase, each over a stated time.

Relative risk and odds ratio

Setting up the table

Put the exposure (or treatment) in the rows and the outcome in the columns[1].

DiseaseNo disease
Exposedab
Unexposedcd

Risk is the proportion of a group that develops the outcome over a period: a ÷ (a + b) in the exposed and c ÷ (c + d) in the unexposed.

Relative risk

Relative risk (RR), or risk ratio, is the risk in the exposed divided by the risk in the unexposed. It says how many times more likely the exposed group is to develop the outcome. An RR of 1 means no association, above 1 means more disease with exposure, and below 1 means the exposure protects.

RR needs true incidence, so it comes from cohort studies and randomized trials, where groups are defined by exposure and followed for the outcome[2].

Odds ratio

Odds are the number with an outcome divided by the number without it. The odds ratio (OR) is (a ÷ c) ÷ (b ÷ d), which simplifies to ad ÷ bc. In a case-control study it reads as the odds of exposure among cases divided by the odds of exposure among controls.

The OR is the measure for case-control studies. There the investigator chooses how many cases and controls to enroll, so the proportion with disease, and therefore any "risk," is artificial; the OR doesn't depend on that choice[3]. Dividing exposed cases by all exposed people in a case-control study produces a meaningless number.

When the odds ratio approximates relative risk

When the outcome is rare, roughly under 10% in each group, b is close to a + b and d is close to c + d, so the OR approximates the RR[1].

  • In a cohort of 4,000 solvent workers, 60 develop bladder cancer; among 4,000 unexposed workers, 20 do. The risks are 1.5% and 0.5%, so RR = 3. The OR is (60 × 3,980) ÷ (3,940 × 20), about 3.03: almost identical, because the outcome is rare.
  • When the outcome is common, the OR lies further from 1 than the RR. With risks of 40% and 20%, RR = 2, but the OR is (0.40 ÷ 0.60) ÷ (0.20 ÷ 0.80), about 2.67.

Attributable risk, absolute and relative risk reduction

Attributable risk

Attributable risk (AR), or risk difference, is the risk in the exposed minus the risk in the unexposed: the extra risk from the exposure in absolute terms. In the solvent example it is 1.5% − 0.5% = 1 percentage point.

Attributable risk percent is (risk in exposed − risk in unexposed) ÷ risk in exposed, which equals (RR − 1) ÷ RR. It is the share of disease among the exposed that is due to the exposure and would disappear without it. With an RR of 3, it is (3 − 1) ÷ 3, about 67%: two of every three bladder cancers in those solvent workers are attributable to the solvent[1].

Population attributable risk applies the same idea to the whole population, so it also depends on how common the exposure is.

Risk reduction for treatments

For treatments that lower risk, the same arithmetic is described as a reduction. The risk in the control group is the control event rate (CER), and in the treated group the experimental event rate (EER)[4].

MeasureFormulaMeaning
Absolute risk reduction (ARR)CER − EERHow many percentage points of risk the treatment removes
Relative risk reduction (RRR)(CER − EER) ÷ CER = 1 − RRWhat fraction of the baseline risk is removed
Relative risk (RR)EER ÷ CERThe treated group's risk as a fraction of the control group's

A vaccine trial in which 6% of placebo recipients and 1.5% of vaccinated people catch the infection gives an ARR of 4.5 percentage points and an RR of 0.25, so the RRR is 75%. In vaccine trials, the RRR is called vaccine efficacy.

Why relative numbers can mislead

A 50% relative reduction sounds impressive, but if the baseline risk is 2%, the absolute reduction is only 1 percentage point. Headlines and advertisements tend to quote the RRR; the ARR tells you how much an individual patient gains[4]. The same RRR produces a much larger ARR in high-risk patients: halving a 20% risk removes 10 percentage points. That is why treatments help high-risk patients more in absolute terms.

Number needed to treat and number needed to harm

Number needed to treat

The number needed to treat (NNT) is 1 ÷ ARR, with the ARR written as a decimal. It is how many patients must be treated, for the length of the study, to prevent one additional bad outcome. Smaller is better[2].

  1. Find the event rate in each group.
  2. Subtract to get the absolute difference.
  3. Convert the percentage to a decimal (2.5% becomes 0.025).
  4. Take the reciprocal, rounding up to a whole patient.

If a cholesterol-lowering drug cuts heart attacks over 5 years from 10% to 7.5%, the ARR is 0.025 and the NNT is 1 ÷ 0.025 = 40: forty people treated for 5 years to prevent one heart attack. In the vaccine trial above, 1 ÷ 0.045 is about 22.2, so 23 people must be vaccinated to prevent one infection. And with a 50% relative reduction, the NNT is 100 when baseline risk is 2% but 10 when it is 20%.

Number needed to harm

The number needed to harm (NNH) is 1 ÷ the absolute risk increase of an adverse effect (treated minus control). Larger is better. If the same cholesterol drug causes muscle symptoms in 2% of treated patients versus 1% on placebo, the increase is 1 percentage point and the NNH is 100.

Using them together

Always state the time frame: an NNT of 40 over 5 years isn't the same as 40 over 1 year. Comparing the two numbers weighs benefit against harm. With an NNT of 40 and an NNH of 100, about two and a half patients are helped for each one who has a side effect, and the decision then depends on how serious each outcome is[5].

Common confusions

  • Risk in a case-control study: the investigator fixed the number of cases, so only the odds ratio is valid.
  • ARR versus RRR: a difference in percentage points versus a fraction of baseline risk. Check which one a percentage describes.
  • Reciprocal of the wrong number: the NNT uses the absolute, not the relative, risk reduction, and the percentage must be converted to a decimal first (1 ÷ 0.04, not 1 ÷ 4).
  • Attributable risk versus attributable risk percent: an absolute difference in risk versus the share of exposed cases caused by the exposure.

References

  1. Celentano DD, Szklo M. Gordis Epidemiology. 6th ed. Elsevier; 2019. ↩
  2. Grimes DA, Schulz KF. Cohort studies: marching towards outcomes. Lancet. 2002;359(9303):341-345. doi:10.1016/S0140-6736(02)07500-1 Link ↩
  3. Schulz KF, Grimes DA. Case-control studies: research in reverse. Lancet. 2002;359(9304):431-434. doi:10.1016/S0140-6736(02)07605-5 Link ↩
  4. Laupacis A, Sackett DL, Roberts RS. An assessment of clinically useful measures of the consequences of treatment. N Engl J Med. 1988;318(26):1728-1733. doi:10.1056/NEJM198806303182605 Link ↩
  5. Guyatt G, Rennie D, Meade MO, Cook DJ, eds. Users' Guides to the Medical Literature: Essentials of Evidence-Based Clinical Practice. 3rd ed. McGraw-Hill Education; 2015. ↩

Test yourself in the Question Bank · Listen to the podcasts