Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The LIFETEST Procedure

Getting Started

You can use the LIFETEST procedure to compute nonparametric estimates of the survivor function and to compute rank tests for association of the response variable with other variables.

For simple analyses, only the PROC LIFETEST and TIME statements are required. Consider a sample of survival data. Suppose that the time variable is t and the censoring variable is c with value 1 indicating censored observations. The following statements compute the product-limit estimate for the sample:

   proc lifetest;
      time t*c(1);
   run;

You can use the STRATA statement to divide the data into various strata. A separate survivor function is then estimated for each stratum, and tests of the homogeneity of strata are performed. You can specify covariates in the TEST statement. PROC LIFETEST computes linear rank statistics to test the effects of these covariates on survival. For example, consider the results of a small randomized trial on rats. Suppose you assign forty rats exposed to a carcinogen into two treatment groups. The event of interest is death from cancer induced by the carcinogen. The response is the time from randomization to death. Four rats died of other causes; their survival times are regarded as censored observations. Interest lies in whether the survival distributions differ between the two treatments.

The data set Exposed contains four variables: Days (survival time in days from treatment to death), Status (censoring indicator variable: 0 if censored and 1 if not censored), Treatment (treatment indicator), and Sex (gender: F if female and M if male).

   data Exposed;
     input Days Status Treatment Sex $ @@;
     datalines;
   179   1   1   F   378   0   1   M
   256   1   1   F   355   1   1   M
   262   1   1   M   319   1   1   M
   256   1   1   F   256   1   1   M
   255   1   1   M   171   1   1   F
   224   0   1   F   325   1   1   M
   225   1   1   F   325   1   1   M
   287   1   1   M   217   1   1   F
   319   1   1   M   255   1   1   F
   264   1   1   M   256   1   1   F
   237   0   2   F   291   1   2   M
   156   1   2   F   323   1   2   M
   270   1   2   M   253   1   2   M
   257   1   2   M   206   1   2   F
   242   1   2   M   206   1   2   F
   157   1   2   F   237   1   2   M
   249   1   2   M   211   1   2   F
   180   1   2   F   229   1   2   F
   226   1   2   F   234   1   2   F
   268   0   2   M   209   1   2   F
   ;

PROC LIFETEST is invoked to compute the product-limit estimate of the survivor function for each treatment and to compare the survivor functions between the two treatments. In the TIME statement, the survival time variable, Days, is crossed with the censoring variable, Status, with the value 0 indicating censoring. That is, the values of Days are considered censored if the corresponding values of Status are 0; otherwise, they are considered as event times. In the STRATA statement, the variable Treatment is specified, which indicates that the data are to be divided into strata based on the values of Treatment. PROC LIFETEST computes the product-limit estimate for each stratum and tests whether the survivor functions are identical across strata.

   symbol1 c=blue; symbol2 c=orange;
   proc lifetest data=Exposed plots=(s,ls,lls);
      time Days*Status(0);
      strata Treatment;
   run;

The PLOTS= option in the PROC LIFETEST statement is used to request a plot of the estimated survivor function against time (by specifying S), a plot of the negative log of the estimated survivor function against time (by specifying LS), and a plot of the log of the negative log of the estimated survivor function against log time (by specifying LLS). The LS and LLS plots provide an empirical check of the appropriateness of the exponential model and the Weibull model, respectively, for the survival data (Kalbfleisch and Prentice 1980, Chapter 2).

If the exponential model is appropriate, the LS curve should be approximately linear through the origin. If the Weibull model is appropriate, the LLS curve should be approximately linear. Since there are more than one stratum, the LLS plot may also be used to check the proportional hazards model assumption. Under this assumption, the LLS curves should be approximately parallel across strata.

The results of the analysis are displayed in the following figures.

Figure 37.1 displays the product-limit survival estimate for the first stratum (Treatment=1). The figure lists, for each observed time, the survival estimate, failure rate, standard error of the estimate, number of failures, and number of subjects remaining in the study.

The SAS System

The LIFETEST Procedure

Stratum 1: Treatment = 1
Product-Limit Survival Estimates
Days   Survival Failure Survival Standard
Error
Number
Failed
Number
Left
0.000   1.0000 0 0 0 20
171.000   0.9500 0.0500 0.0487 1 19
179.000   0.9000 0.1000 0.0671 2 18
217.000   0.8500 0.1500 0.0798 3 17
224.000 * . . . 3 16
225.000   0.7969 0.2031 0.0908 4 15
255.000   . . . 5 14
255.000   0.6906 0.3094 0.1053 6 13
256.000   . . . 7 12
256.000   . . . 8 11
256.000   . . . 9 10
256.000   0.4781 0.5219 0.1146 10 9
262.000   0.4250 0.5750 0.1135 11 8
264.000   0.3719 0.6281 0.1111 12 7
287.000   0.3188 0.6813 0.1071 13 6
319.000   . . . 14 5
319.000   0.2125 0.7875 0.0942 15 4
325.000   . . . 16 3
325.000   0.1063 0.8938 0.0710 17 2
355.000   0.0531 0.9469 0.0517 18 1
378.000 * . . . 18 0

NOTE: The marked survival times are censored observations.

Figure 37.1: Product-Limit Survivor Function Estimate for Treatment=1

Figure 37.2 displays summary statistics of survival times for Treatment=1. It contains estimates of the 25th, 50th, and 75th percentiles and the corresponding 95% confidence limits.

The median survival time for rats in this treatment is 256 days. The mean and standard error are also displayed; however, it is noted that these values are underestimated because the largest observed time is censored and the estimation is restricted to the largest event time.

The LIFETEST Procedure

Quartile Estimates
Percent Point
Estimate
95% Confidence Interval
[Lower Upper)
75 319.000 262.000 325.000
50 256.000 255.000 319.000
25 255.000 217.000 256.000

Mean Standard Error
271.131 11.877

NOTE: The mean survival time and its standard error were underestimated because the largest observation was censored and the estimation was restricted to the largest event time.

Figure 37.2: Summary Statistics of Survival Times for Treatment=1

The LIFETEST Procedure

Stratum 2: Treatment = 2
Product-Limit Survival Estimates
Days   Survival Failure Survival Standard
Error
Number
Failed
Number
Left
0.000   1.0000 0 0 0 20
156.000   0.9500 0.0500 0.0487 1 19
157.000   0.9000 0.1000 0.0671 2 18
180.000   0.8500 0.1500 0.0798 3 17
206.000   . . . 4 16
206.000   0.7500 0.2500 0.0968 5 15
209.000   0.7000 0.3000 0.1025 6 14
211.000   0.6500 0.3500 0.1067 7 13
226.000   0.6000 0.4000 0.1095 8 12
229.000   0.5500 0.4500 0.1112 9 11
234.000   0.5000 0.5000 0.1118 10 10
237.000   0.4500 0.5500 0.1112 11 9
237.000 * . . . 11 8
242.000   0.3938 0.6063 0.1106 12 7
249.000   0.3375 0.6625 0.1082 13 6
253.000   0.2813 0.7188 0.1038 14 5
257.000   0.2250 0.7750 0.0971 15 4
268.000 * . . . 15 3
270.000   0.1500 0.8500 0.0891 16 2
291.000   0.0750 0.9250 0.0693 17 1
323.000   0 1.0000 0 18 0

NOTE: The marked survival times are censored observations.

Figure 37.3: Product-Limit Survivor Function Estimate for Treatment=2

Figure 37.3 and Figure 37.4 display the survival estimates and the summary statistics of the survival times for Treatment=2. The median survival time for rats in this treatment is 235 days.

The LIFETEST Procedure

Quartile Estimates
Percent Point
Estimate
95% Confidence Interval
[Lower Upper)
75 257.000 237.000 291.000
50 235.500 209.000 253.000
25 207.500 180.000 234.000

Mean Standard Error
235.156 10.211

Figure 37.4: Survival Times Summary for Treatment=2

A summary of the number of censored and event observations is shown in Figure 37.5. The figure lists, for each stratum, the number of event and censored observations, and the percentage of censored observations.

The LIFETEST Procedure

Summary of the Number of Censored and Uncensored Values
Stratum Treatment Total Failed Censored Percent
Censored
1 1 20 18 2 10.00
2 2 20 18 2 10.00
Total   40 36 4 10.00

Figure 37.5: Summary of Censored and Uncensored Values

Figure 37.6 displays the graph of the product-limit survivor function estimates versus survival time. The two treatments differ primarily at larger survival times.

lftg6.gif (5300 bytes)

Figure 37.6: Product-Limit Survivor Functions

Figure 37.7 displays the graph of the log survival function estimates versus survival time for the two treatments. Neither curve approximates a straight line through the origin; therefore, the exponential model is not appropriate for the survival data.

lftg7.gif (3724 bytes)

Figure 37.7: Log Survivor Function Estimates

Figure 37.8 displays the graph of the negative log-log survivor function estimates versus log time for the two treatments.

lftg8.gif (3685 bytes)

Figure 37.8: Log of Negative Log Survivor Function Estimates

The LIFETEST Procedure

Test of Equality over Strata
Test Chi-Square DF Pr >
Chi-Square
Log-Rank 5.6485 1 0.0175
Wilcoxon 5.0312 1 0.0249
-2Log(LR) 0.1983 1 0.6561

Figure 37.9: Tests for Strata Homogeneity

Results of the comparison of survival curves between the two treatments are shown in Figure 37.9. The rank tests for homogeneity indicate a significant difference between the treatments (p=0.0175 for the log-rank test and p=0.0249 for the Wilcoxon test). Rats in Treatment=1 live significantly longer than those in Treatment=2. The log-rank test, which places more weight on larger survival times, is more significant than the Wilcoxon test, which places more weight on early survival times. As noted earlier, the exponential model is not appropriate for the given survival data; consequently, the result of the likelihood ratio test should be ignored.

Next, suppose that gender is thought to be related to survival time, and you want to study the treatment effect while adjusting for the gender of the rats. By specifying the variable Sex in the STRATA statement and by specifying the variable Treatment in the TEST statement, you can test the effect of Treatment while adjusting for the effect of Sex. The log-rank and Wilcoxon linear rank statistics are computed by pooling over the strata defined by the values of Sex, thus adjusting for the effect of Sex.

The NOTABLE option is added to the PROC LIFETEST statement to avoid estimating a survival curve for each gender.

   proc lifetest data=Exposed notable;
      time Days*Status(0);
      strata Sex;
      test Treatment;
   run;

Results of the linear rank tests are shown in Figure 37.10. The treatment effect is statistically significant for both the Wilcoxon test (p=0.0147) and the log-rank test (p=0.0075). As compared to the results of the homogenity test in Figure 37.9, the significance of the treatment effect has been sharpened by controlling for the effect of the gender of the subjects.

The LIFETEST Procedure

Univariate Chi-Squares for the Wilcoxon Test
Variable Test
Statistic
Standard
Deviation
Chi-Square Pr >
Chi-Square
Treatment -4.2372 1.7371 5.9503 0.0147

Univariate Chi-Squares for the Log-Rank Test
Variable Test
Statistic
Standard
Deviation
Chi-Square Pr >
Chi-Square
Treatment -6.8021 2.5419 7.1609 0.0075

Figure 37.10: Tests for Association of Time with Covariates

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.