Home / Tools / Survival Power Calculator

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.

Effect and test
Study timeline (months)
Sample size

-

Control vs treatment, exponential survival under the alternative
Events (D)
-
Total n
-
Control n1
-
Treatment n2
-
Avg P(event)
-

How this is computed
1
2
3
4
The same calculation in R

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.

Events, not headcount

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.

solve events first
The hazard ratio

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.

detectable effect size
Accrual and follow-up

Longer follow-up turns each patient into an event more reliably, so fewer patients are needed. Short follow-up with slow disease wastes enrollment.

study calendar

Anatomy of a survival power calculation

The closed forms behind every number on this page, in the order the calculator applies them.

D = (z_1-a/2 + z_1-b)^2 * (1 + k)^2 / ( k * (log HR)^2 )
Schoenfeld events. Under proportional hazards the log-rank statistic is asymptotically normal with variance proportional to the number of events. Solving the standard normal power equation for events gives the closed form above. Nothing about the calendar enters here, just events, allocation, alpha and power. The log hazard ratio enters squared, so HR 0.95 (log HR = -0.05) needs roughly 100 times more events than HR 0.5 (log HR = -0.69).
lambda_C = log(2) / m_C (control hazard) lambda_T = HR * lambda_C (treatment hazard) S(t) = exp(-lambda * t) (exponential survival)
Translating median survival into hazard. Under exponential survival the hazard is constant and equals log(2) divided by the median. The treatment hazard is the control hazard scaled by HR. The Kaplan-Meier curves shown in the result are these two exponentials. Real survival is rarely exactly exponential, but for closed-form planning the assumption is the workhorse.
P(event) = 1 - (1 / (lambda * A)) * ( exp(-lambda*F) - exp(-lambda*(A+F)) )
Probability of an event during the study. A patient enrolled uniformly over an accrual window of length A, then followed for F more months after accrual closes, spends between F and A + F months on study. Integrating exponential survival over this uniform enrollment gives the formula above. Total sample size is the required events divided by the allocation-weighted average of the two arms' event probabilities.
mu = -log(1 - eta) / 12 (monthly dropout hazard) P(event) = (lambda / (lambda + mu)) * [ 1 - integral exp(-(lambda+mu) t) ]
Adjusting for dropout. An annual loss-to-follow-up rate becomes a competing exponential hazard. A patient can now leave by an event or by dropping out, so the cause-specific event probability carries the factor lambda/(lambda+mu); the same uniform-accrual integral has a closed form. Only events, not dropouts, count toward the log-rank, so dropout inflates the required sample size without changing the required events. A 10 percent annual loss can push n up by 15 to 25 percent. This runs whichever formula you pick; it is not a separate method.
D_Freedman = ( (1 + k*HR) / (1 - HR) )^2 * (z_1-a/2 + z_1-b)^2 / k
Freedman classical reference. Freedman (1982) used the ratio of expected event counts directly rather than the log-HR limit. It tracks Schoenfeld for moderate HR and grows visibly larger as HR approaches 1. Some regulatory templates still cite Freedman, so we expose it for cross-checks; for HR near 1 it can be quite different.

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 haveUse 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 risksWhen 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 trialClinics 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 designInterim 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 planningIf 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.

Go deeper