Relative Risk Calculator - Risk Ratio for Cohort Studies

Compute relative risk (risk ratio), 95% confidence interval, and attributable risk from a 2×2 contingency table for exposed and unexposed groups.

Enter the four cell counts (a, b, c, d) of your cohort study contingency table to instantly calculate the risk ratio and its confidence interval.

Relative Risk Calculator - Risk Ratio for Cohort Studies
Compute relative risk (risk ratio), 95% confidence interval, and attributable risk from a 2×2 contingency table for exposed and unexposed groups.

Enter the four cell values from your 2×2 contingency table: a = exposed with outcome, b = exposed without outcome, c = unexposed with outcome, d = unexposed without outcome.

Exposed Group

Unexposed Group

About the Relative Risk Calculator

Relative Risk (RR), also called the Risk Ratio, is a measure of association used in cohort studies and randomised controlled trials. It answers the question: how many times more likely is an exposed group to develop the outcome than an unexposed group? An RR of 1.0 means the two groups have identical risk; an RR greater than 1.0 indicates that exposure is associated with increased risk; an RR less than 1.0 indicates that exposure is protective. The calculation is built on a 2×2 contingency table that cross-classifies exposure status (yes/no) and outcome status (yes/no). The four cells are conventionally labelled a (exposed, outcome present), b (exposed, outcome absent), c (unexposed, outcome present), and d (unexposed, outcome absent). The risk in the exposed group is a/(a+b) and the risk in the unexposed group is c/(c+d). Relative Risk is simply the ratio of these two incidence proportions. The 95% confidence interval (CI) for the RR quantifies the uncertainty of the estimate caused by sampling variability. The standard method uses the log-normal approximation: compute the standard error of the log-RR as √(b/(a·nE) + d/(c·nU)), then exponentiate the interval [ln(RR) ± 1.96 × SE]. If the 95% CI does not include 1.0, the association is statistically significant at the α = 0.05 level. A narrow CI indicates a precise estimate; a wide CI indicates substantial uncertainty, typically due to a small sample size. Attributable risk (also called Risk Difference or Absolute Risk Increase/Reduction) is the arithmetic difference between the two incidence proportions: AR = riskExposed − riskUnexposed. Unlike the relative risk, which is a ratio, attributable risk expresses the excess risk in absolute terms. An RR of 3.0 sounds dramatic, but if the baseline risk is 0.1%, an AR of 0.2% may be clinically trivial. Conversely, an AR of 10 percentage points is clinically important regardless of the RR. Both measures are needed to fully interpret an epidemiological association. Relative risk is appropriate for cohort studies and clinical trials where the incidence of the outcome can be directly measured in both the exposed and unexposed groups over a defined follow-up period. It is not appropriate for case-control studies, where participants are selected based on outcome status, not exposure status — in that design the Odds Ratio is used instead. A key practical difference: when the outcome is rare (incidence < 10%), the Odds Ratio numerically approximates the Relative Risk, so the two measures can be compared across study designs. When the outcome is common, they diverge and cannot be used interchangeably. In clinical medicine, RR is used to evaluate the effectiveness of treatments, vaccines, and preventive interventions. A vaccine that reduces infection risk from 4% to 1% has an RR of 0.25 — meaning vaccinated individuals are 75% less likely to be infected. In occupational health, RR quantifies how much more likely workers exposed to a chemical or physical hazard are to develop a specific disease than unexposed workers. In nutritional epidemiology, RR links dietary patterns and lifestyle factors to disease outcomes in large prospective cohorts.

Relative risk examples

Classic epidemiological scenarios showing how to set up the contingency table and interpret the resulting risk ratio.

Contingency TableKey MetricsInterpretation
Smoking/lung cancer: a=70, b=6930, c=3, d=2997RR = 10.0; Risk exposed ≈ 1.0%, Risk unexposed ≈ 0.1%Smokers are exactly 10 times more likely to develop lung cancer than non-smokers over 20 years. The attributable risk is ~0.9 percentage points.
Flu vaccine trial: a=25, b=4975, c=80, d=4920RR ≈ 0.3125; Risk vaccinated ≈ 0.5%, Risk placebo ≈ 1.6%Vaccinated individuals are about 69% less likely to get the flu. RR of 0.31 is well below 1.0, confirming a strong protective effect.
High-fat diet: a=150, b=1850, c=100, d=2900RR = 2.25; Risk exposed ≈ 7.5%, Risk unexposed ≈ 3.3%People on a high-fat diet are 2.25 times more likely to develop heart disease. The attributable risk is ~4.2 percentage points.
Drug side effect: a=60, b=940, c=20, d=980RR = 3.0; Risk drug ≈ 6%, Risk placebo ≈ 2%Patients on the drug are exactly 3 times more likely to experience nausea. The 95% CI should be checked to assess statistical significance.

How to use the Relative Risk Calculator

  1. Identify the four cell counts from your 2×2 contingency table: a = number of exposed individuals who developed the outcome; b = exposed who did not; c = unexposed who developed the outcome; d = unexposed who did not.
  2. Enter a and b in the Exposed Group fields, and c and d in the Unexposed Group fields.
  3. Click Calculate. The tool returns the risk in each group, the relative risk, the 95% confidence interval, and the attributable risk.
  4. Interpret the relative risk: RR > 1 means exposure is associated with increased risk; RR < 1 means exposure is protective; RR = 1 means no association.
  5. Check whether the 95% CI includes 1.0: if it does not, the association is statistically significant at the 5% level. A narrow CI indicates a more precise estimate.

Relative Risk FAQ

What is relative risk and how does it differ from odds ratio?
Relative risk (RR) is the ratio of the incidence of the outcome in the exposed group to the incidence in the unexposed group. Odds ratio (OR) is the ratio of the odds of the outcome in each group. Both measure association, but RR is more intuitive and directly interpretable as a risk multiplier. OR is used in case-control studies where incidence cannot be measured; for rare outcomes (<10%), OR ≈ RR. For common outcomes, OR overestimates RR.
Can relative risk be less than 1? What does that mean?
Yes. An RR less than 1.0 means that the exposed group has a lower risk of the outcome than the unexposed group — in other words, exposure is protective. For example, a vaccine trial might find RR = 0.25, meaning vaccinated participants are 75% less likely to develop the disease. The reduction in risk (1 − RR) is sometimes called the Relative Risk Reduction (RRR).
How do I interpret the 95% confidence interval?
The 95% CI gives a range of plausible values for the true population RR based on your sample. If you repeated the study many times, about 95% of the resulting CIs would contain the true RR. Practically: if the CI excludes 1.0 (e.g. 1.5–3.2), the association is statistically significant at α = 0.05. A CI that includes 1.0 (e.g. 0.8–2.5) is not statistically significant.
What is attributable risk and when is it useful?
Attributable risk (AR) is the absolute difference in risk between exposed and unexposed groups: AR = riskExposed − riskUnexposed. It tells you how many extra cases per person are caused by the exposure. AR is most useful for public-health decision-making because it quantifies the potential benefit of eliminating the exposure. A high RR with a very low baseline risk (low AR) may justify less urgent intervention than a moderate RR with a high baseline risk (high AR).
Why does the calculator require the unexposed outcome-positive count (c) to be non-zero?
Relative risk is defined as the ratio of two incidence rates. If c = 0, the unexposed incidence is zero and the denominator is undefined, making RR undefined. In practice, a c of zero usually means either the unexposed group is protected from the outcome entirely (a very unusual finding) or the sample is too small to observe any events in the unexposed group. In both cases, a different analysis (such as exact methods) is needed.
Is relative risk valid for case-control studies?
No. Relative risk requires the incidence of the outcome in each group, which can only be measured when the study enrols participants based on exposure status (cohort design) or randomly assigns them (RCT). In a case-control study, participants are selected based on outcome status, so the incidence proportion cannot be calculated from the sample. Use the odds ratio for case-control studies instead, and note that it approximates the RR when the outcome is rare.