About this example
The Veterans’ Administration lung cancer trial (Kalbfleisch and Prentice, 1980) compares survival across four histological cell types. With more than two groups, the log-rank test has k − 1 degrees of freedom and tests whether any group differs.
Four curves are easier to tell apart with both color and line type, which also keeps the figure readable in black and white. The time axis stops at 600 days, where only a few patients are still at risk; hazard ratios against squamous cell carcinoma are in the methods text rather than on the plot.
The data
| Days | Died | Celltype |
|---|---|---|
| 72 | 1 | squamous |
| 411 | 1 | squamous |
| 228 | 1 | squamous |
| 126 | 1 | squamous |
| 118 | 1 | squamous |
| 10 | 1 | squamous |
| 82 | 1 | squamous |
| 110 | 1 | squamous |
| 314 | 1 | squamous |
| 100 | 0 | squamous |
| 42 | 1 | squamous |
| 8 | 1 | squamous |
| 144 | 1 | squamous |
| 25 | 0 | squamous |
| 11 | 1 | squamous |
…and 122 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.