Purpose
Computes and plots the Kaplan-Meier and Nelson-Aalen nonparametric estimates of the survival function and related quantities.
Syntax
KM {NOPLOT | SURV | NASURV | CHAZ | LCHAZ | HAZA | LHAZA}
{TLIMIT nlb nub} {TMIN nlb} {TMAX nub} {LTIME}
{YLIMIT nlb nub} {YMIN nlb} {YMAX nub}
{NOTABLE} (FROM nlb} {TO nub}
{BY clist}
{AS fname} @
Programs
PEANUTS
Arguments and Subcommands
NOPLOT
Do not print any plots.
SURV
Plot the Kaplan-Meier survival curve estimate against time or log time. This is the default plot.
NASURV
Plot the Nelson-Aalen survival curve estimate against time or log time.
CHAZ
Plot the cumulative hazard function against time or log time. This is the same as plotting minus the log of the Nelson-Aalen estimate.
LCHAZ
Plot the log cumulative hazard function against time or log time.
HAZA
Plot the hazard function against time or log time.
LHAZA
Plot the log hazard function against time or log time.
TLIMIT nlb nub
Define explicit upper and lower bounds for the time scale. These values should be given in time units even if a log time scale is requested.
TMIN nlb
Define explicit lower bound for the time scale. This value should be given in time units even if a log time scale is requested.
TMAX nub
Define explicit upper bound for the time scale. This value should be given in time units even if a log time scale is requested.
LTIME
Use log (10) time instead of time for the X-axis
YLIMIT nlb nub
Define explicit upper and lower bounds for the Y-axis axis (survival probability, hazard function cumulative hazard).
YMIN nlb
Define explicit lower bound for the Y-axis (survival probability, hazard function cumulative hazard).
YMAX nub
Define explicit upper bound for the time scale. This value should be given in time units even if a log time scale is requested.
BY clist
Specify a list of up to 10 categorical variables used to define strata within which separate Kaplan-Meier estimates are computed. If a list of BY variables is given it takes precedence over any stratification variables that are in effect. When BY variables are specified, a separate plot is given for each combination of BY variable values.
NOTABLE
Suppresses printing of the full life table to the log file. In this case a summary of the survival distribution is written to the log file. This summary contains the times corresponding to the estimated 90th, 75th, 50t, 25th, and 10th percentiles of the survival distribution.
FROM nlb
Lower bound of times to be shown in the life table written to the log file. This affects only what is shown in the log file when the TABLE specified.
TO nub
Upper bound of times to be shown in the life table written to the log file. This affects only what is shown in the log file when the TABLE specified.
AS fname
Write the life table data to a file. The file is comma separated text file with one line for each failure time in each stratum. The following table give the variables names and their definitions.
|
Name |
Comments and Notes |
|
strno |
Stratum number |
|
time |
Event time |
|
events |
Number of events at this time in the stratum |
|
natrisk |
Number at risk at this timein the stratum |
|
kmhaz |
Kaplan-Meier hazard function estimate |
|
Kmchaz |
Kaplan-Meier cumulative hazard estimate |
|
kmsprob |
Kaplan-Meier survival probability estimate |
|
nasprob |
Nelson-Aalen survival probability estimate |
|
gwvar |
Greenwood’s variance estimate for the Kaplan-Meier survival probability estimate |
Remarks
If the STRATA command has been used to define one or more stratification variables, a separate table is produced for each stratum. The plot includes a separate curve for each stratum. Because of the low resolution of current EPICURE plots, plots with many strata are difficult to read. If higher quality plots are desired, you can write the life table data to a file which can be easily imported into a graphics program of your choice. As noted above you can use the BY subcommand to produce separate plots for each distinct set of values of a set of stratifying (categorical) variables. When the BY subcommand is used it takes precedence over any stratification variables specified using the STRATA command.
When there is no stratification, the output file contains the following items: the event time, the number of events at this time, the number at risk at this time, the Kaplan-Meier hazard function estimate, the cumulative hazard, the Kaplan-Meier survival probability estimate, the Nelson-Aalen survival probability estimate, and Greenwood’s variance estimate for the Kaplan-Meier survival probability estimate. A good modern reference for these methods is Andersen, Borgan et al. (1992). When there are strata, each record in the output file beings with a strata number. Strata are numbered from 1 to N where N is the number of stratum.
The SMOOTH command can be used to estimate and plot the smoothed hazard function The BY subcommand should not be used if you wish to produce stratum-specific smoothed hazard function estimates using the SMOOTH command. Rather you should use the STRATA command to specify the stratification variables and give the KM command without the BY subcommand, prior to the requesting the smoothed fit. The KM command is used in the V2FEAT.PNT example.
Examples
a) To print a survival table and plot the Kaplan-Meier survival probability curve estimate against time:
KM @
b) To print a table for each treatment type and plot a separate survival curve for each type.
LEVEL trmnt @
KM BY trmnt @
c) To produce a single plot with the survival curves for each treatment type. Plots of the smoothed treatment-specific hazard functions with a bandwidth of 100 are produced.
STRATA trmnt @
KM @
SMOOTH 100 NOTABLE @
d) To suppress the table, and plot the survival curve between time 0 and 300:
KM TLIMIT 0 300 NOTABLE @
e) To write the life table data to a file called LUNGKM.OUT:
KM TO lungkm.out @
The first few lines of the file look like this:
|
8.00000 |
2 |
21 |
0.952381E-01 |
0.952381E-01 |
0.904762 |
0.909156 |
0.640564E-01 |
|
10.0000 |
1 |
19 |
0.526316E-01 |
0.147870 |
0.857143 |
0.862544 |
0.763604E-01 |
|
11.0000 |
1 |
18 |
0.555556E-01 |
0.203425 |
0.809524 |
0.815931 |
0.856891E-01 |
|
12.0000 |
2 |
17 |
0.117647 |
0.321072 |
0.714286 |
0.725371 |
0.985808E-01 |