Ask Mallard
Analysis method

Events and sample size for a log-rank test

4 min read

Plan the required events first, then divide by the expected event probability to find total enrollment for a two-group log-rank comparison.

Fit

When to use it, and when not to

Use it when

  • You compare time to a first event in two independent groups.
  • A constant hazard ratio is a reasonable planning assumption.

Not when

Before you start

What you need

Decide these first
  1. Expected hazard ratioSupply a positive hazard ratio different from one. It describes the ratio of event rates among those still at risk.
  2. Overall event probabilitySupply the share expected to have the event during study follow-up, above zero and at most one.
  3. Allocation ratioEnter group two’s size divided by group one’s size. It defaults to one and has a lower bound of 0.05.
  4. Two-sided significance levelAlpha defaults to 0.05.
  5. Target powerPower defaults to 0.8 and is bounded between 0.5 and 0.999.
It rests on these
  1. The planning hazard ratio is constant over time.How to check: Review clinical expectations and prior survival curves. Delayed effects or crossing hazards need other planning.
  2. The overall event probability reflects the actual follow-up plan.How to check: Account externally for entry times, follow-up and loss to follow-up before supplying this value.
  3. People are independent and censoring is noninformative for the comparison.How to check: Check whether loss to follow-up relates to prognosis differently across groups.

Plain language

How it works

Schoenfeld’s approximation divides the squared sum of the significance and power normal quantiles by the allocation variance times the squared natural log hazard ratio. The allocation variance is the group-one share times the group-two share. Group one’s share is one divided by one plus the allocation ratio.

From assumptions to a total
Hazard ratio, allocation, alpha and power. Then Schoenfeld event requirement. Then Divide by event probability for enrollment.Events and sample size for a log-rank testHazard ratio, allocation,alpha and powerSchoenfeld eventrequirementDivide by eventprobability for enrollmentEvents and enrollment are rounded separately from the unrounded event requirement.
Conceptual diagram. It shows the structure of the idea, not data from any study.
What the target means

Mallard rounds the event requirement upward. It separately divides the unrounded requirement by the overall event probability and rounds enrollment upward. It does not calculate entry times or follow-up duration. Choosing a sample-size method helps distinguish event-based planning from a simple participant count.

Worked example

A worked example

Invented for illustration
Setting
A two-group trial plans equal allocation and one time-to-first-event outcome.
Question
What events and enrollment are needed for a hazard ratio of 0.7?
Approach
Enter hr = 0.7, eventRate = 0.4, ratio = 1, alpha = 0.05 and power = 0.8.
Result
Mallard returns 247 events and 617 participants in total.
What it means
The event probability is 40 in 100 during follow-up. Enrollment uses the unrounded event requirement, so dividing the printed event count can differ.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

The Schoenfeld calculation assumes proportional hazards. Total enrollment depends on the supplied overall event probability; Mallard does not model accrual or censoring to estimate it.

  • Treating everyone enrolled as an event.Instead: Use the overall event probability to convert events to enrollment.
  • Supplying a hazard rate as the event probability.Instead: Supply a probability over the planned study follow-up.
  • Claiming the app calculated follow-up duration.Instead: Determine the event probability externally; this route takes it as an input.

Inside Mallard

How Mallard uses this

Mallard returns rounded required events, total enrollment and approximate power at a supplied total. Enrollment uses the unrounded event requirement.

No Mallard code example points to this page.
Atlas node analysis.logrank_sample_size, the id a plan cue records.
Code for this method
Loading…

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Sample-size formula for the proportional-hazards regression model (opens in a new tab) · Biometrics
  2. Evaluation of survival data and two new rank order statistics arising in its consideration (opens in a new tab) · Cancer Chemother Rep
Prepared with AI assistance. PubMed records were matched by title, authors and year on 2026-11-06: record verified, confirm it supports this use. PubMed returned no DOI for either record. Schoenfeld supports proportional-hazards event planning; Mantel supports the log-rank comparison. Mallard’s exact rounding and event-probability conversion were checked against its engine. No independent professional approval is claimed.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.