Skip to main content

    Method document

    Sample size for a non-inferiority log-rank test

    How many events, and then participants, are needed to show that a new treatment’s hazard is not worse than a control’s by more than a chosen margin. Covers unequal allocation, accrual and follow-up, losses to follow-up and dropout.

    Engine version 1.0.0 · Reviewed 1 October 2026

    https://statwisely.com/methods/survival-noninferiority/

    When to use it

    • A trial of a treatment that is cheaper, safer or simpler, where showing it is not meaningfully worse is enough.

    Not for

    • Showing that the new treatment is better. Use the log-rank test.

    Notation

    DD
    Number of events required
    NN
    Number of participants
    HR\mathrm{HR}
    Hazard ratio, treatment against control
    kk
    Allocation ratio, treatment to control
    p1, p2p_1,\ p_2
    Shares of participants in control and treatment, 1/(1 + k) and k/(1 + k)
    ScS_c
    Survival in the control group at the end of the study
    PEP_E
    Probability that a participant has the event during the study
    a, fa,\ f
    Accrual period and additional follow-up after it
    λ, η\lambda,\ \eta
    Event hazard and loss-to-follow-up hazard
    c, μc,\ \mu
    Chance of a competing event by the end of the study, and its hazard
    HR0\mathrm{HR}_0
    Non-inferiority margin on the hazard-ratio scale
    α\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

    Events against the margin

    D=⌈(z1−α+z1−β)2p1 p2 (ln⁡HR−ln⁡HR0)2⌉D = \left\lceil \frac{(z_{1-\alpha} + z_{1-\beta})^{2}}{p_1\,p_2\,(\ln \mathrm{HR} - \ln \mathrm{HR}_0)^{2}} \right\rceil

    Schoenfeld’s formula with the distance from the margin in place of the distance from 1, tested one-sided [1, 2]. A true hazard ratio of 1 is the usual planning assumption.

    From events to participants

    N=⌈DPE⌉,PE=p1 (1−Sc)+p2 (1−ScHR)N = \left\lceil \frac{D}{P_E} \right\rceil, \qquad P_E = p_1\,(1 - S_c) + p_2\,(1 - S_c^{\mathrm{HR}})

    A survival analysis draws its power from events, not from participants, so the number to recruit is the events divided by the chance that a participant has one. Without accrual and follow-up times, S_c is taken as the control survival over the whole study.

    With accrual, follow-up and losses

    PE(λ)=λλ+η[1−e−(λ+η)f(1−e−(λ+η)a)(λ+η) a],λc=−ln⁡Sca+f,λt=HR⋅λcP_E(\lambda) = \frac{\lambda}{\lambda + \eta}\left[1 - \frac{e^{-(\lambda+\eta) f}\left(1 - e^{-(\lambda+\eta) a}\right)}{(\lambda+\eta)\,a}\right], \qquad \lambda_c = \frac{-\ln S_c}{a + f}, \quad \lambda_t = \mathrm{HR}\cdot\lambda_c

    With participants entering uniformly over the accrual period and followed for at least f afterwards, each has a different time at risk. Survival is exponential, and losses to follow-up are a competing exponential risk that removes the chance of observing the event [3].

    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 [5]. 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

    True hazard ratio expectedHR\mathrm{HR}

    Values: Above 0, not 1

    The smallest effect worth detecting; 0.7 means a 30% lower hazard on treatment. Published trials of similar treatments are the best source.

    Control survivalScS_c

    Values: Between 0 and 1

    The proportion of the control group expected to be event-free at the end of the study, from registries or previous trials. Fewer events per participant need more participants.

    Allocation ratiokkOptional

    Values: Above 0; 1 for equal groups

    Treatment participants per control participant. Equal allocation needs the fewest events.

    Accrual and follow-up timesa, fa,\ fOptional

    Values: Both 0 or more, in the same units, not both 0

    How long recruitment lasts, and how long the study continues after the last participant enters. Given together.

    Loss-to-follow-up hazardη\etaOptional

    Values: 0 or more, per the same time unit; needs accrual and follow-up

    The rate at which participants are lost before their event can be seen; 0.05 per year loses about 5% a year.

    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.

    Non-inferiority marginHR0\mathrm{HR}_0

    Values: Above 0, not 1; above the expected hazard ratio when a higher hazard is worse

    The largest loss of effect that would still be acceptable, justified clinically and from the control treatment’s known benefit. Regulators expect it to be set in advance.

    Significance levelα\alpha

    Values: One-sided; usually 0.025

    One-sided, since only one direction is being ruled out. 0.025 matches a two-sided 0.05 test.

    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

    • Proportional hazards: the hazard ratio is constant over time; check it in the analysis [4].
    • With accrual and follow-up given, entry is uniform and survival exponential in both groups.
    • Censoring is unrelated to the outcome.
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    A margin of 1.3

    True HR 1, margin 1.3, one-sided α = 0.025, 80% power: D = 7.849 / (0.25 × (ln 1.3)²) = 456.1, so 457 events; with half the participants having the event, N = 914.

    Events: 457 · Group 1: 457 · Group 2: 457 · Total: 914

    Protocol statement

    To show non-inferiority within a hazard-ratio margin of 1.3 with 80% power at a one-sided significance level of 0.025, using a log-rank test, and assuming a true hazard ratio of 1 and 50% of the control group event-free at the end of the study, 457 events are required; with an expected event probability of 50%, the required sample size is 457 per group (914 in total). Calculated with StatWisely (statwisely.com) using: Events = [z_(1-α)+z_(1-β)]²/[p₁p₂(log(HR)-log(HR₀))²]. These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    A tighter margin

    Margin 1.2: 945 events and N = 1890. Halving the log-margin roughly quadruples the events.

    Events: 945 · Group 1: 945 · Group 2: 945 · Total: 1890

    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.

    How to cite

    StatWisely. Sample size for a non-inferiority log-rank test. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/survival-noninferiority/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Schoenfeld DA. Sample-size formula for the proportional-hazards regression model. Biometrics. 1983;39(2):499–503.
    2. 2.Chow SC, Shao J, Wang H. Sample Size Calculations in Clinical Research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008.
    3. 3.Lachin JM, Foulkes MA. Evaluation of sample size and power for analyses of survival with allowance for nonuniform patient entry, losses to follow-up, noncompliance, and stratification. Biometrics. 1986;42(3):507–519.
    4. 4.Collett D. Modelling Survival Data in Medical Research. 3rd ed. Boca Raton: CRC Press; 2015.
    5. 5.Pintilie M. Dealing with competing risks: testing covariates and calculating sample size. Statistics in Medicine. 2002;21(22):3317–3324.