Survival Analysis
Sample size for a two-arm Fleming-Harrington weighted log-rank test when the treatment effect is not proportional over time, including delayed treatment effects. Based on the piecewise-exponential delayed-effect formulation of Hasegawa (2014), which is also represented in commercial survival-design software such as.
This calculator implements the sample-size method described by Hasegawa (2014) for the Fleming-Harrington class of weighted log-rank tests under a delayed treatment-effect model. The control arm has a constant exponential hazard. The treatment arm has the same hazard through the specified change point and then changes to a second constant hazard. This permits the hazard ratio to vary over time rather than assuming proportional hazards.
Let λ0 be the control hazard and λ1 the treatment hazard after the delay ε. The control survival function is exponential, while treatment survival is piecewise exponential:
When median survival times are supplied, the control hazard is λ0 = log(2) / m0. The post-delay treatment hazard is chosen so that the specified treatment median is reproduced:
At each time point the pooled survival estimate determines the weight according to the Fleming-Harrington family:
The resulting weighted log-rank statistic gives different importance to failures occurring at different parts of the survival curve. This is particularly useful when the treatment effect is expected to emerge gradually or after a prespecified delay.
The calculation discretizes study time into sufficiently small intervals, evaluates the expected risk-set and event contributions under the alternative model, and forms the standardized expected weighted log-rank effect E*. The required total sample size before allocation rounding is:
The final sample size is rounded upward while preserving the specified treatment allocation. Expected events are obtained from the integrated event contribution under the same survival and accrual assumptions.
The implementation follows the Hasegawa setup in which patients accrue uniformly over the enrollment period and administrative censoring occurs at the study end. The minimum follow-up input determines the corresponding accrual duration as study end minus minimum follow-up.
Hasegawa's Example 1 uses treatment allocation p = 2/3, study end 66, minimum follow-up 18, a 6-unit delayed effect, median survival of 21.7 in the placebo group and 25.8 in the treatment group, α = 0.025, β = 0.10, and Fleming-Harrington weights (ρ, γ) = (0, 1). With 30 numerical intervals per time unit, the published calculation gives a required total sample size of 1,974.
The browser implementation reproduces this validation result: 1,974 total participants. This provides a fixed numerical check on the implementation rather than merely testing that the JavaScript runs.
This is a model-based sample-size calculation. Its result depends on the assumed survival curves, delay point, allocation ratio, follow-up, accrual pattern, and weighting parameters. In particular, Fleming-Harrington weights should be prespecified based on a scientifically justified alternative survival pattern. A different non-proportional-hazards model can produce a materially different required sample size.
Hasegawa, T. (2014). Sample size determination for the weighted log-rank test with the Fleming-Harrington class of weights in cancer vaccine studies. Pharmaceutical Statistics, 13(2), 128–135. doi:10.1002/pst.1609.
Fleming, T.R. & Harrington, D.P. (1991). Counting Processes and Survival Analysis. Wiley, New York.
Ye, T. & Yu, M. (2018). A robust approach to sample size calculation in cancer immunotherapy trials with delayed treatment effect. Biometrics, 74(4), 1292–1300.
Statsols/ documentation describes the corresponding survival design family as linear-rank tests for piecewise survival, including Fleming-Harrington weighted log-rank tests for non-proportional hazards.