Two-arm trial
survival::aml · Miller 1997
Create a Kaplan-Meier survival curve with number at risk from patient data or a survival table.
survival::aml · Miller 1997
survival::lung · Loprinzi 1994
survival::veteran · Kalbfleisch & Prentice
survival::lung · Loprinzi 1994
survival::gbsg · Schumacher 1994
survival::ovarian · Edmonson 1979
Illustrative data
Illustrative data
Paste time, event, and an optional group.
Check the event and censor counts.
Choose confidence intervals and censor marks.
Save your figure as PNG or SVG.
A drop represents an event.
Marks indicate observations censored at that time.
The band shows uncertainty in the estimate.
The median is where survival reaches one half.
The table shows people still under observation.
The Kaplan-Meier estimate is the product S(t) = ∏(1 − dᵢ/nᵢ), where dᵢ events occur among nᵢ people at risk. At a shared time, events are counted before censoring. Greenwood’s formula estimates variance; the default confidence interval uses the log method.
The log-rank test compares groups across follow-up. The univariable Cox model estimates hazard ratios relative to the first group. In the presence of competing risks, 1 − KM is not a cumulative incidence function.
Sources: Kaplan and Meier (1958); Greenwood (1926); Morris et al., KMunicate (2019); Mantel (1966); Peto and Peto (1972); Brookmeyer and Crowley (1982); Efron (1977).
For patient data, use long format such as time,event,group followed by 5,1,Treatment; omit group for one group. Prism-style wide tables use time and one column per group, with 1 for an event and 0 for censoring. You can also supply a table such as time,survival,lower,upper followed by 5,0.8,0.7,0.9.
A censored observation is one for which the event was not observed during follow-up. A tick marks its time on the curve.
The log-rank test compares the survival experience of groups over follow-up. When curves cross, a single overall test may mask differences that change direction over time.
It is the number of people still under observation and event-free immediately before each time.
The median is the first time estimated survival reaches or falls below 0.5; a plateau exactly at 0.5 follows the R midpoint rule. If 0.5 is not reached, it is shown as NR.
No. It comes from a univariable Cox model, with the first group as reference. The proportional hazards assumption matters; use Annotation for an adjusted result.
Checked against R survival 3.8.12. Log, log-log and plain confidence intervals use different transformations and can give different limits in R, SPSS or Prism. Prism ignores observations at time zero.
Data stays in your browser. A draft survives refresh in this tab and is cleared when the tab closes. Remove identifying information before publication.
Turn survival data into a figure ready to share.