Sample Size for Survival Analysis
Comprehensive power analysis for clinical trials with time-to-event endpoints (e.g., overall survival, progression-free survival, time to recurrence).
Contents
1. When to Use This Method
Survival analysis sample size calculations are appropriate when your primary endpoint is time-to-event, and the analysis will use either:
- •Log-rank test — comparing two Kaplan-Meier survival curves
- •Cox proportional hazards model — estimating hazard ratios with covariate adjustment
Appropriate For
- ✓Overall survival (OS), progression-free survival (PFS)
- ✓Time to recurrence, time to treatment failure
- ✓Event-driven trials with censoring expected
- ✓Phase III oncology trials, cardiovascular outcome studies
Not Appropriate For
- ✗Fixed time-point binary outcomes (use proportion methods)
- ✗Continuous endpoints without time component
- ✗Recurrent events (use different methods)
2. Mathematical Formulation
2.1 Schoenfeld Formula (Required Events)
The Schoenfeld (1981) formula calculates the total number of events (d) required:
For two-sided test with allocation ratio p₁:p₂
For equal allocation (), this simplifies to:
Equal allocation formula
Where:
- = total number of events required
- = critical value for Type I error (1.96 for α=0.05)
- = critical value for power (0.842 for 80%, 1.282 for 90%)
- = hazard ratio (treatment/control)
- = allocation proportions to each group
2.2 Freedman Formula (Alternative)
The Freedman (1982) formula uses a slightly different parameterization:
Freedman formula for equal allocation
The Freedman formula tends to give slightly more conservative (larger) event estimates compared to Schoenfeld, particularly for moderate effect sizes.
2.3 Converting Events to Sample Size
Once the required number of events is known, convert to total sample size:
Total sample size calculation
The overall event probability depends on the survival function in each arm and the follow-up duration. For exponential survival:
Weighted average event probability
Where is the probability of event by time t in group i.
2.4 Lachin-Foulkes Method (With Accrual)
For trials with a defined accrual period () and additional follow-up (), the expected probability of event under exponential survival is:
Event probability with uniform accrual
Where:
- = accrual (enrollment) period
- = additional follow-up after accrual closes
- = hazard rate in group i
2.5 Unequal Allocation
For allocation ratio k:1 (treatment:control):
Events for k:1 allocation
| Allocation | Multiplier vs 1:1 | Common Use Case |
|---|---|---|
| 1:1 | 1.00× | Most efficient, standard design |
| 2:1 | 1.13× | Improve treatment arm safety data |
| 3:1 | 1.33× | Rare disease, maximize treatment exposure |
2.6 Non-Inferiority Design
For non-inferiority trials testing vs :
One-sided test (assuming HR₀ = 1)
Common non-inferiority margins:
- • — Preserves 50% of log(HR) effect
- • — More lenient margin
- • — Stricter margin (large trials)
2.7 Dropout Adjustment
To account for loss to follow-up at rate :
Sample size inflated for dropout
Alternatively, incorporate dropout into the event probability calculation by treating dropout as an additional censoring mechanism.
3. Assumptions
| Assumption | How to Check | If Violated |
|---|---|---|
| Proportional hazards | Schoenfeld residuals; log-log survival plots parallel | Use weighted log-rank (Fleming-Harrington), RMST, or piecewise methods |
| Non-informative censoring | Clinical review of dropout reasons; compare censored vs events | Sensitivity analyses; IPCW methods |
| Exponential survival (for conversion formulas) | Compare KM curve to exponential fit; historical data | Use simulation-based methods or Weibull assumptions |
| Uniform accrual | Review enrollment projections; historical accrual patterns | Piecewise accrual models; simulation |
| Stable hazard ratio estimate | Review prior data; Phase II confidence intervals | Power for range of HRs; adaptive designs |
Understanding Hazard Ratios
The hazard ratio is the primary effect size measure. Key interpretation:
| Hazard Ratio | Risk Reduction | Clinical Interpretation | Events Needed (80% power) |
|---|---|---|---|
| 0.50 | 50% | Strong effect (rare in practice) | ~65 |
| 0.60 | 40% | Large effect (breakthrough therapies) | ~120 |
| 0.70 | 30% | Moderate-large effect | ~246 |
| 0.75 | 25% | Moderate effect (typical target) | ~380 |
| 0.80 | 20% | Small-moderate effect | ~630 |
| 0.85 | 15% | Small effect (large trials needed) | ~1,150 |
4. Regulatory Guidance
FDA Guidance
ICH E9 (Statistical Principles): "For survival analysis, the sample size is usually expressed in terms of the number of events (e.g., deaths) rather than the number of subjects to be randomized."
Oncology Guidance: FDA expects event-driven designs for OS and PFS endpoints. Sample size justification should include assumptions about median survival, accrual pattern, and expected hazard ratio with supporting evidence.
Non-Inferiority Trials: FDA guidance recommends preserving at least 50% of the historical treatment effect when defining the non-inferiority margin for survival endpoints.
EMA Guidance
CPMP/EWP/2158/99: "The number of events should be the primary determinant of sample size for time-to-event endpoints. The trial duration and sample size should be planned to achieve the target number of events."
Proportional Hazards: EMA expects assessment of proportional hazards assumption and pre-specified alternative analyses if violations are anticipated (e.g., immunotherapy trials with delayed effects).
5. Validation Against Industry Standards
Zetyra's survival power calculations have been validated against industry-standard software. All comparisons use Schoenfeld formula with equal allocation.
| Scenario | α | Power | HR | Zetyra | PASS 2024 | nQuery 9.5 |
|---|---|---|---|---|---|---|
| Log-rank (Schoenfeld) | 0.05 | 80% | 0.70 | 246 | 246 | 246 |
| Log-rank (Schoenfeld) | 0.05 | 90% | 0.70 | 329 | 329 | 329 |
| Log-rank (Schoenfeld) | 0.05 | 80% | 0.75 | 380 | 380 | 380 |
| Log-rank (Schoenfeld) | 0.01 | 90% | 0.70 | 436 | 436 | 436 |
| Log-rank (Freedman) | 0.05 | 80% | 0.70 | 259 | 259 | 259 |
| 2:1 allocation | 0.05 | 80% | 0.70 | 277 | 277 | 277 |
6. Example SAP Language
Overall Survival Primary Endpoint (Oncology)
PFS Co-Primary Endpoint
Non-Inferiority Survival Trial
7. R Code
Using gsDesign Package
library(gsDesign)
# Schoenfeld formula for required events
nEvents <- function(hr, alpha = 0.05, power = 0.80,
sided = 2, ratio = 1) {
za <- qnorm(1 - alpha/sided)
zb <- qnorm(power)
p1 <- ratio / (1 + ratio)
p2 <- 1 / (1 + ratio)
d <- (za + zb)^2 / (p1 * p2 * log(hr)^2)
ceiling(d)
}
# Example: HR = 0.70, 80% power
nEvents(hr = 0.70) # Returns 246
# Using gsDesign for more comprehensive calculations
# with accrual and follow-up
x <- nSurv(
lambdaC = log(2)/12, # Control median = 12 months
hr = 0.70,
eta = 0.05/12, # 5% annual dropout
R = 24, # 24 month accrual
T = 36, # 36 month total study duration
alpha = 0.025, # One-sided
beta = 0.20 # 80% power
)
print(x)
# gsDesign with interim analyses
gsd <- gsDesign(
k = 3, # 2 interims + final
test.type = 2, # Two-sided symmetric
alpha = 0.05,
beta = 0.20,
n.fix = 246, # Fixed-design events
sfu = sfOF # O'Brien-Fleming spending
)
print(gsd)Using survival Package for Simulation
library(survival)
# Simulate survival trial and estimate power
sim_survival_trial <- function(n_per_arm, hr, median_ctrl,
n_sims = 1000) {
lambda_ctrl <- log(2) / median_ctrl
lambda_trt <- lambda_ctrl * hr
p_values <- replicate(n_sims, {
# Generate survival times
time_ctrl <- rexp(n_per_arm, lambda_ctrl)
time_trt <- rexp(n_per_arm, lambda_trt)
# Combine data
df <- data.frame(
time = c(time_ctrl, time_trt),
event = 1, # All events observed (no censoring for simplicity)
group = rep(c("ctrl", "trt"), each = n_per_arm)
)
# Log-rank test
survdiff(Surv(time, event) ~ group, data = df)$chisq
})
mean(p_values > qchisq(0.95, 1)) # Power estimate
}
# Validate: should give ~80% power for n=246 events
# (n per arm = 123 with 100% event rate)
sim_survival_trial(123, 0.70, 12, n_sims = 5000)Freedman Formula Comparison
# Freedman (1982) formula
nEvents_freedman <- function(hr, alpha = 0.05, power = 0.80) {
za <- qnorm(1 - alpha/2)
zb <- qnorm(power)
d <- (za + zb)^2 * (1 + hr)^2 / (hr - 1)^2
ceiling(d)
}
# Compare formulas
hr_values <- c(0.50, 0.60, 0.70, 0.80)
comparison <- data.frame(
HR = hr_values,
Schoenfeld = sapply(hr_values, nEvents),
Freedman = sapply(hr_values, nEvents_freedman)
)
print(comparison)
# HR Schoenfeld Freedman
# 1 0.50 65 73
# 2 0.60 120 133
# 3 0.70 246 259
# 4 0.80 630 6498. References
Schoenfeld D. (1981). The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika, 68(1), 316-319.
Freedman L.S. (1982). Tables of the number of patients required in clinical trials using the logrank test. Statistics in Medicine, 1(2), 121-129.
Lachin J.M., Foulkes M.A. (1986). Evaluation of sample size and power for analyses of survival with allowance for nonuniform patient entry, losses to follow-up, noncompliance, and stratification. Biometrics, 42(3), 507-519.
Collett D. (2015). Modelling Survival Data in Medical Research (3rd ed.). CRC Press.
ICH E9. (1998). Statistical Principles for Clinical Trials. International Council for Harmonisation.
FDA. (2007). Guidance for Industry: Clinical Trial Endpoints for the Approval of Cancer Drugs and Biologics.
Ready to Calculate?
Use our Survival Power Calculator to determine events and sample size for your log-rank test or Cox model analysis.