Relative Risk Calculator
The relative risk and odds ratio from a 2 × 2 table of exposure and outcome, with confidence intervals, the risk in each group and the risk difference.
Result
Relative risk: 6.1083
Arithmetic on the table only. Whether exposure causes the outcome depends on how the study was designed, which a calculator cannot judge.
- Relative risk, lower limit
- 2.1976
- Relative risk, upper limit
- 16.9781
- Odds ratio
- 7.2171
- Odds ratio, lower limit
- 2.4625
- Odds ratio, upper limit
- 21.1518
- Risk in the exposed group
- 17.8344%
- Risk in the unexposed group
- 2.9197%
- Risk difference
- 14.9147%
https://calcgallery.com/statistics/relative-risk-calculator/
Results follow the mathematical operation and values shown. Check that you selected the intended operation, convention and dataset type before relying on the result. Read the full disclaimer
How to use the Relative Risk Calculator
- In the exposed group, enter how many people had the outcome and how many did not; do the same for the unexposed group.
- Choose a confidence level, 95% unless you need another.
- Read the relative risk and odds ratio with their confidence limits, and the risk in each group.
The formulas
outcome no outcomeexposed a bunexposed c drisk in exposed = a ÷ (a + b) risk in unexposed = c ÷ (c + d)relative risk = [a ÷ (a + b)] ÷ [c ÷ (c + d)]odds ratio = (a × d) ÷ (b × c)SE(ln RR) = √(1/a − 1/(a + b) + 1/c − 1/(c + d))SE(ln OR) = √(1/a + 1/b + 1/c + 1/d)limits = exp(ln ratio ± z × SE)
z is 1.96 for 95%, and comes from the normal distribution for any other level.
What the numbers do not say
A ratio above 1 shows that the outcome was more common among the exposed in this table. It does not show that the exposure caused it: confounding, the way people were chosen for the study and chance all bear on that, and the page cannot see any of them. Nor is it a personal risk. It is arithmetic on counts, for students and for checking a published table, not a tool for decisions about anyone’s health.
With your numbers
- Relative risk = (28 ÷ 157) ÷ (4 ÷ 137) = 6.1083
- Odds ratio = (28 × 133) ÷ (129 × 4) = 7.2171
Quick reference
Arithmetic on the table only. Whether exposure causes the outcome depends on how the study was designed, which a calculator cannot judge.
| Example | Relative risk |
|---|---|
| CDC tuberculosis: 28 of 157 against 4 of 137 | 6.1083 |
| CDC odds ratio example: 100, 1,900, 80, 7,920 | 5 |
| 6 of 22 against 112 of 841 | 2.0479 |
| 54 of 143 against 60 of 305 | 1.9196 |
| No difference: 10 of 100 in each | 1 |
| Lower risk when exposed: 5 of 100 against 20 of 100 | 0.25 |
Common questions about the Relative Risk Calculator
- What is relative risk?
- The risk of the outcome in the exposed group divided by the risk in the unexposed group. In the CDC's tuberculosis example, 28 of 157 inmates in one wing fell ill against 4 of 137 in the other: 17.8% against 2.9%, a relative risk of about 6.1. A relative risk of 1 means the same risk in both groups; below 1, a lower risk in the exposed group.
- How is the odds ratio different?
- It compares odds, people with the outcome per person without it, rather than risks: (a × d) ÷ (b × c). When the outcome is rare the two are close; when it is common the odds ratio is further from 1 than the relative risk. In a case-control study, where the investigator chose how many cases and controls to include, the risks are not meaningful and the odds ratio is the measure that can be estimated.
- How is the confidence interval worked out?
- On the log scale, where the ratio is close to normally distributed: the natural log of the ratio plus and minus z times its standard error, then turned back with the exponential. That is why the interval is not symmetric around the ratio. The standard errors are the ones Morris and Gardner give in Statistics with Confidence, and like any large-sample method they are rough when a cell is small.
- What if a cell is zero?
- A zero makes a logarithm or a division undefined, so the page leaves that ratio or limit blank and says why. Some analysts add 0.5 to every cell first; this page does not, because that changes the data. With counts that small, an exact method in statistical software is the better tool.