This calculator is for general information and education. It is not medical advice and does not replace the advice of your doctor or a registered dietitian.
Survival analysis asks how long until an event such as death, relapse or failure. The median survival calculator takes the events and the person-years at risk of two groups and gives the hazard rates, the median survival, the survival at a chosen time, and the hazard ratio with its 95 % confidence interval, under a constant-hazard model.
How the calculation works
- The hazard rate is the number of events divided by the person-years at risk: λ = events ÷ person-years. Multiply by 100 for a rate per 100 person-years.
- With a constant hazard (an exponential model), the median survival is ln 2 ÷ λ, and the survival at time t is e^(−λ × t).
- The hazard ratio is λA ÷ λB. A value above 1 means a higher hazard in group A.
- Its 95 % confidence interval is the ratio multiplied or divided by e^(1.96 × √(1 ÷ events A + 1 ÷ events B)).
Example
Group A has 30 events in 120 person-years and group B has 18 events in 130 person-years. The hazard rates are 25.0 and 13.85 per 100 person-years. The median survival is 2.77 years in A and 5.01 years in B, and the survival at 2 years is 60.7 % against 75.8 %. The hazard ratio is 1.81, with a 95 % interval of 1.01 to 3.24, so the higher hazard in A is just significant.
Why it matters
Two groups followed for different times cannot be compared by counting events alone. Rates per person-year, median survival and the hazard ratio put them on an equal footing and give the measures that clinical papers report.
Good to know
The exponential model assumes the hazard stays constant over time and that follow-up is complete or censored without bias. Real survival curves often bend, and then the median from the model differs from the Kaplan-Meier median. The confidence interval for the ratio is based on the number of events, so a small number of events gives a wide interval.
Related tools
The incidence rate ratio calculator compares rates with a p-value, and the exponential distribution calculator gives the probabilities behind the constant hazard.