Skip to content
Celeus

Kaplan-Meier (log-rank test)

Shown in the app as kaplan_meier. Part of the method reference, under Survival and censored data.

When to use

Time-to-event outcome (a time column + a 0/1 event indicator): compare survival between groups (KM curves + log-rank test).

What you provide

  • Time (follow-up): one numeric column.
  • Event (1 = event, 0 = censored): one two-level column.
  • Group: one categorical column.

Options

Missing data

  • Complete case (listwise deletion)

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Confidence level

Every interval in the result is reported at the level you choose:

  • 90%
  • 95%
  • 99%

Other methods under Survival and censored data:

Guides that discuss this method

How to read the output

Kaplan-Meier analysis describes time until an event, for example the time until a machine component fails, or until a tagged animal leaves a study area, and compares it between groups. Units whose event has not happened by the end of follow-up are censored: they count as event-free for as long as they were observed, and are not dropped.

The curves. Each group’s curve is the estimated proportion still event-free at each time. It steps down at each event; censored units reduce the number at risk but do not make it step. The right end of a curve rests on few units and is the least precise part.

Which value is the event. The event column has two values: one for “the event happened” and one for “censored”. When the two values are words, such as “died” and “survived”, alphabetical order would make the first one the censored value, which is often the wrong way round, so Celeus asks you which value marks the event. Numeric codes follow the usual convention: 1 is the event in a 0/1 column, and 2 is the event in a 1/2 column. A column named like a censoring flag (“censored”) is read with 1 as the event, and Celeus says so.

Median time. The median is the time at which a group’s curve falls to 50%. If a curve never reaches 50% within follow-up, the median is not reached, which is a result, not an error. Each median comes with a confidence interval (log transformation, the default of the R survival package); an interval with no upper bound means the curve’s upper limit never fell to 50% either.

Log-rank test. The p-value tests whether the groups’ curves differ anywhere over follow-up, not at one chosen time. The test is most sensitive when one group’s risk is a constant multiple of the other’s; curves that cross can differ while the test misses it, so look at the curves as well. With exactly two groups, Celeus also reports a hazard ratio with its confidence interval, from a Cox model with the group as its only predictor, naming which group is compared with which. The groups are always treated as categories, even when they are coded as numbers. That hazard ratio assumes proportional hazards, and Celeus checks the assumption for it.

Confidence level. Every interval in the result (medians and the hazard ratio) uses one level: 95% by default, or 90% or 99% if you choose it before the run.

Landmark analysis. To compare survival only among units still event-free at a chosen time L, filter the analysis to times of at least L and derive a new time column of time minus L in Prepare data, then run this analysis on it.

Sources: Kaplan EL, Meier P (1958), Journal of the American Statistical Association 53(282):457-481, doi:10.1080/01621459.1958.10501452. Bland JM, Altman DG (1998), Survival probabilities (the Kaplan-Meier method), BMJ 317:1572, doi:10.1136/bmj.317.7172.1572.

Worked examples

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

survival::lung (status recoded 0/1)

  • Source: Published dataset distributed with an R package
  • Licence: survival (GPL)
  • Reference: Loprinzi et al. (1994), J. Clinical Oncology 12(3)
QuantityCeleusIndependent computationPublished valueAgrees
p-value0.001311160.00131116-Yes

survival::aml (acute myelogenous leukemia, 23 patients)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: The survival package vignette (R package survival 3.8-6), survdiff example on aml: Chisq = 3.4 on 1 degree of freedom, p = 0.07
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic3.396393.396393.4Yes
p-value0.06533930.06533930.07Yes
Median survival time by group31, 2331, 23-Yes
Effect size2.498112.49811-Yes

survival::ovarian, treatment arm rx = 1 (13 patients)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Edmonson et al. (1979), Cancer Treatment Reports 63; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic4.625054.62505-Yes
p-value0.03150830.0315083-Yes
Effect size8.007578.00757-Yes

survival::colon, recurrence records (etype = 2; 929 patients, 3 arms)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Moertel et al. (1990), New England Journal of Medicine 322; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic11.683111.6831-Yes
Degrees of freedom22-Yes
p-value0.002904350.00290435-Yes

survival::nafld1 (17549 subjects; large n)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Allen et al. (2018), Hepatology 67; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic11.294811.2948-Yes
p-value0.0007772250.000777225-Yes
Number of events13641364-Yes

survival::lung, sex recoded as 0 and 5 (a numeric code for two groups)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Loprinzi et al. (1994), Journal of Clinical Oncology 12(3); independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic10.326710.3267-Yes
Effect size0.5880030.588003-Yes

survival::lung, status written as the words 'died' / 'survived'

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Loprinzi et al. (1994), Journal of Clinical Oncology 12(3); independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic10.326710.3267-Yes
Number of events165165-Yes

Validation report

References

  1. Kaplan, E. L., Meier, P. (1958). Nonparametric estimation from incomplete observations. Journal of the American Statistical Association 53: 457-481. doi:10.1080/01621459.1958.10501452 doi:10.1080/01621459.1958.10501452
  2. Mantel, N. (1966). Evaluation of survival data and two new rank order statistics arising in its consideration. Cancer Chemotherapy Reports 50: 163-170.