CALCULATOR · SAMPLE SIZE & POWER
Sample Size Calculator for Survival Analysis Events and Participants for a Log-Rank or Cox Analysis
Sample size for survival analysis is calculated in two steps. Enter the hazard ratio you want to detect, the alpha and power, the allocation and the event probability in the control arm. The events required, then the participants, 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
Sample size for survival analysis starts with events, not participants. For a log-rank test or a Cox model, the precision of the hazard ratio is driven by the number of events observed, so the calculator first returns the events needed to detect your hazard ratio at the chosen alpha and power, and then converts that into the number of participants through the event probability. The participant number is a first estimate. The events needed do not change when accrual and follow-up do, which is why the events are the figure to defend.
How It Is Calculated
The default number of events is the Schoenfeld formula, which allows any allocation between the arms (Schoenfeld, 1983):
d = number of events · HR = hazard ratio under the alternative · p = proportion of participants allocated to the control group (default 0.5) · α = two-sided significance level · 1 − β = power · z(q) = the q quantile of the standard normal distribution.
The Freedman formula is shown as an alternative, for equal allocation only (Freedman, 1982):
The events are then converted to participants through the event probability in each arm, under proportional hazards:
Pc = event probability in the control arm over the study · Pt = event probability in the treatment arm · P = overall event probability. An optional dropout rate inflates the participant number.
Pc is the event probability over the whole study for a participant followed for the planned time. With staggered accrual, administrative censoring and loss to follow-up, the realized event probability is lower, so the participant number is a first estimate. A study with accrual is better planned with an accrual-and-follow-up model (Lachin & Foulkes, 1986) or by simulation. The number of events needed does not change.
Assumptions and When Not to Use It
- Proportional hazards. The hazard ratio is constant over follow-up. If the curves are expected to cross or converge, a single hazard ratio does not describe the effect.
- Non-informative censoring. Participants who leave the study are assumed to be no different in their risk from those who remain.
- Event probabilities refer to the planned follow-up. Pc is the probability of an event for a participant followed for the full planned time, not an annual rate.
- Freedman is for equal allocation. When the arms are unequal, rely on the Schoenfeld result.
- The events drive precision. A study with fewer events than needed loses power, however many participants it enrolled. See Sample Size for Survival Analysis and Cox Regression.
- Not a binary-outcome calculation. When the outcome is a proportion at a fixed time with no censoring, use the Sample Size Calculator for Research Studies.
Worked Example (Hypothetical Values)
A trial plans to detect a hazard ratio of 0.70 with 80% power at a two-sided alpha of 0.05, with equal allocation. The event probability in the control arm over the study is 0.50.
| Input or result | Value |
|---|---|
| Hazard ratio, HR | 0.70 |
| Alpha, two-sided | 0.05 |
| Power | 0.80 |
| Control allocation, p | 0.5 |
| Control event probability, Pc | 0.50 |
| Events, Schoenfeld | 247 |
| Events, Freedman | 253 |
| Treatment event probability, Pt | 0.3844 |
| Participants in total | 559 |
The study is planned around 247 events; the 559 participants are the number expected to produce them under the assumptions entered. Press “Load the worked example” under the calculator and these values fill the fields. HYPOTHETICAL VALUES.
What the Result Still Needs
- 1
A defensible hazard ratio. The smallest effect worth detecting, from the literature or a clinical argument, with its source.
- 2
A realistic event probability. The control-arm event probability over the planned follow-up, with a source, since the participant number depends on it.
- 3
Accrual and follow-up modeled. Staggered entry, administrative censoring and loss to follow-up lower the realized event probability.
- 4
The proportional hazards assumption considered. The design discusses whether a constant hazard ratio is plausible for the treatment.
- 5
A justification paragraph for the protocol. The events, the hazard ratio, the alpha, the power and the participant plan, written for the grant or ethics form.
A statistician checks the hazard ratio and the event probability against your sources, models accrual and follow-up for your design and returns the justification paragraph you can paste.
Research Planning & Study DesignIndependent Statistical Review confirms a sample size calculation prepared by you, a colleague or an AI tool before it goes to a committee.
Independent Statistical ReviewFrequently Asked Questions
Why does the calculator give events before participants?
The precision of a hazard ratio depends on the number of events, not on the number of people enrolled. The participant number follows from the events and the event probability. Plan and defend the events first.
Why is Schoenfeld the default and not Freedman?
The Schoenfeld formula handles any allocation between the arms through p, while the Freedman formula applies to equal allocation only. The two give similar events, 247 and 253 in the worked example. The Freedman result is shown for comparison.
Why is the participant number only a first estimate?
Because the event probability is the probability over the whole study for a participant followed for the planned time. With staggered accrual, administrative censoring and loss to follow-up, fewer events occur than that probability implies. The events needed do not change, but the participants do.
How is the event probability in the treatment arm obtained?
Under proportional hazards, it is 1 − (1 − Pc)^HR, where Pc is the event probability in the control arm. For the worked example, 0.50 becomes 0.3844. It is a consequence of the hazard ratio, not a separate input.
What does the control allocation p do?
It is the proportion of participants in the control arm, with a default of 0.5. A different value changes the events needed and the overall event probability. Equal allocation is the only case in which the Freedman formula applies.
References
- Freedman, L. S. (1982). Tables of the number of patients required in clinical trials using the logrank test. Statistics in Medicine, 1(2), 121-129. https://doi.org/10.1002/sim.4780010204
- Lachin, J. M., & Foulkes, M. A. (1986). Evaluation of sample size and power for analyses of survival with allowance for nonuniform patient entry, losses to follow-up, noncompliance, and stratification. Biometrics, 42(3), 507-519. https://doi.org/10.2307/2531201
- Schoenfeld, D. A. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics, 39(2), 499-503. https://doi.org/10.2307/2531021
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 Event and Sample Size Plan
Share the study aim, the outcome and the sources for your hazard ratio and event probability. 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