Calculators · §7
Form MS-C7
Time-to-event · Schoenfeld events method

Sample size for survival analysis (log-rank / Cox)

How many participants — and, more fundamentally, how many events — to detect a hazard ratio between two groups.

Uses the standard normal approximation, which is accurate at typical sample sizes. A planning estimate, not a substitute for a statistician.

Method & formula

In survival analysis, power comes from events, not from enrollment. The Schoenfeld formula gives the required number of events, E = (z1−α/2 + z1−β)² / (π₁·π₂·(ln HR)²), where π₁, π₂ are the allocation fractions; total enrollment is then E divided by the overall event probability over your follow-up. With the defaults (HR 0.75, 30% event probability, equal arms) you need about 380 events ≈ 1,265 participants.

Two things this formula assumes: proportional hazards (check Schoenfeld residuals in the analysis), and that your event-probability estimate already reflects the planned follow-up length and any competing risks. A rarer event or shorter follow-up raises enrollment even when the hazard ratio stays the same.

Source: Schoenfeld DA. Sample-size formula for the proportional-hazards regression model. Biometrics 1983;39:499–503.

Inputs, explained

Hazard ratio
The relative event rate you aim to detect (0.75 = a 25% reduction). Sample size scales with 1/(ln HR)² — modest effects are very expensive.
Overall event probability
The fraction of all enrolled participants expected to have the event during follow-up, both groups combined.

A sample size is one line of a statistical plan. MedStatica turns a plain-language description of your study into the full plan — design, recommended analysis, power, causal diagram, methods paragraph, and runnable R, Python, SAS, and Stata code. The first plans are free, no card required.

Plan my study free →

Related calculators: comparing two proportions · logistic regression (events per variable) · comparing two means · all calculators