Survival Analysis Power Calculator
Survival studies measure the time to an event: death, relapse, churn. Power depends on the hazard ratio you want to detect, the accrual and follow-up windows, and any dropout. Set your design and get the required events, sample size, or achievable power via Schoenfeld or Freedman, with a Kaplan-Meier preview of the assumed curves. Everything runs in your browser.
iPlanning a time-to-event trial? Read the 4-minute primer
What survival power answers. A survival power calculation tells you how many subjects to enroll, and how many events (deaths, relapses, failures) to observe, before the log-rank test has a fair chance of detecting the hazard ratio you care about. Power is the probability the trial flags the difference if it is real; events, not patient counts, are the currency.
Hazard ratio intuition. The hazard ratio (HR) compares the instantaneous risk in the treatment arm versus control. HR = 0.7 means treatment cuts the hazard by 30 percent at every moment; HR = 1 is no effect; HR = 0.5 is a strong halving of risk. Smaller deviations from 1 need dramatically more events: halve the log HR and you roughly quadruple the events required.
Events versus sample size. Schoenfeld's formula gives the required total events directly, with no patient count attached. To turn events into a patient count, divide by the probability that a typical patient has an event during the study window. That probability depends on the median survival, the accrual schedule, the follow-up length, and any losses. Long follow-up converts patients into events efficiently; short follow-up wastes them.
Picking accrual and follow-up. Two clocks run together: accrual (how long you spend recruiting) and follow-up (how long after the last enrollment you keep watching). Patients enrolled late see less follow-up, so they contribute fewer events. If recruitment is slow but the disease is fast, accrual length dominates; if the disease is slow, you need a long minimum follow-up after enrollment closes.
-
How this is computed
✓ No data leaves your browser
✓ Verified against R's qnorm() / pnorm() and integrate()
✓ Free, no sign-up
Events drive power, not patients
A survival trial is powered by how many events it accumulates, not how many people it enrolls. Three quantities set the plan.
The log-rank test's precision depends on observed events. Fix the effect and power and the required events are locked in; enrollment is whatever it takes to reach them.
Smaller effects (HR near 1) need far more events. Because the log HR enters squared, HR 0.9 needs roughly ten times the events of HR 0.7.
Longer follow-up turns each patient into an event more reliably, so fewer patients are needed. Short follow-up with slow disease wastes enrollment.
Anatomy of a survival power calculation
The closed forms behind every number on this page, in the order the calculator applies them.
When this is the wrong tool
The closed forms above assume a single-look, proportional-hazards, independently-randomized trial. If your design breaks those assumptions, reach for the alternative.
| If you have | Use instead |
|---|---|
| Non-proportional hazards (crossing curves, delayed effect) | The log-rank test loses power when the HR drifts. Use a weighted log-rank (Fleming-Harrington) or a milestone-survival comparison, and simulate under the assumed crossing curves. |
| Competing risks | When a patient can experience an event that censors the primary endpoint, the cause-specific hazard differs from the subdistribution hazard. Use a Fine-Gray planning calculation or simulation against the cumulative incidence function. |
| Cluster-randomized survival trial | Clinics or wards randomized as units violate independence. Inflate by the design effect or use the Donner-Klar cluster-survival formulas; the variance of the log-rank statistic must include the intracluster correlation. |
| Group-sequential or adaptive design | Interim analyses with stopping rules require alpha-spending (O'Brien-Fleming, Pocock) and an inflated maximum-information target. Use gsDesign::nSurv() or East; a single-look closed form will under-size the trial. |
| Bayesian or simulation-based planning | If the prior on the hazard ratio is informative, an assurance or expected-power approach fits better. Simulation against the Cox model with realistic censoring is the safest catch-all when assumptions get messy. |
Numerical methods: Schoenfeld (1981) closed form for events, Freedman (1982) for the alternative reference, exponential survival with uniform accrual and competing dropout integrated in closed form. The normal quantile and CDF match R's qnorm / pnorm; the event-probability integrals were cross-checked against R's integrate() to machine precision (1,182 cases). A full Lakatos (1988) Markov computation for non-proportional or piecewise settings is out of scope for a closed-form planner; use gsDesign::nSurv() or simulation for that.
Frequently asked questions
How do I calculate sample size for a survival analysis?
Sample size depends on the number of EVENTS, not subjects. The calculator first solves for required events using the log-rank formula given hazard ratio and power, then divides by the expected event rate over the study period to get total enrollment. Schoenfeld's formula is the standard.
What is the log-rank test and when is it appropriate?
The log-rank test compares two or more survival curves under the proportional hazards assumption. Use it as the primary analysis in randomized trials with time-to-event endpoints. If hazards cross or the proportional assumption fails, switch to a weighted log-rank, restricted mean survival time, or accelerated failure time model.
How do I interpret a hazard ratio?
A hazard ratio of 0.7 means the instantaneous risk in the treatment group is 30% lower than in the control group at any time point, assuming proportional hazards. HR is not the same as risk ratio, it compounds over time. For a 5-year trial with HR = 0.7, the absolute survival difference depends on the baseline hazard.