Survival Analysis
Estimate the sample size required for a two-arm trial whose primary treatment contrast is the difference in restricted mean survival time up to a prespecified horizon τ. The calculation uses a large-sample normal approximation with exponential survival distributions and the exact variance of min(T,τ).
Restricted mean survival time (RMST) at a prespecified restriction time τ is the area under the survival function through τ:
It can equivalently be viewed as the expected value of min(T,τ). The treatment effect used here is the difference Δ = RMSTT(τ) − RMSTC(τ). This is an interpretable time-scale treatment effect and does not require a proportional-hazards treatment effect.
For this calculator, each arm is assumed to have an exponential survival distribution. If the median survival is m, the corresponding hazard rate is λ = log(2) / m. Under that model:
Because RMST equals E[min(T,τ)], the variance of the restricted survival time under the exponential model is obtained from its first two moments:
Let VC and VT denote the variances of the restricted survival times in the control and treatment arms, respectively. If r = nT / nC is the treatment-to-control allocation ratio, the large-sample variance of the RMST difference is approximated by
Therefore, for a two-sided test with type-I error α and target power 1 − β, the required control-arm sample size before rounding is:
The treatment-arm sample size is nT = r nC. Each arm is rounded upward to a whole participant. If an additional attrition fraction q is specified, the resulting arm sizes are inflated by 1/(1−q).
A positive RMST difference means that, under the specified survival assumptions, the treatment arm has a larger average restricted survival time through τ. For example, an RMST difference of 2 months means 2 additional months of average survival accumulated over the prespecified 24-month horizon.
Royston, P. & Parmar, M. K. B. (2013). “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, 13, 152. The paper develops RMST-based trial-design methodology, including the relationship between the RMST difference, its variance, power, and required sample size. Published article.
Uno, H., Claggett, B., Tian, L., et al. (2014). “Moving beyond the hazard ratio in quantifying the between-group difference in survival analysis.” Journal of Clinical Oncology, 32(22), 2380–2385. This paper describes RMST as an interpretable alternative summary of treatment differences in survival analysis. PubMed.
nQuery / Statsols. nQuery provides survival-design procedures and explicitly lists restricted-mean-survival-time methodology among its survival testing capabilities, including the “Non-Inferiority Test for the Difference of Two Restricted Mean Survival Times (RMST)” (STE10). The nQuery catalog also documents survival sample-size procedures and related survival design calculations. nQuery procedure catalog.
A fixed numerical check for this implementation uses a two-sided α = 0.05 test, 80% power, equal allocation, a 24-month restriction time, 12-month control median survival, and 18-month treatment median survival, with no additional attrition.
The JavaScript implementation below independently reproduces this calculation and returns 322 total participants for those inputs.