Free Relative Risk Calculator
Exposed Group
Control Group
Enter cohort data to calculate relative risk
Epidemiological studies often aim to compare the likelihood of an outcome between two groups—one exposed to a certain factor and another that serves as a reference. This relative risk calculator (also known as a risk ratio calculator) is designed for that purpose: it computes the risk ratio quickly and also determines the associated confidence interval. Researchers, healthcare professionals, and biostatisticians working with cohort studies frequently rely on this type of tool to evaluate the strength of an association.
What Is Relative Risk?
Relative risk, or the risk ratio, is a metric that contrasts the probability (risk) of an event occurring in an exposed population with the probability of the same event in an unexposed (or control) group. In epidemiological terms, if the event is a disease, the relative risk quantifies how many times more (or less) likely the exposed group is to develop that disease compared with the control group.
A classic example: suppose researchers hypothesize that consuming more than two alcoholic drinks daily increases the risk of liver failure. They enroll 100 people in the exposed group (heavy drinkers) and 100 in the control group (people who keep to two drinks or fewer). The study finds that 8 heavy drinkers develop liver failure, whereas only 1 control participant does. The resulting relative risk would be 8—meaning heavy drinkers face an eight‑fold risk of liver failure.
Relative Risk Formula
The calculation relies on a simple contingency table:
- = number of exposed individuals who developed the disease;
- = number of exposed individuals who did not develop the disease;
- = number of control individuals who developed the disease;
- = number of control individuals who did not develop the disease.
The relative risk formula is:
or equivalently:
Plugging the numbers from the liver‑failure example gives:
Thus the exposed group is eight times as likely to experience liver failure.
Interpreting the Risk Ratio
The value of the RR directly informs the direction of the association:
- RR = 1: No difference in risk between the groups. In the example, this would suggest alcohol intake has no effect on liver failure.
- RR < 1: The exposed group has a lower risk than the control group—a protective effect.
- RR > 1: The exposed group has a higher risk, indicating a positive association, as in the alcohol example.
The strength of the association increases as the RR moves further away from 1.
Confidence Interval for Relative Risk
A single estimate of RR is rarely sufficient; we also need a confidence interval (CI) to assess the precision of the estimate. The 95% CI, for instance, contains the true relative risk with 95% confidence.
The bounds are computed using the natural logarithm of the RR and the Z‑score for the desired confidence level ():
Common confidence levels and their corresponding values are:
| Confidence level | |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.576 |
Applying the 95% Z‑score to the alcohol example (a=8, b=92, c=1, d=99, RR=8) yields a 95% CI from approximately 1.02 to 62.7. This wide interval warns that the true relative risk could be much lower or higher than 8—the result is statistically significant because the CI does not include 1, but it is far from precise.
The Impact of Sample Size
The width of the confidence interval depends heavily on the sample size. Suppose we repeated the study with groups of 1000 individuals each, keeping the same proportions (80 events in the exposed group, 10 in the control group). The RR remains 8, but the 95% CI narrows to about 4.17–15.34. This demonstrates that larger samples shrink the confidence interval, providing a more reliable estimate.
The relative risk calculator presented here handles both the RR computation and the CI calculation instantly, allowing you to experiment with different numbers and confidence levels. It is an essential tool for any cohort study analysis and for making evidence‑based decisions in epidemiology and public health.
FAQ
1. How is relative risk calculated?
Relative risk (RR) is computed using the formula RR = (a/(a+b))/(c/(c+d)), where a is exposed individuals who develop the outcome, b is exposed who do not, c is control who develop, and d is control who do not.
2. What does a relative risk of 8 mean?
It means the exposed group (e.g., heavy drinkers) has 8 times the risk of developing the outcome (e.g., liver failure) compared with the control group.
3. How do you interpret the confidence interval for relative risk?
The CI indicates a range where the true RR likely falls. If the CI excludes 1, the result is statistically significant. For example, a 95% CI of 1.02–62.7 is significant but very wide, indicating low precision.
4. Why does a larger sample size narrow the confidence interval?
With more subjects, the standard error of the log‑RR decreases, which tightens the CI around the point estimate, providing a more precise estimate of the true relative risk.
5. What Z‑scores are used for common confidence levels?
For 90% confidence use Z=1.645, for 95% use Z=1.960, and for 99% use Z=2.576. These values come from the standard normal distribution.
How to Use
- Enter the number of individuals with and without the disease in the exposed group, and the same for the control group.
- Select the desired confidence level (90%, 95%, or 99%) for the confidence interval.
- View the relative risk, confidence interval bounds, group risk rates, and an automatic interpretation of the results.