ArticleslgStudy

mathematics

Logrank test

Logrank test is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Logrank test rather than just read about it. In short: The logrank test, or log-rank test, is a hypothesis test to compare the survival distributions of two samples. It is a nonparametric test and appropriate to use when the data are right skewed and censored (technically, the censoring must be non-informative).

Key takeaways

  • Logrank test belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Logrank test to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Logrank test from memory before moving on to harder problems.

Reference excerpt

The logrank test, or log-rank test, is a hypothesis test to compare the survival distributions of two samples. It is a nonparametric test and appropriate to use when the data are right skewed and censored (technically, the censoring must be non-informative). It is widely used in clinical trials to establish the efficacy of a new treatment in comparison with a control treatment when the measurement is the time to event (such as the time from initial treatment to a heart attack). The test is sometimes called the Mantel–Cox test. The logrank test can also be viewed as a time-stratified Cochran–Mantel–Haenszel test. The test was first proposed by Nathan Mantel and was named the logrank test by Richard and Julian Peto.

Definition The logrank test statistic compares estimates of the hazard functions of the two groups at each observed event time. It is constructed by computing the observed and expected number of events in one of the groups at each observed event time and then adding these to obtain an overall summary across all-time points where there is an event. Consider two groups of patients, e.g., treatment vs. control. Let 1,…,J be the distinct times of observed events in either group. Let N1,j and N2,j be the number of subjects "at risk" (who have not yet had an event or been censored) at the start of period j in the groups, respectively. Let O1,j and O2,j be the observed number of events in the groups at time j. Finally, define Nj=N1,j+N2,j and Oj=O1,j+O2,j. The null hypothesis is that the two groups have identical hazard functions, H0:h1(t)=h2(t). Hence, under H0, for each group i=1,2, Oi,j follows a hypergeometric distribution with parameters Nj, Ni,j, Oj. This distribution has expected value Ei,j=OjNi,jNj and variance Vi,j=Ei,j(Nj−OjNj)(Nj−Ni,jNj−1). For all j=1,…,J, the logrank statistic compares Oi,j to its expectation Ei,j under H0. It is defined as

Zi=∑j=1J(Oi,j−Ei,j)∑j=1JVi,j →d 𝒩(0,1) (for i=1 or 2) It is easy to see that for all j, O2,j−E2,j=−(O1,j−E1,j) and V2,j=V1,j, so Z2=−Z1. By the central limit theorem, the distribution of each Zi converges to that of a standard normal distribution as J approaches infinity and therefore can be approximated by the standard normal distribution for a sufficiently large J. An improved approximation can be obtained by equating this quantity to Pearson type I or II (beta) distributions with matching first four moments, as described in Appendix B of the Peto and Peto paper.

Asymptotic distribution If the two groups have the same survival function, the logrank statistic is approximately standard normal. A one-sided level α test will reject the null hypothesis if Z>zα where zα is the upper α quantile of the standard normal distribution. If the hazard ratio is λ, there are n total subjects, d is the probability a subject in either group will eventually have an event (so that nd is the expected number of events at the time of the analysis), and the proportion of subjects randomized to each group is 50%, then the logrank statistic is approximately normal with mean (log⁡λ)nd4 and variance 1. For a one-sided level α test with power 1−β, the sample size required is n=4(zα+zβ)2dlog2λ where zα and zβ are the quantiles of the standard normal distribution.

Joint distribution Suppose Z1 and Z2 are the logrank statistics at two different time points in the same study (Z1 earlier). Again, assume the hazard functions in the two groups are proportional with hazard ratio λ and d1 and d2 are the probabilities that a subject will have an event at the two time points where d1≤d2. Z1 and Z2 are approximately bivariate normal with means log⁡λnd14 and log⁡λnd24 and correlation d1d2. Calculations involving the joint distribution are needed to correctly maintain the error rate when the data are examined multiple times within a study by a Data Monitoring Committee.

Relationship to other statistics The logrank statistic can be derived as the score test for the Cox proportional hazards model comparing two groups. It is therefore asymptotically equivalent to the likelihood ratio test statistic based from that model. The logrank statistic is asymptotically equivalent to the likelihood ratio test statistic for any family of distributions with proportional hazard alternative. For example, if the data from the two samples have exponential distributions. If Z is the logrank statistic, D is the number of events observed, and λ̂ is the estimate of the hazard ratio, then log⁡λ̂≈Z4/D. This relationship is useful when two of the quantities are known (e.g. from a published article), but the third one is needed. The logrank statistic can be used when observations are censored. If censored observations are not present in the data then the Wilcoxon rank sum test is appropriate. The logrank statistic gives all calculations the same weight, regardless of the time at which an event occurs. The Peto logrank test statistic gives more weight to earlier events when there are a large number of observations.

Test assumptions The logrank test is based on the same assumptions as the Kaplan-Meier survival curve—namely, that censoring is unrelated to prognosis, the survival probabilities are the same for subjects recruited early and late in the study, and the events happened at the times specified. Deviations from these assumptions matter most if they are satisfied differently in the groups being compared, for example if censoring is more likely in one group than another.

See also

Kaplan–Meier estimator Hazard ratio

References

Worked examples

Example 1 — a first encounter with Logrank test

Start with the simplest possible case. Write down what Logrank test claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Logrank test before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Logrank test ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Logrank test

In research
Logrank test appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Logrank test in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Logrank test is common in secondary-school and first-year university syllabi. It links to neighbouring topics Survival analysis, Time series statistical tests, so understanding it makes those chapters shorter.
In everyday life
Look for Logrank test outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Logrank test” →

How to study Logrank test in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Logrank test means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Logrank test out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Logrank test in simple terms?

The logrank test, or log-rank test, is a hypothesis test to compare the survival distributions of two samples. It is a nonparametric test and appropriate to use when the data are right skewed and censored (technically, the censoring must be non-informative).

Why does Logrank test matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Logrank test?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Logrank test.

Tags

  • Survival analysis
  • Time series statistical tests

Keep exploring