Method document
Sample size for a log-rank test with a delayed treatment effect
How many participants are needed to show a difference in survival with the log-rank test when the treatment effect begins only after a delay, as with immunotherapies, from the hazard ratio after the delay. Covers unequal groups, accrual and follow-up, losses, competing risks and dropout.
https://statwisely.com/methods/survival-delayed-logrank/
When to use it
- A trial whose survival curves are expected to overlap at first and separate later.
Not for
- An effect expected from the start; the ordinary log-rank test is the same calculation with d = 0.
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
- Treatment share of those still at risk at time t
- Mean and variance of the log-rank score per participant
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Expected dropout
Formulas
The log-rank drift under a delayed effect
aₛ(t) = πₛ Sₛ(t) G(t) is each group’s share still at risk. The log-rank score is the treated events less those expected from the risk set; before the delay its mean is zero, so early events add variance but no signal, which is why a delay raises the sample size so much [1]. With d = 0 and a small effect this is Schoenfeld’s formula.
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.
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 of the study period on, 0.5 of controls event-free at the end: N = 1280, with 586 events.
Events: 586 · Group 1: 640 · Group 2: 640 · Total: 1280
Open this example in the calculatorProtocol statement
To detect a hazard ratio of 0.7 that begins 0.25 units of time after entry with 80% power at a two-sided significance level of 0.05, using a log-rank test, planned for a delayed treatment effect, and assuming 50% of the control group event-free at the end of the study and equal hazards in both groups until the delay, 586 events are required; with an expected event probability of 45.78%, the required sample size is 640 per group (1280 in total). Calculated with StatWisely (statwisely.com) using: N = (z_(1-α/2)+z_(1-β))²·V/μ², log-rank drift μ and variance V under a delayed effect. These are planning estimates; confirm the final design with a qualified statistician.
The same effect from the start
With no delay: N = 563, close to Schoenfeld’s 559. The delay more than doubles the trial.
Events: 249 · Group 1: 282 · Group 2: 281 · Total: 563
Open this example in the calculatorRecruitment over a year
HR = 0.6 after 0.5 years, 0.4 of controls event-free, recruitment over 1 year and 3 more of follow-up, losses at 0.05 a year: N = 476.
Events: 213 · Group 1: 238 · Group 2: 238 · Total: 476
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 the log-rank test, gave power of 0.80 to 0.81 against a target of 0.80, with and without a delay, uniform entry and losses.
How to cite
StatWisely. Sample size for a log-rank test with a delayed treatment effect. Method document, engine version 1.0.0, reviewed 2026-10-10. https://statwisely.com/methods/survival-delayed-logrank/
Cite the original references for the formulas your design uses as well.
References
- 1.Lakatos E. Sample sizes based on the log-rank statistic in complex clinical trials. Biometrics. 1988;44(1):229–241.
- 2.Pintilie M. Dealing with competing risks: testing covariates and calculating sample size. Statistics in Medicine. 2002;21(22):3317–3324.