Relative Risk Test Calculator

Compare exposure groups with clear statistical insight instantly. See risks, ratios, intervals, and significance clearly. Use flexible inputs, exports, examples, formulas, and charts easily.

Enter 2×2 Table Values

Use event counts for exposed and unexposed groups. The calculator supports zero-cell correction, confidence selection, export options, and an automatic chart.

Example Data Table

This sample compares event occurrence between two groups. You can load it directly into the calculator.

Group Event No Event Total Risk
Exposed Group 18 82 100 18.00%
Unexposed Group 36 64 100 36.00%
Relative Risk = 0.5000, 95% CI ≈ [0.3052, 0.8189], p ≈ 0.0059

Formula Used

Let: a = exposed with event, b = exposed without event, c = unexposed with event, d = unexposed without event.

Risk in exposed group
Risk₁ = a / (a + b)
Risk in unexposed group
Risk₂ = c / (c + d)
Relative risk
RR = Risk₁ / Risk₂
Standard error of log(RR)
SE[ln(RR)] = √[(1/a) - (1/(a+b)) + (1/c) - (1/(c+d))]
Z test statistic
z = ln(RR) / SE[ln(RR)]
Confidence interval
CI = exp( ln(RR) ± z* × SE[ln(RR)] )

If any cell equals zero and correction is enabled, the calculator adds 0.5 to all four cells before inferential testing.

How to Use This Calculator

  1. Enter the four counts from your 2×2 contingency table.
  2. Rename groups or the event if you want customized output labels.
  3. Select a confidence level and decimal precision.
  4. Keep zero-cell correction enabled when any cell contains zero.
  5. Click the calculate button to display results above the form.
  6. Review relative risk, interval estimates, p value, and chart.
  7. Download the results as CSV or PDF when needed.

Frequently Asked Questions

1. What does relative risk measure?

Relative risk compares the event probability in one group against another. It shows whether the event is more likely, less likely, or similarly likely in the exposed group.

2. What does a value above 1 mean?

A relative risk above 1 means the event is more common in the exposed group. Larger values indicate stronger association in the harmful direction.

3. What does a value below 1 mean?

A value below 1 means the event is less common in the exposed group. That often suggests a protective association or lower event probability.

4. Why is the confidence interval important?

The confidence interval shows estimation uncertainty. Narrow intervals indicate more precision, while intervals crossing 1 suggest the relative risk may not differ meaningfully from no association.

5. Why can zero cells cause problems?

Zero cells make logarithmic formulas unstable because division by zero or infinite estimates can occur. The optional 0.5 correction helps create usable inferential statistics.

6. What does the p value test here?

The p value tests the null hypothesis that relative risk equals 1. Smaller values indicate stronger evidence that the groups differ in event probability.

7. Is relative risk the same as odds ratio?

No. Relative risk compares probabilities, while odds ratio compares odds. They may look similar for rare events, but they are not identical measures.

8. When should I use this calculator?

Use it whenever you have a 2×2 table and want to compare event frequency between two groups, such as treatment versus control or exposed versus unexposed data.

Related Calculators

proportion z testone sample proportion testeta squared calculatorvariance ratio f testproportion difference testvariance equality testequivalence test calculatorscheffe test calculatorcramers v calculatorslope significance test

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.