Method document
Sample size for a difference in restricted mean survival time
How many participants are needed to show a difference in restricted mean survival time (RMST), the average event-free time up to a chosen τ, between two groups, including when the treatment effect is delayed. Covers unequal groups, accrual and follow-up, losses, competing risks and dropout.
https://statwisely.com/methods/survival-rmst/
When to use it
- A trial reporting the RMST difference, months of event-free time gained, as its primary or a supportive analysis when hazards may not be proportional.
Not for
- A τ beyond the minimum follow-up, where the Kaplan–Meier curve is too poorly estimated.
Notation
- Number of participants
- Control hazard, from the control survival at the end of the study
- Delay after entry before the treatment effect begins
- Hazard ratio after the delay, treatment against control
- Hazard and survival of group g; the treated hazard is λ before d and HR·λ after it
- Chance of still being followed at time t, from entry, losses and competing events
- Shares of participants in control and treatment
- Accrual period and additional follow-up after it
- Loss-to-follow-up hazard
- Chance of a competing event by the end of the study, and its hazard
- Restriction time; the minimum follow-up unless given
- Difference in RMST, ∫₀^τ (S₁ − S₀) dt
- Per-participant variance of group g’s Kaplan–Meier RMST
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Expected dropout
Formulas
The RMST difference and its variance
Each group’s Kaplan–Meier RMST up to τ has the Greenwood-type variance σ²/n [1]. A delay shrinks Δ more than it shrinks the log-rank drift, so RMST usually needs more participants under a delayed effect, while reading as time gained.
Competing risks
Optional. A competing event ends follow-up for the event of interest, so for a cause-specific hazard ratio it acts as one more censoring hazard μ over the study horizon H (the accrual plus follow-up, or one study period). The events of interest needed are unchanged; fewer participants have one, so more are needed [2]. A subdistribution (Fine–Gray) hazard ratio is a different estimand.
Dropout
Applied last, to the participants actually recruited.
Parameters
Hazard ratio after the delay
Values: Above 0 and not 1
The effect once it has begun; 0.7 is a 30% lower hazard from the delay on.
Delay before the effect
Values: 0 or more, before the end of the study
From earlier trials of the same kind of treatment, often where the published Kaplan–Meier curves separate.
Control survival at the end of the study
Values: Between 0 and 1
Sets the control hazard, taken as constant.
Allocation ratioOptional
Values: Above 0; 1 for equal groups
Treatment participants per control participant.
Accrual periodOptional
Values: 0 or more, with the follow-up
Entry is taken as uniform over it; without it, one study period of follow-up for everyone, in which the delay is a fraction.
Follow-up after accrualOptional
Values: 0 or more, with the accrual
Longer follow-up gives a delayed effect more time to show.
Loss-to-follow-up rateOptional
Values: 0 or more, per unit of time; needs accrual and follow-up
Participants lost before the delay ends add nothing to the comparison.
Chance of a competing eventOptional
Values: At least 0 and below 1; 0 by default
The share expected to have an event that ends follow-up for the event of interest by the end of the study, such as death from another cause.
Restriction timeOptional
Values: After the delay and no later than the minimum follow-up
A clinically meaningful horizon, such as two years; later τ gains signal but loses precision.
Significance level
Values: Between 0 and 1; usually 0.05
The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.
Power
Values: Between 0 and 1; usually 0.80 or 0.90
The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.
Expected dropoutOptional
Values: 0% up to, but not including, 100%
The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.
Assumptions
- Hazards are equal until the delay and in a constant ratio after it, with a constant control hazard; entry is uniform and censoring unrelated to the outcome.
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
An effect from a quarter of the way in
HR = 0.7 from 0.25 on, τ = 1: RMSTs of 0.721 and 0.758, a difference of 0.037, so N = 2729.
Events: 1250 · Group 1: 1365 · Group 2: 1364 · Total: 2729
Open this example in the calculatorProtocol statement
To detect the difference in restricted mean survival that a hazard ratio of 0.7 beginning 0.25 units of time after entry produces with 80% power at a two-sided significance level of 0.05, using a comparison of restricted mean survival time up to 1 units of time, and assuming 50% of the control group event-free at the end of the study and equal hazards in both groups until the delay, 1250 events are required; with an expected event probability of 45.78%, the required sample size is 1365 in the first group and 1364 in the second group (2729 in total). Calculated with StatWisely (statwisely.com) using: N = (z_(1-α/2)+z_(1-β))²(σ₀²/π₀ + σ₁²/π₁)/ΔRMST², Kaplan-Meier RMST up to τ. These are planning estimates; confirm the final design with a qualified statistician.
The same effect from the start
With no delay the difference doubles to 0.071: N = 684.
Events: 303 · Group 1: 342 · Group 2: 342 · Total: 684
Open this example in the calculatorTwo-and-a-half-year RMST
HR = 0.6 after 0.5 years, recruitment over 1 year, τ = 2.5 years: a gain of 0.129 years, N = 1294.
Events: 577 · Group 1: 647 · Group 2: 647 · Total: 1294
Open this example in the calculatorValidation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
- Simulated trials with piecewise-exponential survival, analysed with Kaplan–Meier RMST differences and Greenwood-type variances, gave power of 0.81 to 0.83 against a target of 0.80.
How to cite
StatWisely. Sample size for a difference in restricted mean survival time. Method document, engine version 1.0.0, reviewed 2026-10-10. https://statwisely.com/methods/survival-rmst/
Cite the original references for the formulas your design uses as well.
References
- 1.Royston P, Parmar MKB. Restricted mean survival time: an alternative to the hazard ratio for the design and analysis of randomized trials with a time-to-event outcome. BMC Medical Research Methodology. 2013;13:152. doi:10.1186/1471-2288-13-152
- 2.Pintilie M. Dealing with competing risks: testing covariates and calculating sample size. Statistics in Medicine. 2002;21(22):3317–3324.