The LIFETEST Procedure

PROC LIFETEST Statement

  • PROC LIFETEST <options>;

The PROC LIFETEST statement invokes the LIFETEST procedure. Optionally, this statement identifies an input data set and an output data set, and specifies the computation details of the survivor function estimation. Table 70.1 summarizes the options available in the PROC LIFETEST statement. These options are described in alphabetic order.

ODS Graphics is the preferred method of creating graphs. Many new features have been added to the ODS Graphics plots. For example, you can display the number of subjects at risk in a survival plot. For information about ODS Graphics options, see the PLOTS= option.

If no plotting options are specified, PROC LIFETEST displays a table that shows the product-limit estimate of the survivor function. If ODS Graphics is enabled, PROC LIFETEST also displays a plot of the estimated survivor function. Other options for displaying the estimated survivor function are documented in the section Plot Options Superseded by ODS Graphics.

Table 70.1: Options Available in the PROC LIFETEST Statement

Option

Description

Input and Output Data Sets

DATA=

Specifies the input SAS data set

OUTCIF=

Names an output data set to contain cumulative incidence function (CIF) estimates

OUTSURV=

Names an output data set to contain survivor function estimates

OUTTEST=

Names an output data set to contain rank test statistics for association of survival time with covariates

Nonparametric Estimation

ERROR=

Specifies the variance method of the CIF estimator

INTERVALS=

Specifies interval endpoints for life-table estimates

NELSON

Adds the Nelson-Aalen estimates

METHOD=

Specifies the method to compute survivor function

NINTERVAL=

Specifies the number of intervals for life-table estimates

WIDTH=

Specifies the width of intervals for life-table estimates

Confidence Limits for Survivorship

ALPHA=

Sets the confidence level for interval estimation estimates

BANDMAXTIME=

Specifies the maximum time for confidence band

BANDMINTIME=

Specifies the minimum time for confidence band

CONFBAND=

Specifies the type of confidence band in the OUTSURV= data set

CONFTYPE=

Specifies the transformation applied to the survivor function to obtain confidence limits

ODS Graphics

MAXTIME=

Specifies the maximum time value for plotting

PLOTS =

Specifies plots to display

Control Output

ATRISK

Adds the number of subjects at risk to the survival estimate table

NOPRINT

Suppresses the display of printed output

NOTABLE

Suppresses the display of survival function estimates

INTERVALS=

Displays only the estimate for the smallest time in each interval

NOLEFT

Suppresses the Number Left column in the survival estimate table

TIMELIST=

Specifies a list of time points to display the survival estimate

REDUCEOUT

Specifies that only INTERVAL= or TIMELIST= observations be listed in the OUTSURV= data set

Miscellaneous

ALPHAQT=

Sets the confidence level for survival time quartiles

CIFVAR

Displays the variance of the CIF estimator

MISSING

Allows missing values to be a stratum level

SINGULAR=

Sets the tolerance for testing singularity of covariance matrix of rank statistics

STDERR

Outputs the standard error for the survival estimators to the OUTSURV= data set

TIMELIM=

Specifies the time limit used to estimate the mean survival time and its standard error


ALPHA=$\alpha $

specifies the level of significance $\alpha $ for the $100(1-\alpha )$% confidence intervals for the survivor, hazard, and density functions. For example, the option ALPHA=0.05 requests the 95% confidence limits for the survivor function. The default value is 0.05.

ALPHAQT=$\alpha $

specifies the significance level $\alpha $ for the $100(1-\alpha )$% confidence intervals for the quartiles of the survival time. For example, the option ALPHAQT=0.05 requests a 95% confidence interval for the quartiles of the survival time. The default value is 0.05.

ATRISK

adds a column that represents the number of subjects at risk to the survival estimate table. Also added is a column that represents the number of events at each observed time. This option has no effect for the life-table method.

BANDMAXTIME=value
BANDMAX=value

specifies the maximum time for the confidence bands. The default is the largest observed event time. If the specified BANDMAX= time exceeds the largest observed event time, it is truncated to the largest observed event time.

BANDMINTIME=value
BANDMIN=value

specifies the minimum time for the confidence bands. The default is the smallest observed event time. For the equal-precision band, if the BANDMIN= value is less than the smallest observed event time, it is defaulted to the smallest observed event time.

CIFVAR

displays the variance of the cumulative incidence function (CIF) estimator for competing-risks data. By default, PROC LIFETEST displays the standard error of the CIF estimator.

CONFBAND=keyword

specifies the confidence bands to be output to the OUTSURV= data set. Confidence bands are available for METHOD=KM, METHOD=BRESLOW, or METHOD=FH. You can use the following keywords:

ALL

outputs both the Hall-Wellner and the equal-precision confidence bands.

EP

outputs the equal-precision confidence bands.

HW

outputs the Hall-Wellner confidence bands.

CONFTYPE=keyword

specifies the transformation applied to $S(t)$ to obtain the pointwise confidence intervals and the confidence bands for the survivor function in addition to the confidence intervals for the quartiles of the survival times. The following keywords can be used; the default is CONFTYPE=LOGLOG.

ASINSQRT

the arcsine-square root transformation,

\[ g(x) = \sin ^{-1} (\sqrt {x}) \]
LOGLOG

the log-log transformation,

\[ g(x) = \log (-\log (x)) \]

This is also referred to as the log cumulative hazard transformation since it applies the logarithmic function to the cumulative hazard function. Collett (1994) and Lachin (2000) refer to it as the complementary log-log transformation.

LINEAR

the identity transformation,

\[ g(x) = x \]
LOG

the logarithmic transformation,

\[ g(x)= \log (x) \]
LOGIT

the logit transformation,

\[ g(x)= \log \biggl ( \frac{x}{1-x} \biggr ) \]
DATA=SAS-data-set

names the SAS data set used by PROC LIFETEST. By default, the most recently created SAS data set is used.

ERROR=AALEN | DELTA

specifies the method of calculating the variance of the CIF estimator. When ERROR=AALEN, the variance estimator is based on the theory of counting process (Aalen 1978). When ERROR=DELTA, the delta method is used to compute the variance. By default, ERROR=AALEN. For more information, see the section Estimation of the CIF.

INTERVALS=values

specifies a list of interval endpoints for the life-table method. These endpoints must all be nonnegative numbers. The initial interval is assumed to start at zero whether or not zero is specified in the list. Each interval contains its lower endpoint but does not contain its upper endpoint. When this option is used with METHOD=KM, METHOD=BRESLOW, or METHOD=FH, it reduces the number of survival estimates displayed by showing only the estimates for the smallest time within each specified interval. The INTERVALS= option can be specified in any of the following ways:

$\bullet ~ $ a list separated by blanks

 

INTERVALS=1 3 5 7

$\bullet ~ $ a list separated by commas

 

INTERVALS=1,3,5,7

$\bullet ~ $ x to y

 

INTERVALS=1 to 7

$\bullet ~ $ x to y BY z

 

INTERVALS=1 to 7 by 1

$\bullet ~ $ a combination of the above

 

INTERVALS=1,3 to 5,7

For example, the specification

intervals=5,10 to 30 by 10

produces the set of intervals

\[ \{ [0,5), [5,10), [10,20), [20,30), [30,\infty ) \} \]
MAXTIME=value

specifies the maximum value of the time variable allowed on the plots so that outlying points do not determine the scale of the time axis of the plots. This option affects only the displayed plots and has no effect on any calculations.

METHOD=type

specifies the method to be used to compute the survival function estimates. Valid values for type are as follows:

BRESLOW

specifies that the Breslow estimates be computed. The Breslow estimator is the exponentiation of the negative Nelson-Aalen estimator of the cumulative hazard function.

FH

specifies that the Fleming-Harrington (FH) estimates be computed. The FH estimator is a tie-breaking modification of the Breslow estimator. If there are no tied event times, this estimator is the same as the Breslow estimator.

KM
PL

specifies that Kaplan-Meier estimates (also known as the product-limit estimates) be computed.

ACT
LIFE
LT

specifies that life-table estimates (also known as actuarial estimates) be computed.

By default, METHOD=KM.

MISSING

treats missing values as valid values for the stratum variables. By default, PROC LIFETEST does not use observations that have a missing value in any stratum variables. For more information, see the section Missing Values.

NELSON
AALEN

produces the Nelson-Aalen estimates of the cumulative hazards and the corresponding standard errors. This option is ignored if METHOD=LT is specified.

NINTERVAL=value

specifies the number of intervals used to compute the life-table estimates of the survivor function. This parameter is overridden by the WIDTH= option or the INTERVALS= option. When you specify the NINTERVAL= option, PROC LIFETEST tries to find an interval that results in round numbers for the endpoints. Consequently, the number of intervals can be different from the number requested. Use the INTERVALS= option to control the interval endpoints. The default is NINTERVAL=10.

NOLEFT

suppresses the Number Left and Number Event columns in the survival estimate table. This option has no effect for the life-table estimate.

NOPRINT

suppresses the display of output. This option is useful when only an output data set is needed. It temporarily disables the Output Delivery System (ODS); For more information about ODS, see Chapter 20: Using the Output Delivery System.

NOTABLE

suppresses the display of survival function estimates. Only the number of censored and event times, plots, and test results is displayed.

OUTCIF=SAS-data-set

creates an output SAS data set to contain the point and interval estimates for the cumulative incidence function (CIF). The data set also contains the number of subjects at risk, the number of events of interest, and the number of events of all types. For more information about the contents of the OUTCIF= data set, see the section OUTCIF= Data Set.

OUTSURV=SAS-data-set
OUTS=SAS-data-set

creates an output SAS data set to contain the estimates of the survival function and corresponding confidence limits for all strata. For more information about the contents of the OUTSURV= data set, see the section OUTSURV= Data Set.

OUTTEST=SAS-data-set
OUTT=SAS-data-set

creates an output SAS data set to contain the overall chi-square test statistic for association with failure time for the variables in the TEST statement, the values of the univariate rank test statistics for each variable in the TEST statement, and the estimated covariance matrix of the univariate rank test statistics. For more information about the contents of the OUTTEST= data set, see the section OUTTEST= Data Set.

PLOTS<(global-plot-options)>=plot-request <(options)>
PLOTS<(global-plot-options)>=(plot-request <(options)> <... plot-request <(options)>>)

controls the plots produced using ODS Graphics. When you specify only one plot-request, you can omit the parentheses around the plot-request. Here are some examples:

plots=none
plots=(survival(atrisk=100 to 350 by 50) logsurv)
plots(only)=hazard

ODS Graphics must be enabled before plots can be requested. For example:

ods graphics on;

proc lifetest plots=survival(atrisk);
   time T*Status(0);
run;

ods graphics off;

For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 21: Statistical Graphics Using ODS.

If ODS Graphics is enabled but you do not specify the PLOTS= option, PROC LIFETEST produces a plot of the survivor function estimates, unless you use the FAILCODE option in the TIME statement to stipulate a competing-risks analysis. In such a case, PROC LIFETEST creates a plot of the cumulative incidence function (CIF) estimates.

You can specify the following global-plot-option:

ONLY

specifies that only the specified plots in the list be produced; otherwise, the default survivor function plot is also displayed. This option has no effect if you use the FAILCODE option in the TIME statement to stipulate a competing-risks analysis.

The plot-requests and plot-request options include the following.

ALL

produces all appropriate plots. For METHOD=KM, METHOD=BRESLOW, or METHOD=FH, specifying PLOTS=ALL is equivalent to specifying PLOTS=(SURVIVAL LOGSURV LOGLOGLS HAZARD); for the life-table method, specifying PLOTS=ALL is equivalent to specifying PLOTS=(SURVIVAL LOGSURV LOGLOGS DENSITY HAZARD). For a competing-risks analysis, specifying PLOTS=ALL is equivalent to specifying PLOTS=CIF.

CIF<(cif-options)>

plots the cumulative incidence function (CIF) estimates. If you specify a STRATA statement without the GROUP= option, PROC LIFETEST overlays the cumulative incidence curves of the strata in the same plot. If you specify a STRATA statement with the GROUP= option, PROC LIFETEST produces a panel plot, with one cell per stratum, and each cell contains the cumulative incidence curves for the groups within the given stratum.

You can specify the following cif-options:

CL

displays pointwise confidence limits for CIF.

TEST

displays the p-value of Gray’s test (Gray 1988) for testing the homogeneity of CIFs.

HAZARD <(hazard-options)>
H <hazard-options>

plots the estimated hazard functions. Kernel-smoothed estimates are produced for METHOD=KM, METHOD=BRESLOW, or METHOD=FH. You can specify the following hazard-options, but only the CL option can be used for the life-table method:

BANDWIDTH=bandwidth-option
BW=bandwidth-option

specifies what bandwidth is chosen for the kernel-smoothing and how it is chosen. You can specify one of the following bandwidth-options.

value

sets the bandwidth to the given value.

numeric-list

selects the bandwidth from the given numeric-list that minimizes the mean integrated squared error.

RANGE(lower,upper)

selects the bandwidth from the interval (lower, upper) that minimizes the mean integrated squared error. PROC LIFETEST uses the golden section search algorithm to find the minimum. If there is more than one local minimum in the interval, there is no guarantee that the local minimum found is also the global minimum.

See the section Optimal Bandwidth for details about the mean integrated squared error. If the BANDWIDTH= option is not specified, the default is BANDWIDTH= RANGE(0.2b,20b), where $b= \frac{g_ u - g_ l}{8n^{.2}}$, $g_ l$ and $g_ u$ are the values of the GRIDL= and GRIDU= options, respectively, and n is the total number of noncensored observations.

GRIDL=number

specifies the lower grid limit for the kernel-smoothed estimate. The default value is the time origin.

GRIDU=number

specifies the upper grid limit for the kernel-smoothed estimate. The default value equals the maximum event time.

KERNEL=kernel-option

specifies the kernel used. The choices are as follows:

BIWEIGHT
BW

$ K_{\mi{BW}}(x) = \frac{15}{16}(1-x^2)^2, \hspace{1cm} -1\leq x \leq 1$

EPANECHNIKOV
E

$ K_ E(x) = \frac{3}{4}(1-x^2), \hspace{1cm} -1\leq x \leq 1$

UNIFORM
U

$ K_ U(x) = \frac{1}{2}, \hspace{1cm} -1\leq x \leq 1$

The default is KERNEL=EPANECHNIKOV.

NMINGRID=number

specifies the number of grid points in determining the mean integrated square error (MISE). The default value is 51.

NGRID=number

specifies the number of grid points. The default is 101.

CL

displays the pointwise confidence limits for the smoothed hazard.

LOGLOGS
LLS

plots the log of negative log of estimated survivor functions versus the log of time.

LOGSURV
LS

plots the negative log of estimated survivor functions versus time.

NONE

suppresses all plots.

PDF <(CL)>
P <(CL)>

plots the estimated probability density functions (life-table method only). Pointwise confidence limits are displayed optionally by specifying the CL option.

SURVIVAL <(survival-options)>
S <(survival-options)>

plots the estimated survivor functions. Censored times are plotted as a plus sign on the Kaplan-Meier, Breslow, or Fleming-Harrington survival curves unless the NOCENSOR option is specified. You can customize the display by using the following survival-options. If these options are not sufficient for your purposes, you can customize the survival plot by modifying its graph template. (For more information, see the section Modifying the Survival Plots.)

ATRISK <(options)> <=number-list>

displays the numbers of subjects at risk at the given times. You can specify the following options:

ATRISKTICK
ATRISKLABEL

guarantees that tick values are shown on the time axis for those times when the numbers of subjects at risk are displayed. If this option is not specified, you might not be able to tell at exactly which times the number of subjects at risk are displayed. If the ATRISKTICKONLY option is also specified, it takes precedence over the ATRISKTICK option.

ATRISKTICKONLY

specifies that tick values on the time axis be shown only at the times that are given in the ATRISK= list. If the ATRISKTICK option is also specified, it is ignored; that is, ATRISKTICKONLY takes precedence over ATRISKTICK.

MAXLEN=n

specifies the number of characters n that are allowed for displaying the stratum labels. If n is greater than or equal to the maximum length of the stratum labels, the stratum labels are used in the at-risk display; otherwise, the stratum numbers are used. The default is MAXLEN=12.

OUTSIDE<(p)>

specifies that the at-risk table be drawn outside the plot area. PROC LIFETEST uses a graph template that has a two-row lattice layout. The upper cell displays the survival plot, and the bottom cell displays the at-risk table. You can specify an optional number p that represents the fractional proportion of the at-risk table height relative to the overall grid height, but that specification is not necessary. By default, p is the preferred row weight in the GTL layout lattice statement that ensures that the plot displays well. If you specify a value of p too small for the table to be properly displayed, some of the rows might get cut off.

The number-list identifies the times when the numbers at risk are displayed. If the number-list is not specified, PROC LIFETEST displays the number of subjects at risk at each default tick value on the time axis of the survival plot.

CB <=keyword>

displays the confidence bands (that is, simultaneous confidence intervals) for the survivor functions. You can specify one of the following keywords. The default is CB=HW.

ALL

displays both the equal-precision and the Hall-Wellner bands.

EP

displays the equal-precision band.

HW

displays the Hall-Wellner confidence band.

CL

displays the pointwise confidence limits for the survivor functions.

FAILURE
F

changes all the displays for survivor functions to those for the failure functions. For example, if both the FAILURE and CL options are specified, the plot displays the failure curves in addition to the pointwise confidence limits for the failure functions.

NOCENSOR

suppresses the plotting of the censored times on a Kaplan-Meier, Breslow, or Fleming-Harrington survival curve.

STRATA=strata-option

specifies how to display the survival/failure curves for multiple strata. This option has no effect if there is only one stratum. You can choose one of the following strata options:

INDIVIDUAL
UNPACK

specifies that a separate plot be displayed for each stratum.

OVERLAY

specifies that the survival/failure curves for the strata be overlaid in one plot.

PANEL

specifies that separate plots for the strata be organized into panels of two or four plots, depending on the number of strata.

The default is STRATA=OVERLAY.

TEST

displays the p-value of a homogeneity test specified in the STRATA statement. If more than one test is produced, the test is chosen in the following order: LOGRANK, WILCOXON, TARONE, PETO, MODPETO, FLEMING, and LR.

REDUCEOUT

specifies that the OUTSURV= data set contain only those observations that are included in the INTERVALS= or TIMELIST= option. This option has no effect if the OUTSURV= option is not specified. It also has no effect if neither the INTERVALS= option nor the TIMELIST= option is specified.

SINGULAR=value

specifies the tolerance for testing singularity of the covariance matrix for the rank test statistics. The test requires that a pivot for sweeping a covariance matrix be at least this number times a norm of the matrix. The default value is 1E–12.

STDERR

specifies that the standard error of the survivor function (SDF_STDERR) be output to the OUTSURV= data set. If the life-table method is used, the standard error of the density function (PDF_STDERR) and the standard error of the hazard function (HAZ_STDERR) are also output.

TIMELIM=time-limit

specifies the time limit used in the estimation of the mean survival time and its standard error. The mean survival time can be shown to be the area under the Kaplan-Meier survival curve. However, if the largest observed time in the data is censored, the area under the survival curve is not a closed area. In such a situation, you can choose a time limit L and estimate the mean survival curve limited to a time L (Lee 1992, pp. 72–76). This option is ignored if the largest observed time is an event time. Valid time-limit values are as follows:

EVENT
LET

specifies that the time limit L be the largest event time in the data. TIMELIM=EVENT is the default.

OBSERVED
LOT

specifies that the time limit L be the largest observed time in the data.

number

specifies that the time limit L be the given number. The number must be positive and at least as large as the largest event time in the data.

TIMELIST=number-list

specifies a list of time points at which the Kaplan-Meier estimates are displayed. The time points are listed in the column labeled Timelist. Since the Kaplan-Meier survival curve is a decreasing step function, each given time point falls in an interval that has a constant survival estimate. The event time that corresponds to the beginning of the time interval is displayed along with its survival estimate.

WIDTH=value

sets the width of the intervals used in the life-table calculation of the survival function. This parameter is overridden by the INTERVALS= option.