Survival · 2 groups

Kaplan–Meier example: lung cancer survival by sex

Kaplan–Meier curves of 228 patients with advanced lung cancer (NCCTG), women vs men, with number at risk, log-rank test and Cox hazard ratio.

Open this example in the editorStart from scratch

020040060080010000.00.20.40.60.81.0Survival probabilityDays since enrolmentMale (n = 138)Female (n = 90)Log-rank P = 0.001HR 0.59 (95% CI 0.42–0.82)Number at riskMale13878311362Female9066261120
Overall survival of 228 patients with advanced lung cancer by sex, with 95% confidence bands and the number at risk.

About this example

The NCCTG lung cancer data (Loprinzi et al., J Clin Oncol 1994) ship with R’s survival package and are the most widely used example of a Kaplan–Meier analysis: 228 patients with advanced lung cancer, followed for up to about 1,000 days.

Women lived longer than men: median survival was 426 days (95% CI 348 to 550) against 270 days (212 to 310), log-rank P = 0.001, and the hazard ratio for women was 0.59 (95% CI 0.42 to 0.82). CleanFigure reproduces these numbers from R exactly. The number-at-risk table shows how few patients remain beyond 800 days, where the curves are least certain.

The data

DaysStatusSex
3061Male
4551Male
10100Male
2101Male
8831Male
10220Male
3101Female
3611Female
2181Male
1661Male
1701Male
6541Female
7281Female
711Male
5671Male

…and 213 more rows. Open the example to see all of them.

Open the example, replace the data with your own, and export the figure as SVG, PDF, PNG or TIFF.

More examples