The LIFETEST Procedure

Example 72.1 Product-Limit Estimates and Tests of Association

(View the complete code for this example.)

The data presented in Appendix I of Kalbfleisch and Prentice (1980) are coded in the following DATA step. The response variable, SurvTime, is the survival time in days of a lung cancer patient. Negative values of SurvTime are censored values. The covariates are Cell (type of cancer cell), Therapy (type of therapy: standard or test), Prior (prior therapy: 0=no, 10=yes), Age (age in years), DiagTime (time in months from diagnosis to entry into the trial), and Kps (performance status). A censoring indicator variable Censor is created from the data, with the value 1 indicating a censored time and the value 0 indicating an event time. Since there are only two types of therapy, an indicator variable, Treatment, is constructed for therapy type, with value 0 for standard therapy and value 1 for test therapy.

data VALung;
   drop check m;
   retain Therapy Cell;
   infile cards column=column;
   length Check $ 1;
   label SurvTime='Failure or Censoring Time'
      Kps='Karnofsky Index'
      DiagTime='Months till Randomization'
      Age='Age in Years'
      Prior='Prior Treatment?'
      Cell='Cell Type'
      Therapy='Type of Treatment'
      Treatment='Treatment Indicator';
   M=Column;
   input Check $ @@;
   if M>Column then M=1;
   if Check='s'|Check='t' then input @M Therapy $ Cell $ ;
   else input @M SurvTime Kps DiagTime Age Prior @@;
   if SurvTime > .;
   censor=(SurvTime<0);
   SurvTime=abs(SurvTime);
   Treatment=(Therapy='test');
   datalines;
standard squamous
 72 60  7 69  0   411 70  5 64 10   228 60  3 38  0   126 60  9 63 10
118 70 11 65 10    10 20  5 49  0    82 40 10 69 10   110 80 29 68  0
314 50 18 43  0  -100 70  6 70  0    42 60  4 81  0     8 40 58 63 10
144 30  4 63  0   -25 80  9 52 10    11 70 11 48 10
standard small
 30 60  3 61  0   384 60  9 42  0     4 40  2 35  0    54 80  4 63 10
 13 60  4 56  0  -123 40  3 55  0   -97 60  5 67  0   153 60 14 63 10
 59 30  2 65  0   117 80  3 46  0    16 30  4 53 10   151 50 12 69  0
 22 60  4 68  0    56 80 12 43 10    21 40  2 55 10    18 20 15 42  0
139 80  2 64  0    20 30  5 65  0    31 75  3 65  0    52 70  2 55  0
287 60 25 66 10    18 30  4 60  0    51 60  1 67  0   122 80 28 53  0
 27 60  8 62  0    54 70  1 67  0     7 50  7 72  0    63 50 11 48  0
392 40  4 68  0    10 40 23 67 10
standard adeno
  8 20 19 61 10    92 70 10 60  0    35 40  6 62  0   117 80  2 38  0
132 80  5 50  0    12 50  4 63 10   162 80  5 64  0     3 30  3 43  0
 95 80  4 34  0
standard large
177 50 16 66 10   162 80  5 62  0   216 50 15 52  0   553 70  2 47  0
278 60 12 63  0    12 40 12 68 10   260 80  5 45  0   200 80 12 41 10
156 70  2 66  0  -182 90  2 62  0   143 90  8 60  0   105 80 11 66  0
103 80  5 38  0   250 70  8 53 10   100 60 13 37 10
test squamous
999 90 12 54 10   112 80  6 60  0   -87 80  3 48  0  -231 50  8 52 10
242 50  1 70  0   991 70  7 50 10   111 70  3 62  0     1 20 21 65 10
587 60  3 58  0   389 90  2 62  0    33 30  6 64  0    25 20 36 63  0
357 70 13 58  0   467 90  2 64  0   201 80 28 52 10     1 50  7 35  0
 30 70 11 63  0    44 60 13 70 10   283 90  2 51  0    15 50 13 40 10
test small
 25 30  2 69  0  -103 70 22 36 10    21 20  4 71  0    13 30  2 62  0
 87 60  2 60  0     2 40 36 44 10    20 30  9 54 10     7 20 11 66  0
 24 60  8 49  0    99 70  3 72  0     8 80  2 68  0    99 85  4 62  0
 61 70  2 71  0    25 70  2 70  0    95 70  1 61  0    80 50 17 71  0
 51 30 87 59 10    29 40  8 67  0
test adeno
 24 40  2 60  0    18 40  5 69 10   -83 99  3 57  0    31 80  3 39  0
 51 60  5 62  0    90 60 22 50 10    52 60  3 43  0    73 60  3 70  0
  8 50  5 66  0    36 70  8 61  0    48 10  4 81  0     7 40  4 58  0
140 70  3 63  0   186 90  3 60  0    84 80  4 62 10    19 50 10 42  0
 45 40  3 69  0    80 40  4 63  0
test large
 52 60  4 45  0   164 70 15 68 10    19 30  4 39 10    53 60 12 66  0
 15 30  5 63  0    43 60 11 49 10   340 80 10 64 10   133 75  1 65  0
111 60  5 64  0   231 70 18 67 10   378 80  4 65  0    49 30  3 37  0
;

In the following statements, PROC LIFETEST is invoked to compute the product-limit estimate of the survivor function for each type of cancer cell and to analyze the effects of the variables Age, Prior, DiagTime, Kps, and Treatment on the survival of the patients. These prognostic factors are specified in the TEST statement, and the variable Cell is specified in the STRATA statement. ODS Graphics must be enabled before producing graphs. Graphical displays of the product-limit estimates (S), the negative log estimates (LS), and the log of negative log estimates (LLS) are requested through the PLOTS= option in the PROC LIFETEST statement. Because of a few large survival times, a MAXTIME of 600 is used to set the scale of the time axis; that is, the time scale extends from 0 to a maximum of 600 days in the plots. The variable Therapy is specified in the ID statement to identify the type of therapy for each observation in the product-limit estimates. The OUTTEST option specifies the creation of an output data set named Test to contain the rank test matrices for the covariates.

ods graphics on;
proc lifetest data=VALung plots=(s,ls,lls) outtest=Test maxtime=600;
   time SurvTime*Censor(1);
   id Therapy;
   strata Cell;
   test Age Prior DiagTime Kps Treatment;
run;
ods graphics off;

Output 72.1.1 through Output 72.1.4 display the product-limit estimates of the survivor functions for the four cell types. Summary statistics of the survival times are also shown. The median survival times are 51 days, 156 days, 51 days, and 118 days for patients with adeno cells, large cells, small cells, and squamous cells, respectively.

Output 72.1.1: Estimation Results for Adeno Cells

The LIFETEST Procedure
 
Stratum 1: Cell Type = adeno

Product-Limit Survival Estimates
SurvTime SurvivalFailureSurvival Standard
Error
Number
Failed
Number
Left
Therapy
0.000 1.000000027 
3.000 0.96300.03700.0363126standard
7.000 0.92590.07410.0504225test
8.000 ...324standard
8.000 0.85190.14810.0684423test
12.000 0.81480.18520.0748522standard
18.000 0.77780.22220.0800621test
19.000 0.74070.25930.0843720test
24.000 0.70370.29630.0879819test
31.000 0.66670.33330.0907918test
35.000 0.62960.37040.09291017standard
36.000 0.59260.40740.09461116test
45.000 0.55560.44440.09561215test
48.000 0.51850.48150.09621314test
51.000 0.48150.51850.09621413test
52.000 0.44440.55560.09561512test
73.000 0.40740.59260.09461611test
80.000 0.37040.62960.09291710test
83.000*...179test
84.000 0.32920.67080.0913188test
90.000 0.28810.71190.0887197test
92.000 0.24690.75310.0850206standard
95.000 0.20580.79420.0802215standard
117.000 0.16460.83540.0740224standard
132.000 0.12350.87650.0659233standard
140.000 0.08230.91770.0553242test
162.000 0.04120.95880.0401251standard
186.000 01.0000.260test

Note:The marked survival times are censored observations.



Output 72.1.2: Estimation Results for Large Cells

The LIFETEST Procedure
 
Stratum 2: Cell Type = large

Product-Limit Survival Estimates
SurvTime SurvivalFailureSurvival Standard
Error
Number
Failed
Number
Left
Therapy
0.000 1.000000027 
12.000 0.96300.03700.0363126standard
15.000 0.92590.07410.0504225test
19.000 0.88890.11110.0605324test
43.000 0.85190.14810.0684423test
49.000 0.81480.18520.0748522test
52.000 0.77780.22220.0800621test
53.000 0.74070.25930.0843720test
100.000 0.70370.29630.0879819standard
103.000 0.66670.33330.0907918standard
105.000 0.62960.37040.09291017standard
111.000 0.59260.40740.09461116test
133.000 0.55560.44440.09561215test
143.000 0.51850.48150.09621314standard
156.000 0.48150.51850.09621413standard
162.000 0.44440.55560.09561512standard
164.000 0.40740.59260.09461611test
177.000 0.37040.62960.09291710standard
182.000*...179standard
200.000 0.32920.67080.0913188standard
216.000 0.28810.71190.0887197standard
231.000 0.24690.75310.0850206test
250.000 0.20580.79420.0802215standard
260.000 0.16460.83540.0740224standard
278.000 0.12350.87650.0659233standard
340.000 0.08230.91770.0553242test
378.000 0.04120.95880.0401251test
553.000 01.0000.260standard

Note:The marked survival times are censored observations.



Output 72.1.3: Estimation Results for Small Cells

The LIFETEST Procedure
 
Stratum 3: Cell Type = small

Product-Limit Survival Estimates
SurvTime SurvivalFailureSurvival Standard
Error
Number
Failed
Number
Left
Therapy
0.000 1.000000048 
2.000 0.97920.02080.0206147test
4.000 0.95830.04170.0288246standard
7.000 ...345standard
7.000 0.91670.08330.0399444test
8.000 0.89580.10420.0441543test
10.000 0.87500.12500.0477642standard
13.000 ...741standard
13.000 0.83330.16670.0538840test
16.000 0.81250.18750.0563939standard
18.000 ...1038standard
18.000 0.77080.22920.06071137standard
20.000 ...1236standard
20.000 0.72920.27080.06411335test
21.000 ...1434standard
21.000 0.68750.31250.06691533test
22.000 0.66670.33330.06801632standard
24.000 0.64580.35420.06901731test
25.000 ...1830test
25.000 0.60420.39580.07061929test
27.000 0.58330.41670.07122028standard
29.000 0.56250.43750.07162127test
30.000 0.54170.45830.07192226standard
31.000 0.52080.47920.07212325standard
51.000 ...2424standard
51.000 0.47920.52080.07212523test
52.000 0.45830.54170.07192622standard
54.000 ...2721standard
54.000 0.41670.58330.07122820standard
56.000 0.39580.60420.07062919standard
59.000 0.37500.62500.06993018standard
61.000 0.35420.64580.06903117test
63.000 0.33330.66670.06803216standard
80.000 0.31250.68750.06693315test
87.000 0.29170.70830.06563414test
95.000 0.27080.72920.06413513test
97.000*...3512standard
99.000 ...3611test
99.000 0.22570.77430.06093710test
103.000*...379test
117.000 0.20060.79940.0591388standard
122.000 0.17550.82450.0567397standard
123.000*...396standard
139.000 0.14630.85370.0543405standard
151.000 0.11700.88300.0507414standard
153.000 0.08780.91220.0457423standard
287.000 0.05850.94150.0387432standard
384.000 0.02930.97070.0283441standard
392.000 01.0000.450standard

Note:The marked survival times are censored observations.



Output 72.1.4: Estimation Results for Squamous Cells

The LIFETEST Procedure
 
Stratum 4: Cell Type = squamous

Product-Limit Survival Estimates
SurvTime SurvivalFailureSurvival Standard
Error
Number
Failed
Number
Left
Therapy
0.000 1.000000035 
1.000 ...134test
1.000 0.94290.05710.0392233test
8.000 0.91430.08570.0473332standard
10.000 0.88570.11430.0538431standard
11.000 0.85710.14290.0591530standard
15.000 0.82860.17140.0637629test
25.000 0.80000.20000.0676728test
25.000*...727standard
30.000 0.77040.22960.0713826test
33.000 0.74070.25930.0745925test
42.000 0.71110.28890.07721024standard
44.000 0.68150.31850.07941123test
72.000 0.65190.34810.08131222standard
82.000 0.62220.37780.08281321standard
87.000*...1320test
100.000*...1319standard
110.000 0.58950.41050.08471418standard
111.000 0.55670.44330.08611517test
112.000 0.52400.47600.08701616test
118.000 0.49120.50880.08751715standard
126.000 0.45850.54150.08761814standard
144.000 0.42570.57430.08731913standard
201.000 0.39300.60700.08652012test
228.000 0.36020.63980.08522111standard
231.000*...2110test
242.000 0.32420.67580.0840229test
283.000 0.28820.71180.0820238test
314.000 0.25220.74780.0793247standard
357.000 0.21610.78390.0757256test
389.000 0.18010.81990.0711265test
411.000 0.14410.85590.0654274standard
467.000 0.10810.89190.0581283test
587.000 0.07200.92800.0487292test
991.000 0.03600.96400.0352301test
999.000 01.0000.310test

Note:The marked survival times are censored observations.



The distribution of event and censored observations among the four cell types is summarized in Output 72.1.5.

Output 72.1.5: Summary of Censored and Uncensored Values

Summary of the Number of Censored and Uncensored Values
StratumCellTotalFailedCensored Percent
Censored
1adeno272613.70
2large272613.70
3small484536.25
4squamous3531411.43
Total 13712896.57


The graph of the estimated survivor functions is shown in Output 72.1.6. The adeno cell curve and the small cell curve are much closer to each other than they are to the large cell curve or the squamous cell curve. The survival rates of the adeno cell patients and the small cell patients decrease rapidly to approximately 29% in 90 days. Shapes of the large cell curve and the squamous cell curve are quite different, although both decrease less rapidly than those of the adeno and small cells. The squamous cell curve decreases more rapidly initially than the large cell curve, but the role is reversed in the later period.

Output 72.1.6: Graph of the Estimated Survivor Functions

Graph of the Estimated Survivor Functions


The graph of the negative log of the estimated survivor functions is displayed in Output 72.1.7. Output 72.1.8 displays the log of the negative log of the estimated survivor functions against the log of time.

Output 72.1.7: Graph of Negative Log of the Estimated Survivor Functions

Graph of Negative Log of the Estimated Survivor Functions


Output 72.1.8: Graph of Log of the Negative Log of the Estimated Survivor Functions

Graph of Log of the Negative Log of the Estimated Survivor Functions


Results of the homogeneity tests across cell types are given in Output 72.1.9. The log-rank and Wilcoxon statistics and their corresponding covariance matrices are displayed. Also given is a table that consists of the approximate chi-square statistics, degrees of freedom, and p-values for the log-rank, Wilcoxon, and likelihood ratio tests. All three tests indicate strong evidence of a significant difference among the survival curves for the four types of cancer cells (p < 0.0001).

Output 72.1.9: Homogeneity Tests across Cell Types

Rank Statistics
CellLog-RankWilcoxon
adeno10.306697.0
large-8.549-1085.0
small14.8981278.0
squamous-16.655-890.0

Covariance Matrix for the Log-Rank Statistics
Celladenolargesmallsquamous
adeno12.9662-4.0701-4.4087-4.4873
large-4.070124.1990-7.8117-12.3172
small-4.4087-7.811721.7543-9.5339
squamous-4.4873-12.3172-9.533926.3384

Covariance Matrix for the Wilcoxon Statistics
Celladenolargesmallsquamous
adeno121188-34718-46639-39831
large-34718151241-59948-56576
small-46639-59948175590-69002
squamous-39831-56576-69002165410

Test of Equality over Strata
TestChi-SquareDFPr >
Chi-Square
Log-Rank25.40373<.0001
Wilcoxon19.433130.0002
-2Log(LR)33.93433<.0001


Results of the log-rank test of the prognostic variables are shown in Output 72.1.10. The univariate test results correspond to testing each prognostic factor marginally. The joint covariance matrix of these univariate test statistics is also displayed. In computing the overall chi-square statistic, the partial chi-square statistics following a forward stepwise entry approach are tabulated.

Consider the log-rank test in Output 72.1.10. Since the univariate test for Kps has the largest chi-square (43.4747) among all the covariates, Kps is entered first. At this stage, the partial chi-square and the chi-square increment for Kps are the same as the univariate chi-square. Among all the covariates not in the model (Age, Prior, DiagTime, Treatment), Treatment has the largest approximate chi-square increment (1.7261) and is entered next. The approximate chi-square for the model that contains Kps and Treatment is 43.4747+1.7261=45.2008 with 2 degrees of freedom. The third covariate entered is Age. The fourth is Prior, and the fifth is DiagTime. The overall chi-square statistic in the last line of the output is the partial chi-square for including all the covariates. It has a value of 46.4200 with 5 degrees of freedom, which is highly significant (p < 0.0001).

Output 72.1.10: Log-Rank Test of the Prognostic Factors

Univariate Chi-Squares for the Log-Rank Test
Variable Test
Statistic
Standard
Error
Chi-SquarePr >
Chi-Square
Label
Age-40.7383105.70.14850.7000Age in Years
Prior-19.943546.98360.18020.6712Prior Treatment?
DiagTime-115.997.87081.40130.2365Months till Randomization
Kps1123.1170.343.4747<.0001Karnofsky Index
Treatment-4.20765.04070.69670.4039Treatment Indicator

Covariance Matrix for the Log-Rank Statistics
VariableAgePriorDiagTimeKpsTreatment
Age11175.4-301.2-892.2-2948.4119.3
Prior-301.22207.52010.978.613.9
DiagTime-892.22010.99578.7-2295.321.9
Kps-2948.478.6-2295.329015.661.9
Treatment119.313.921.961.925.4

Forward Stepwise Sequence of Chi-Squares for the Log-Rank Test
VariableDFChi-SquarePr >
Chi-Square
Chi-Square
Increment
Pr >
Increment
Label
Kps143.4747<.000143.4747<.0001Karnofsky Index
Treatment245.2008<.00011.72610.1889Treatment Indicator
Age346.3012<.00011.10040.2942Age in Years
Prior446.4134<.00010.11220.7377Prior Treatment?
DiagTime546.4200<.00010.006650.9350Months till Randomization


You can establish this forward stepwise entry of prognostic factors by passing the matrix corresponding to the log-rank test to the RSQUARE method in the REG procedure, as follows. PROC REG finds the sets of variables that yield the largest chi-square statistics.

data RSq;
   set Test;
   if _type_='LOG RANK';
   _type_='cov';
run;
proc print data=RSq;
run;
proc reg data=RSq(type=COV);
   model SurvTime=Age Prior DiagTime Kps Treatment
      / selection=rsquare;
   title 'All Possible Subsets of Covariates for the log-rank Test';
run;

Output 72.1.11 displays the univariate statistics and their covariance matrix for the log-rank test.

Output 72.1.11: Log-Rank Statistics and Covariance Matrix

Obs_TYPE__NAME_SurvTimeAgePriorDiagTimeKpsTreatment
1covSurvTime46.42-40.74-19.94-115.861123.14-4.208
2covAge-40.7411175.44-301.23-892.24-2948.45119.297
3covPrior-19.94-301.232207.462010.8578.6413.875
4covDiagTime-115.86-892.242010.859578.69-2295.3221.859
5covKps1123.14-2948.4578.64-2295.3229015.6261.945
6covTreatment-4.21119.3013.8721.8661.9525.409


Results of the best subset regression are shown in Output 72.1.12. The variable Kps generates the largest univariate test statistic among all the covariates, the pair Kps and Age generate the largest test statistic among any other pairs of covariates, and so on. The entry order of covariates is identical to that of PROC LIFETEST.

Output 72.1.12: Best Subset Regression from the REG Procedure

All Possible Subsets of Covariates for the log-rank Test

The REG Procedure
Model: MODEL1
Dependent Variable: SurvTime
 
R-Square Selection Method


 

Number in
Model
R-SquareVariables in Model
10.9366Kps
10.0302DiagTime
10.0150Treatment
10.0039Prior
10.0032Age
20.9737Kps Treatment
20.9472Age Kps
20.9417Prior Kps
20.9382DiagTime Kps
20.0434DiagTime Treatment
20.0353Age DiagTime
20.0304Prior DiagTime
20.0181Prior Treatment
20.0159Age Treatment
20.0075Age Prior
30.9974Age Kps Treatment
30.9774Prior Kps Treatment
30.9747DiagTime Kps Treatment
30.9515Age Prior Kps
30.9481Age DiagTime Kps
30.9418Prior DiagTime Kps
30.0456Age DiagTime Treatment
30.0438Prior DiagTime Treatment
30.0355Age Prior DiagTime
30.0192Age Prior Treatment
40.9999Age Prior Kps Treatment
40.9976Age DiagTime Kps Treatment
40.9774Prior DiagTime Kps Treatment
40.9515Age Prior DiagTime Kps
40.0459Age Prior DiagTime Treatment
51.0000Age Prior DiagTime Kps Treatment

 



Last updated: February 13, 2019