# Sample Size Calculator for Survival Analysis

> Free sample size calculator for a log-rank comparison of two groups. Get the number of events (Schoenfeld or Freedman) and the number of participants from the hazard ratio and the control-group survival, with a sentence for your methods section and R code.

Canonical: https://biostatkit.com/sample-size-survival

Find how many events and how many participants a survival comparison needs. Enter the hazard ratio you want to detect and the event-free proportion in the control group. You get the events, the participants, a sentence for your methods section, and the R code.

## Methods wording

The number of events and participants for a log-rank comparison was calculated with BiostatKit [1] using the sample-size formula of Schoenfeld [2].

Method: Schoenfeld or Freedman events for the log-rank test; participants from the event probabilities under proportional hazards.

## Frequently asked questions

### Schoenfeld or Freedman?

Both give the number of events for the log-rank test. They agree when the hazard ratio is near 1. Freedman asks for somewhat more events when the hazard ratio is far from 1. Pick one, state it, and keep it.

### What is the event-free proportion in the control group?

The share of control participants you expect to still be free of the event at the end of follow-up, for example 2-year progression-free survival. Take it from a published study or registry.

### What if I only know the median survival?

With exponential survival the event-free proportion at time t is 0.5 raised to the power of t over the median. Work it out for your follow-up time and enter that.

### Why does a hazard ratio of 1 give an error?

A hazard ratio of 1 means no difference, and no number of events can detect no difference. Enter the smallest hazard ratio that would matter clinically.

### Is my data stored or sent anywhere?

No. All calculations run in your browser tab. Nothing is uploaded, and the page works offline once loaded.

## Related calculators

- [Sample size: two means or two proportions](https://biostatkit.com/sample-size-two-groups)
- [Sample size for a proportion](https://biostatkit.com/sample-size-proportion)

Author: TS.BS. Vũ Duy Kiên (https://www.vuduykien.com)
