A relative risk calculator compares how likely an event is in an exposed group and in an unexposed group. Enter the four counts of the two-by-two table, and you get the risk in each group, the relative risk, the risk difference, the relative risk reduction, the number needed to treat, the odds ratio and a 95 percent confidence interval for the relative risk. It is used in medicine, epidemiology and any study that compares two groups. It runs in your browser.
How to use the relative risk calculator
- Enter the people with and without the event in the exposed group.
- Enter the people with and without the event in the unexposed group.
- Press Calculate.
The relative risk
The Wikipedia article on relative risk defines it as the ratio of the probability of the outcome in the exposed group to the probability in the unexposed group. With a events and b non-events among the exposed, and c events and d non-events among the unexposed, RR = [a ÷ (a + b)] ÷ [c ÷ (c + d)].[1] The page's first example has 4 events in 16 exposed people and 8 events in 16 unexposed people, so the relative risk is 0.5.[1] Its drug example compares 8.8 percent of people on the placebo with 1.7 percent on the drug, a relative risk of 0.19.[1]
Reading the value
A relative risk of 1 means that the risk is the same in both groups. A value below 1 means that the exposure goes with a lower risk, a protective factor, and above 1 a higher risk, a risk factor, always assuming that the link is causal. The page warns that correlation does not imply causation, and that you should report absolute measures alongside the relative one.[1] A relative risk of 2 sounds large, but it may be a rise from 1 in a million to 2 in a million, so the absolute risk matters.
Risk reduction and the number needed to treat
The page defines the absolute risk reduction as the control event rate minus the experimental event rate, the number needed to treat as 1 divided by it, and the relative risk reduction as that difference divided by the control event rate, or 1 − RR.[1] Its table has 15 events among 150 people who had the treatment, a risk of 0.1, and 100 events among 250 controls, a risk of 0.4. The results are an absolute risk reduction of 0.3, or 30 percent, a number needed to treat of 3.33, a relative risk of 0.25, a relative risk reduction of 0.75 and an odds ratio of 0.167.[1] Enter 15, 135, 100 and 150 to see these. If the exposure raises the risk, the calculator calls the number the number needed to harm.
The odds ratio
The odds ratio is (a × d) ÷ (b × c), the ratio of the odds in the two groups.[1] The article on the odds ratio gives a village example: 20 people with the disease and 380 without among the exposed, and 6 with and 594 without among the unexposed. The relative risk is 5 and the odds ratio is about 5.2.[2] They are close because the disease is rare. When the outcome is common, the two drift apart: in the page's ship example, the odds ratio is 9.99 and the relative risk is 2.5.[2] The odds ratio is the measure used in case-control studies, where a relative risk cannot be worked out.
The confidence interval
The page gives the standard error of the logarithm of the relative risk as the square root of b ÷ (a(a + b)) + d ÷ (c(c + d)), which is the same as 1 ÷ a − 1 ÷ (a + b) + 1 ÷ c − 1 ÷ (c + d). The interval is the logarithm of RR plus or minus the standard error times the standard score for the chosen level, and then exponentiated.[1] The article on the odds ratio uses 1.96 for a 95 percent interval.[2] For the village, the standard error is 0.461, and the interval for the relative risk of 5 is from 2.03 to 12.3, which excludes 1, so the link is unlikely to be due to chance. The interval cannot be found when a count of events is zero.
Which table layout
The calculator uses the layout where the rows are the exposed and the unexposed people and the columns are those with and without the event. The article's own tables put the intervention and the control in the columns and the events in the rows, so check which way round your table is. The answers are the same if you put the right counts in the right boxes.
An example of the difference
Suppose that a rare side effect occurs in 2 of 10,000 people who do not take a drug and in 6 of 10,000 who do. The relative risk is 3, which sounds alarming. The risk difference is 4 in 10,000, or 0.04 percentage points, and the number needed to harm is 2,500: one extra case for every 2,500 people treated. Both are true, and a fair report gives both. Enter 6, 9994, 2 and 9998 to see all the measures together.
Common mistakes
- Swapping the groups. The relative risk then becomes its reciprocal.
- Using it for case-control data. Use the odds ratio.
- Ignoring the absolute risk. A large relative risk may be a tiny absolute change.
- Entering percentages. Use counts of people.
What next
Use this often? Add Relative Ris to your Home screen.
Frequently asked questions
What is a relative risk calculator?
A tool that compares the risk of an event in an exposed group and an unexposed group, with the relative risk and related measures.
What is the relative risk formula?
RR = [a ÷ (a + b)] ÷ [c ÷ (c + d)], the risk in the exposed group divided by the risk in the unexposed group.
What is the number needed to treat?
1 divided by the absolute risk reduction. A reduction of 0.3 gives 3.33 people.
What is the difference between relative risk and odds ratio?
The odds ratio is (a × d) ÷ (b × c). It is close to the relative risk for rare events and larger for common ones.
What does a relative risk of 1 mean?
The risk is the same in both groups.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.