Opens in a new tab

CALCULATOR · CLINICAL RESEARCH

Relative Risk Calculator with Confidence Interval

Enter the events and non-events for the exposed or treated row and for the unexposed or control row. The risk ratio with its confidence interval and p-value, the risk in each row, the risk difference and a plain reading update as you type. Nothing you enter leaves your browser.

Runs in your browser. No data is sent or stored.

Method reviewed by an in-house statistician · Last checked November 2026

In Short

A relative risk calculator compares the risk of an outcome in an exposed or treated group with the risk in an unexposed or control group and returns their ratio with a confidence interval and a p-value. The risk ratio is the direct measure for cohort studies and trials. It says how many times larger or smaller the risk is, and nothing about the absolute size of the difference, which is why the calculator also reports the risk in each row and the risk difference with its interval.

How It Is Calculated

The risk ratio divides the risk in the first row by the risk in the second. Its interval is calculated on the log scale and transformed back (Woolf, 1955; Morris & Gardner, 1988):

FORMULA

RR = [ a / (a + b) ] / [ c / (c + d) ] SE(ln RR) = √(1/a − 1/(a + b) + 1/c − 1/(c + d))

a = exposed or treated with the event · b = exposed or treated without it · c = unexposed or control with the event · d = unexposed or control without it.

The interval and the two-sided p-value use the same standard error:

FORMULA

CI = exp( ln RR ± z · SE(ln RR) ) p from z = ln RR / SE(ln RR), two-sided

z in the interval = the standard normal quantile for the chosen confidence level (1.95996 for 95%). The p-value is the two-sided tail probability of the ratio ln RR / SE(ln RR). It is shown only beside the estimate and its interval, never alone.

The risk in each row and the risk difference are shown beside the ratio, with the Newcombe hybrid score interval for the difference (Newcombe, 1998b).

A zero cell does not affect every table in the same way. The risk ratio is infinite only when c is zero and a is above zero, it is zero when a is zero, and it remains finite when b or d is zero. The calculator reports the uncorrected status in words first, then shows a continuity-corrected estimate with 0.5 added to every cell, labeled as such. The correction is a convention, and exact or Bayesian methods may be preferable for sparse tables.

Assumptions and When Not to Use It

  • Independent groups, one table. Each participant appears once. Matched pairs, repeated measurements and clustered data need an analysis that respects that structure.
  • A cohort or trial question. The risk ratio requires risks, which come from following exposed and unexposed groups. A case-control design does not estimate risks; use the Odds Ratio Calculator with Confidence Interval.
  • A ratio hides the absolute difference. A halving of a rare risk and a halving of a common risk give the same ratio. Read the risk difference beside it, and see Number Needed to Treat: Calculation and Interpretation.
  • Unadjusted. The estimate comes from one table and adjusts for nothing.
  • Sparse tables. A zero in cell a or c can make the uncorrected ratio zero, infinite or undefined; a zero in b or d leaves it finite. The corrected value is a convention, not a better estimate.
  • Valid counts. Counts must be non-negative integers, and each row must contain at least one participant. Otherwise the calculator returns a message, not a number.

Worked Example (Hypothetical Values)

In a cohort of 200, 100 exposed and 100 unexposed participants are followed for the outcome. In the exposed row, 10 participants have the event and 90 do not. In the unexposed row, 20 have the event and 80 do not.

Input or result Value
Exposed row, a (event) and b (no event) 10 and 90
Unexposed row, c (event) and d (no event) 20 and 80
Risk ratio 0.500
95% confidence interval 0.247 to 1.014
p-value, two-sided, beside the estimate 0.055
Odds ratio from the same table 0.444 (0.196 to 1.006), p = 0.052

The interval includes 1, so the table is compatible with no difference in risk as well as with a large reduction. The odds ratio from the same table (0.444) lies farther from 1 than the risk ratio, which is why the two must not be swapped. Press “Load the worked example” under the calculator and these values fill the fields. HYPOTHETICAL VALUES.

What the Result Still Needs

  1. 1
    A design that supports risks. The groups were followed for the outcome over a comparable period, so that the risks are real quantities and not an artifact of sampling.
  2. 2
    The absolute risks reported. A relative measure is written together with the risk in each group and the risk difference, so the reader can judge the size of the effect.
  3. 3
    A stated reference group. The text says which row is exposed or treated, which is the comparator and what counts as the event.
  4. 4
    A decision on adjustment. A single table is unadjusted. If confounding is plausible, the estimate belongs in a model that handles it.
  5. 5
    The interval reported with the ratio. Write the risk ratio with its confidence interval, and avoid reading the p-value on its own.
Have the result reported correctly

A statistician checks the table against your design, chooses the measure and the comparator, and writes the results sentence for your manuscript or report.

Results Reporting & Interpretation
Already have a calculation?

Independent Statistical Review confirms an analysis prepared by you, a colleague or an AI tool before it goes to a committee or a journal.

Independent Statistical Review

Frequently Asked Questions

For a cohort study or a trial, report the risk ratio: it answers the risk question directly. The odds ratio is the measure for case-control designs and the output of logistic regression. When the outcome is common, the two differ, and one must not be read as the other.

Each measure has its own standard error on the log scale, so each gives its own test statistic. In the worked example the risk ratio has p = 0.055 and the odds ratio p = 0.052. Report the interval, which is the more informative result.

The risk in the first row is half the risk in the second. It does not say whether that is half of a common risk or half of a rare one, and the absolute consequence differs greatly between the two. Always report the absolute risks or the risk difference beside the ratio.

The calculator first states the uncorrected status in words: the ratio is infinite when c is zero with a above zero, zero when a is zero, and still finite when b or d is zero. It then shows a continuity-corrected estimate with 0.5 added to every cell. The correction is a convention, so for sparse tables consider exact or Bayesian methods.

Not without care. The calculator compares risks in two groups from a single table of independent participants, which presumes the outcome was observed over a comparable period in both rows. If follow-up differs markedly, a ratio of proportions is not the right summary.

References

  1. Altman, D. G., Machin, D., Bryant, T. N., & Gardner, M. J. (2000). Statistics with confidence: Confidence intervals and statistical guidelines (2nd ed.). BMJ Books.
  2. Morris, J. A., & Gardner, M. J. (1988). Calculating confidence intervals for relative risks (odds ratios) and standardised ratios and rates. British Medical Journal, 296(6632), 1313-1316. https://doi.org/10.1136/bmj.296.6632.1313
  3. Newcombe, R. G. (1998b). Interval estimation for the difference between independent proportions: Comparison of eleven methods. Statistics in Medicine, 17(8), 873-890. https://doi.org/10.1002/(SICI)1097-0258(19980430)17:8<873::AID-SIM779>3.0.CO;2-I
  4. Woolf, B. (1955). On estimating the relation between blood group and disease. Annals of Human Genetics, 19(4), 251-253. https://doi.org/10.1111/j.1469-1809.1955.tb01348.x
i

Method reviewed by an in-house statistician · Last checked November 2026 · Test cases and boundary cases verified before release

Found an error or have a suggestion? Write to info@onlinespss.com with the calculator name and the inputs you used. Every report is checked by a statistician.

Have a Statistician Confirm Your Risk Ratio and Its Interval

Share the study aim, the outcome and the table or the source of your numbers. A statistically trained Research Coordinator reviews the request, and the scope and one fixed project fee are confirmed before work begins.

No Commitment Required

Strictly Confidential

Fixed Project Fee

In-House PhD-Level Statisticians

Same-Day Response