Lelifi·tools

Relative Risk Calculator

A relative risk of 2.00 means the exposed group is twice as likely to see the outcome. With 40 sick out of 200 exposed and 20 sick out of 200 unexposed, 0.20 / 0.10 = 2.00, the risk difference is 0.10, the odds ratio is 2.25, and the 95 percent interval runs from 1.21 to 3.30.

Enter the four counts from a two by two table. Row one is the exposed group, row two is the comparison group.

Enter the four counts from a two by two table to get the risk in each group, the relative risk, the risk difference, the odds ratio and a 95 percent confidence interval.

By the Lelifi editors ·

Key takeaways

Stomach trouble after the picnic, by saladShare of each group that got sick within 12 hoursAte the salad0.20Skipped it0.10Relative risk 0.20 / 0.10 = 2.00The bar for the exposed group is twice as long, and the ratio of the two risks is 2.00
Twenty percent of the people who ate the potato salad got sick against 10 percent of the people who skipped it, a ratio of 2.00.
One is the fulcrum for relative riskValues to the left mean less risk, values to the right mean more01.00no difference2.00twice the risk0.50half the riskprotectiveharmfulA ratio of 2.00 is the same size whether the baseline risk is 10 percent or 1 in 100,000
Relative risk is centered on 1.00, with protective values below and harmful values above; 0.50, 1.00 and 2.00 are marked.
On this page
  1. What relative risk measures
  2. The two by two table behind the number
  3. Worked example: potato salad at a company picnic
  4. Reading values above, below and at one
  5. Relative risk and odds ratio diverge on common outcomes
  6. Confidence intervals and statistical significance
  7. Absolute risk, risk difference and number needed to harm
  8. Mistakes that change the answer

What relative risk measures

Relative risk compares the chance of an outcome in one group with the chance in another group. Public health texts also call it the risk ratio, and the CDC Principles of Epidemiology defines it as the risk in the group of interest divided by the risk in the comparison group. The arithmetic is one division, but the two numbers that go into it decide what the answer means.

Risk here means the share of a group that develops the outcome. Forty cases in a group of 200 is a risk of 40 / 200 = 0.20, or 20 percent. A relative risk of 2.00 says the first group is twice as likely to see the outcome as the second. A relative risk of 1.00 says the two groups look the same at the precision reported.

Relative riskPlain readingHow it usually gets written
0.50Half the risk of the comparison group50 percent lower risk
0.80One fifth lower20 percent lower risk
1.00No difference between the groupsthe same risk
1.50Half again as likely50 percent higher risk
2.00Twice as likelydouble the risk
3.00Three times as likelytriple the risk

Both parts of the ratio carry the same unit, so the result is a pure number. That portability is why news reports, package inserts and outbreak notices quote relative figures instead of raw counts, and it is also why they can mislead when the baseline is left out.

The two by two table behind the number

Almost every relative risk starts as a two by two table. Rows are exposure status, columns are outcome status, and the cells hold four counts: a is exposed with the outcome, b is exposed without it, c is unexposed with the outcome, and d is unexposed without it.

OutcomeNo outcomeTotal
Exposedaba + b
Unexposedcdc + d

Risk in the exposed group is a / (a + b). Risk in the unexposed group is c / (c + d). Relative risk divides the first risk by the second. Two habits keep the work straight: write the denominator in words before dividing, and keep the counts beside the percentages so a reader can check the arithmetic.

This calculator takes the four raw counts rather than percentages, because percentages are already rounded. With counts of 40, 160, 20 and 180 the two risks are 0.20 and 0.10 and the ratio is 2.00. Percentages of 20 and 10 would give the same answer here, but a table reported as 33 percent and 67 percent has lost the counts that a confidence interval needs.

Worked example: potato salad at a company picnic

At a picnic, 200 people ate the potato salad and 200 did not. Forty of the people who ate it reported stomach trouble within 12 hours, and 20 of the people who skipped it did too. The counts go into the table in one pass.

GroupSickNot sickTotalRisk
Ate potato salad4016020040 / 200 = 0.20
Did not eat it2018020020 / 200 = 0.10
Total6034040060 / 400 = 0.15

Risk in the exposed group is 40 / 200 = 0.20, or 20 percent. Risk in the unexposed group is 20 / 200 = 0.10, or 10 percent. Relative risk is 0.20 / 0.10 = 2.00, so people who ate the salad were twice as likely to get sick.

The odds ratio uses the same four cells: 40 x 180 / (160 x 20) = 2.25. The two measures agree on the direction and disagree on the size, which is expected whenever the outcome is common enough to show up in 20 percent of a group.

A relative risk of 2.00 is not proof that the salad caused the illness. It is a signal that points at the salad, and an investigator still has to culture the leftovers, check the handling timeline and interview the people who did not get sick before calling it a foodborne outbreak.

Reading values above, below and at one

One is the fulcrum. A value above one means the exposed group had more of the outcome. A value below one means it had less. A value of exactly 1.00 means the two groups were the same at the precision reported, not that the exposure is harmless.

Values below one need careful wording. A relative risk of 0.20 after vaccination means the vaccinated group had one fifth the risk, which is the same statement as an 80 percent reduction. That reduction is relative. The absolute drop depends on how common the outcome was to begin with, so the same 0.20 can mean 16 cases prevented per 100 people or 2 cases prevented per 100,000.

Relative riskChange in riskSentence that matches
0.9010 percent lowerThe exposed group had 10 percent less risk.
0.7525 percent lowerRisk fell by a quarter.
0.5050 percent lowerRisk was halved.
0.2080 percent lowerRisk was one fifth as high.
1.2525 percent higherThe exposed group had a quarter more risk.
3.00200 percent higherRisk tripled.

Watch the difference between 200 percent higher and 200 percent of. A relative risk of 3.00 is three times the risk, which is an increase of 200 percent. Reports that write 300 percent higher when they mean three times as high overstate the change by a factor of two.

Relative risk and odds ratio diverge on common outcomes

The odds ratio divides the odds of the outcome in the exposed group by the odds in the unexposed group: a x d / (b x c). It is the only measure a case-control study can produce, because the researcher fixes how many cases and controls enter the study and the resulting risks are artifacts of that choice.

When the outcome is rare, the odds ratio sits close to the relative risk, which is why textbooks allow the shortcut. The gap grows as the outcome becomes more common. In the picnic table the relative risk is 2.00 and the odds ratio is 2.25, a 12.5 percent difference that comes entirely from the 20 percent baseline.

MeasureFormulaPicnic valueTypical use
Risk, exposeda / (a + b)0.20Describing one group
Risk, unexposedc / (c + d)0.10Describing the comparison group
Relative risk0.20 / 0.102.00Cohort studies, trials, outbreaks
Odds ratioa x d / (b x c)2.25Case-control studies
Risk difference0.20 - 0.100.10Public health impact, NNT

If a paper reports an odds ratio of 4.0 for a common outcome, the relative risk is smaller, often much smaller. Converting one to the other needs the baseline risk, and the worked example in this review of odds ratios shows how far apart the two can drift when the outcome is not rare.

Confidence intervals and statistical significance

A point estimate from one sample is not the whole story. A 95 percent confidence interval gives the range of values compatible with the observed counts, and for a ratio it is computed on the log scale so the interval stays symmetric after exponentiation.

The standard error of the log relative risk is the square root of 1 / a - 1 / (a + b) + 1 / c - 1 / (c + d). For the picnic table that sum is 1 / 40 - 1 / 200 + 1 / 20 - 1 / 200 = 0.065, so the standard error is 0.2550.

The log of 2.00 is 0.6931. The lower end of the interval is 0.6931 - 1.96 x 0.2550 = 0.1933 and the upper end is 0.6931 + 1.96 x 0.2550 = 1.1929. Exponentiating those two values gives 1.21 and 3.30, so the 95 percent interval runs from 1.21 to 3.30.

ExampleRelative risk95 percent intervalReading
Picnic potato salad2.001.21 to 3.30Higher risk, interval clears 1
Vaccine, 5 of 2,000 against 25 of 2,0000.200.08 to 0.52Lower risk, interval clears 1
Small sample, 3 of 20 against 2 of 201.500.28 to 8.0Too wide to call

The same log method is what statistical software prints. Epi Info's output for a cohort table in these San Jose State epidemiology notes reports a risk ratio of 4.99 with 95 percent limits of 1.55 to 16.03, and a hand calculation from the four counts lands on the same pair.

An interval entirely above 1 supports a real increase. An interval entirely below 1 supports a real decrease. An interval that contains 1 is compatible with no difference, which is not the same as proving there is none. The width matters too: a range of 1.21 to 3.30 rules out no effect but leaves the size open.

Absolute risk, risk difference and number needed to harm

Relative numbers travel well and hide the base rate. The risk difference keeps it. Subtracting one risk from the other in the picnic table gives 0.20 - 0.10 = 0.10, or 10 percentage points. Ten extra cases per 100 people is a different message from twice the risk, even though both come from the same four counts.

The reciprocal of the risk difference is the number needed to harm. Here 1 / 0.10 = 10, so about ten people have to eat the salad for one extra illness to appear. When the exposure helps instead of harms, the same arithmetic gives the number needed to treat. In the vaccine example the risk difference is 0.0125 - 0.0025 = 0.01, so 1 / 0.01 = 100 people need the vaccine for one case to be prevented.

MeasurePicnic tableVaccine table
Risk in the exposed group0.200.0025
Risk in the unexposed group0.100.0125
Relative risk2.000.20
Risk difference0.100.01
People per one extra or prevented case10100

Both tables describe a real effect and they lead to different decisions. A relative risk of 2.00 on a baseline of 1 case per 100,000 moves the exposed group to 2 cases per 100,000, an absolute change of 1 case per 100,000. That is a small change for an individual and a large one for a regulator looking at a whole population, and the risk difference is the number that keeps both views honest.

Mistakes that change the answer

Wrong denominator. Dividing cases by the whole sample instead of by the exposed total turns a risk into a share of everyone and shrinks the ratio. Write the denominator in words first: risk among the exposed, risk among the unexposed.

Odds ratio reported as relative risk. With the picnic numbers the gap is 2.25 against 2.00. With a 50 percent baseline the same data can produce an odds ratio near 3 while the relative risk stays at 2, and a headline built on the odds ratio overstates the effect.

Ignoring the baseline. Doubling a risk of 1 in a million is not a public health emergency. The relative figure is the same as doubling a risk of 1 in 10, and the consequences are not.

Reading a wide interval as a finding. A relative risk of 1.50 with an interval of 0.28 to 8.0 is consistent with a strong benefit, no effect and a strong harm. The point estimate alone invites a conclusion the data cannot support.

Confounding and healthy-worker effects. People who take a supplement may also exercise more, and people well enough to work are healthier than people who are not. A ratio computed from two groups that differ in age, smoking or income describes those differences as much as the exposure.

Case-control data pushed into a risk. When cases and controls are enrolled by design, the proportion with the exposure is set by the sampling, so a risk built from those counts is meaningless. Report the odds ratio and leave relative risk out of it.

Frequently asked questions

What is relative risk?

A ratio of two risks. Divide the share of the exposed group that had the outcome by the share of the unexposed group that had it. With 40 of 200 exposed and 20 of 200 unexposed, 0.20 / 0.10 = 2.00.

How do I calculate relative risk from a two by two table?

Label the cells a, b, c and d, where a and c are the cases in the exposed and unexposed groups. Compute a / (a + b) for the exposed risk and c / (c + d) for the unexposed risk, then divide the first by the second.

What does a relative risk of 1.00 mean?

The two groups had the same risk at the precision reported. It does not mean the exposure has no effect. A small study can produce a ratio near 1.00 with an interval that still includes a meaningful increase.

How do I read a relative risk of 0.75?

The exposed group had three quarters of the comparison risk, which is a 25 percent reduction. The absolute change depends on the baseline: 25 percent off a risk of 0.20 saves 0.05, while 25 percent off 0.0004 saves almost nothing.

What is a good confidence interval for relative risk?

One that does not cross 1 and is narrow enough to be useful. The picnic example gives 1.21 to 3.30, which rules out no effect but leaves the size of the effect uncertain. An interval of 0.90 to 1.10 says the data cannot settle the question.

Why is the odds ratio 2.25 when the relative risk is 2.00?

The odds ratio divides odds instead of risks, and odds run ahead of risks as the outcome gets more common. With a 20 percent baseline in the exposed group the two measures differ by about 12 percent. The gap shrinks toward zero as the outcome becomes rarer.

Can relative risk be negative?

No. Both risks are counts divided by totals, so both are zero or positive, and their ratio cannot go below zero. A value under 1 still describes a real reduction, and the smallest possible value is 0 when the exposed group has no cases.

What is the difference between relative risk and risk difference?

Relative risk divides one risk by the other and answers how many times as likely. Risk difference subtracts and answers how many extra cases per group of 100. In the picnic example the relative risk is 2.00 and the risk difference is 0.10, or 10 percentage points.

What is relative risk reduction?

One minus the relative risk, read as a percent. A relative risk of 0.20 is a reduction of 1 - 0.20 = 0.80, or 80 percent. It is the figure vaccine trials usually report, and it always needs the absolute numbers beside it.

How many events do I need for a stable relative risk?

A common rule of thumb is at least 5 events in each group. With 3 cases in one arm the interval is wide and unstable. The picnic table has 40 and 20 cases, which is comfortable. Counts of 2 and 1 produce an interval that spans an order of magnitude.

Is relative risk the same as a hazard ratio?

No. A hazard ratio compares event rates over time and accounts for when each event happened, while relative risk compares the share of each group that had the event by the end of the follow-up. The two are close when events are rare and follow-up is complete.

Can I use relative risk with case-control data?

No. In a case-control study the number of cases and controls is fixed by the researcher, so the risks in each exposure group are artifacts of the sampling plan. The odds ratio is the measure to report, and it approximates the relative risk only when the outcome is rare.

What happens when one cell of the table is zero?

The standard error formula divides by a and by c, so a zero cell breaks it. This calculator adds 0.5 to all four cells for the interval only, the Haldane-Anscombe correction, and says so in the result. The point estimate still uses your raw counts.

Is a relative risk of 2.00 a large effect?

Depends on the baseline. Doubling a risk of 0.0004 adds 4 cases per 10,000 people. Doubling a risk of 0.20 adds 2,000 cases per 10,000. The ratio is identical and the public health meaning is not, which is why both measures belong in a report.

Does this page give medical advice?

No. It performs the arithmetic of a risk ratio from the counts you enter. For a diagnosis, a treatment decision or an interpretation of your own lab results, talk to a clinician who can see your history.

Spotted a wrong number or a broken result?

More Everyday tools

See all Everyday tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.