Skip to main content

    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.

    Engine version 1.0.0 · Reviewed 10 October 2026

    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

    NN
    Number of participants
    λ\lambda
    Control hazard, from the control survival at the end of the study
    dd
    Delay after entry before the treatment effect begins
    HR\mathrm{HR}
    Hazard ratio after the delay, treatment against control
    hg, Sgh_g,\ S_g
    Hazard and survival of group g; the treated hazard is λ before d and HR·λ after it
    GG
    Chance of still being followed at time t, from entry, losses and competing events
    π0, π1\pi_0,\ \pi_1
    Shares of participants in control and treatment
    a, fa,\ f
    Accrual period and additional follow-up after it
    η\eta
    Loss-to-follow-up hazard
    c, μc,\ \mu
    Chance of a competing event by the end of the study, and its hazard
    q(t)q(t)
    Treatment share of those still at risk at time t
    μ, V\mu,\ V
    Mean and variance of the log-rank score per participant
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    qq
    Expected dropout

    Formulas

    The log-rank drift under a delayed effect

    N=⌈(z1−α/2+z1−β)2 Vμ2⌉,μ=∫(h1a1(1−q)−h0a0q) dt,V=∫(h1a1+h0a0) q(1−q) dtN = \left\lceil \frac{(z_{1-\alpha/2} + z_{1-\beta})^{2}\, V}{\mu^{2}} \right\rceil, \quad \mu = \int (h_1 a_1 (1 - q) - h_0 a_0 q)\,dt, \quad V = \int (h_1 a_1 + h_0 a_0)\, q(1 - q)\,dt

    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

    μ=−ln⁡(1−c)H,η  ←  η+μ\mu = \frac{-\ln(1 - c)}{H}, \qquad \eta \;\leftarrow\; \eta + \mu

    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

    nrecruit=⌈n1−q⌉n_{\text{recruit}} = \left\lceil \frac{n}{1 - q} \right\rceil

    Applied last, to the participants actually recruited.

    Parameters

    Hazard ratio after the delayHR\mathrm{HR}

    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 effectdd

    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 studyS0S_0

    Values: Between 0 and 1

    Sets the control hazard, taken as constant.

    Allocation ratiokkOptional

    Values: Above 0; 1 for equal groups

    Treatment participants per control participant.

    Accrual periodaaOptional

    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 accrualffOptional

    Values: 0 or more, with the accrual

    Longer follow-up gives a delayed effect more time to show.

    Loss-to-follow-up rateη\etaOptional

    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 eventccOptional

    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α\alpha

    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.

    Power1−β1-\beta

    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 dropoutqqOptional

    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

    Protocol 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.

    Open this example in the calculator

    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 calculator

    Recruitment 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 calculator

    Validation

    • 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. 1.Lakatos E. Sample sizes based on the log-rank statistic in complex clinical trials. Biometrics. 1988;44(1):229–241.
    2. 2.Pintilie M. Dealing with competing risks: testing covariates and calculating sample size. Statistics in Medicine. 2002;21(22):3317–3324.