Sample size for survival analysis
Why survival studies are sized in events, the Schoenfeld formula with a worked example, how events become patients, and what changes the number.
In a study with a time-to-event outcome the power to detect a difference between two groups depends, to a good approximation and under proportional hazards, on the number of events rather than on the number of patients. A hundred patients followed until 80 have had the event carry far more information than a thousand followed until 10 have. So the sample size is worked out in two steps: first the number of events needed, then the number of patients needed to expect that many events within the planned recruitment and follow-up.
Step 1: the number of events
For a two-group comparison with the log-rank test or a Cox model, under proportional hazards, the number of events needed is approximately given by a formula of Schoenfeld (1983). With a fraction of patients in one group and in the other, a two-sided test at level , power and a true hazard ratio HR, the total number of events is With equal groups, and . The formula is an approximation: it assumes proportional hazards and that the two groups stay roughly in their allocation ratio among those still at risk.
For a two-sided 5% test, , and the power of 80% or 90% adds or . To detect a hazard ratio of 0.7 with 90% power, , so 331 events are needed; with 80% power, 247. The alternative of Freedman (1982) gives a little more, 338 events with 90% power and 253 with 80%, which is 2% more at a hazard ratio of 0.7. The figures below use unrounded z-values. The number needed rises steeply as the hazard ratio approaches 1:
- Hazard ratio 0.5: 66 events with 80% power, 88 with 90%.
- 0.6: 121 and 162.
- 0.7: 247 and 331.
- 0.8: 631 and 845.
- 0.9: 2,829 and 3,787.
A hazard ratio of 0.8 needs about 2.6 times the events of 0.7. The hazard ratio that goes into the formula should be the smallest effect that would matter clinically, or a realistic one, not the estimate from a small pilot study, which can be too optimistic.
Step 2: from events to patients
The number of patients is the number of events divided by the probability that a patient has an event during the study, averaged over the groups. Suppose 50% of controls are expected to be alive at three years and the hazard ratio is 0.7. Survival in the treated group is then , because under proportional hazards the treated group's survival is the control group's survival raised to the power of the hazard ratio (treated against control). The probabilities of an event by three years are 0.500 and 0.384, an average of 0.442 with equal groups. If every patient is followed for three years and nobody is lost, 331 events need , so 749 patients, about 375 per group (our calculator, which does not round the events up first, gives 748). As a check of the arithmetic, 749 patients give 331 expected events and 90% power.
In practice recruitment takes time, so patients recruited late are followed for less than three years, and some patients are lost to follow-up. Both lower the probability of an event per patient and raise the number to recruit. Lachin and Foulkes (1986) give the calculation for staggered entry, loss to follow-up and a given follow-up period, and our sample size and power calculator does the same job under exponential survival, with uniform recruitment and exponential loss to follow-up, by dividing the required events by the expected event probability.
What changes the number
- The hazard ratio. The events needed depend on , as above.
- Unequal groups. By the Schoenfeld formula, randomising 2 to 1 needs 12.5% more events than 1 to 1, 372 rather than 331 in the example, because falls from 0.25 to 0.22.
- The level and power. A smaller level needs more events, and so does higher power. A one-sided test at the same level needs fewer.
- Competing events and dropout. They reduce the number of events of interest per patient, so more patients are needed to reach the same number.
- Non-proportional hazards. If the effect is delayed or wanes, the log-rank test can have less power than the formula suggests. Royston and Parmar (2016) augment the log-rank test for such cases, and the difference in restricted mean survival time is an alternative that does not rely on proportional hazards (Royston and Parmar, 2013; RMST or a hazard ratio?).
What to state in a protocol
- The hazard ratio assumed and why it is the one to detect.
- The level, whether the test is one- or two-sided, the power and the allocation ratio.
- The analysis planned: log-rank or Cox, stratified or not.
- The expected survival or event rate in the control group, and the source.
- The recruitment period, the minimum and maximum follow-up, and the expected loss to follow-up.
- The number of events and the number of patients, with the method and software that gave them.
- How interim analyses and early stopping change the numbers.
Beyond the formula
The formula covers one comparison under proportional hazards. For non-proportional hazards, competing events, several endpoints or a multi-state outcome, power is often found, or checked, by simulation: generate data from the model you expect, analyse them as you plan to, and count how often the test succeeds. We do this for protocols and grant applications, with the survival DGM explorer, which exports the data-generating mechanism as simulation code, as a starting point. Talk to us about your design.
Want to learn more?
- Sample size and power calculator
- What is a hazard ratio?
- What is the proportional hazards assumption?
- RMST or a hazard ratio?
- Our survival analysis course
- Check out our Resources page
MethodSurvival analysis