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%
Related methods
Other methods under Survival and censored data:
- Peto-Peto generalized Wilcoxon test
- Censored regression (Tobit-style)
- Cox proportional-hazards regression
- Weibull accelerated failure time regression
- Factors associated with outcome (time-to-event outcome)
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)
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| p-value | 0.00131116 | 0.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 3.39639 | 3.39639 | 3.4 | Yes |
| p-value | 0.0653393 | 0.0653393 | 0.07 | Yes |
| Median survival time by group | 31, 23 | 31, 23 | - | Yes |
| Effect size | 2.49811 | 2.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 4.62505 | 4.62505 | - | Yes |
| p-value | 0.0315083 | 0.0315083 | - | Yes |
| Effect size | 8.00757 | 8.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 11.6831 | 11.6831 | - | Yes |
| Degrees of freedom | 2 | 2 | - | Yes |
| p-value | 0.00290435 | 0.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 11.2948 | 11.2948 | - | Yes |
| p-value | 0.000777225 | 0.000777225 | - | Yes |
| Number of events | 1364 | 1364 | - | 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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 10.3267 | 10.3267 | - | Yes |
| Effect size | 0.588003 | 0.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic | 10.3267 | 10.3267 | - | Yes |
| Number of events | 165 | 165 | - | Yes |
References
- 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
- Mantel, N. (1966). Evaluation of survival data and two new rank order statistics arising in its consideration. Cancer Chemotherapy Reports 50: 163-170.