Hazard Ratio Calculator

Calculate hazard ratio and 95% confidence interval from events and person-time for two groups.
Includes p-value and interpretation for survival analysis.

Hazard Ratio (HR)

Hazard Ratio (HR)

The hazard ratio compares the rate of an event (death, relapse, failure) between two groups over time. It is the primary effect measure in survival analysis and clinical trials.

Formula

HR = (d₁ / T₁) / (d₂ / T₂)

Where:

  • d₁, d₂ = number of events in Group 1 and Group 2
  • T₁, T₂ = total person-time at risk in each group

This is equivalent to the ratio of two incidence rates.

Confidence Interval

95% CI = exp(ln(HR) ± 1.96 × SE)

SE = √(1/d₁ + 1/d₂)

A 95% CI that does not include 1.0 indicates statistical significance at p < 0.05.

Interpreting the Hazard Ratio

HR Meaning
HR = 1 No difference between groups
HR < 1 Group 1 has lower hazard (protective effect)
HR > 1 Group 1 has higher hazard (increased risk)
HR = 0.5 Group 1 has 50% lower event rate
HR = 2.0 Group 1 has twice the event rate

P-value

The p-value is calculated from the z-score: z = ln(HR) / SE Under the null hypothesis (HR = 1), z follows a standard normal distribution.

Common Applications

Clinical trials: drug vs. placebo survival curves. Epidemiology: exposed vs. unexposed cohort studies. Reliability engineering: failure rates between component designs.

Person-Time

Person-time accounts for participants who leave the study early. 100 participants followed for 2 years each = 200 person-years of observation.

The assumption underneath it all. A single hazard ratio only means something if the ratio stays roughly constant over the follow-up period. That is the proportional-hazards assumption, and it fails more often than reported. A surgical treatment can carry high early risk and lower risk later, so its hazard ratio starts above 1 and ends below it. Average those into one number and you get something near 1 that describes neither phase. If your survival curves cross, a single HR is the wrong summary and no confidence interval will tell you so.

Ratio versus difference. A hazard ratio of 0.5 sounds identical whether it halves a risk of one in ten or one in a million, and those are very different findings. This is why the calculator prints the underlying rates and their difference next to the ratio: the ratio tells you the relative effect, and only the difference tells you whether it is worth anything. Drug marketing has a long history of quoting the first and omitting the second.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.