### SAS Textbook Examples Applied Survival Analysis by Hosmer, Lemeshow and May Chapter 3: Regression Models for Survival Data

The actg320 and whas100 data sets are used in this chapter.

Table 3.1 on page 78 using the actg320 dataset. The z value and confidence intervals are not provided in the proc phreg output, but the confidence interval can be calculated manually.  For example, the lower confidence interval limit will be -.68425 - .21492*1.96 =  -1.1054.

proc phreg data = actg320;
model time*censor(0) = tx;
run;

The PHREG Procedure

Model Information

Data Set                 WORK.ACTG320
Dependent Variable       TIME
Censoring Variable       CENSOR
Censoring Value(s)       0
Ties Handling            BRESLOW

Number of Observations Read        1151
Number of Observations Used        1151

Summary of the Number of Event and Censored Values

Percent
Total       Event    Censored    Censored

1151          96        1055       91.66

Convergence Status

Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics

Without           With
Criterion     Covariates     Covariates

-2 LOG L        1316.931       1306.236
AIC             1316.931       1308.236
SBC             1316.931       1310.800

Testing Global Null Hypothesis: BETA=0

Test                 Chi-Square       DF     Pr > ChiSq

Likelihood Ratio        10.6952        1         0.0011
Score                   10.5399        1         0.0012
Wald                    10.1365        1         0.0015

Analysis of Maximum Likelihood Estimates

Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio

TX          1     -0.68425      0.21492      10.1365       0.0015      0.504

Table 3.2, page 83 using the actg320 dataset.
NOTE:  The formula for z is on page 79 and the formula for CI is on page 80.
NOTE:  The standard error for age is different than that shown in the text.

ods output ParameterEstimates=out1;
proc phreg data = actg320;
model time*censor(0) = tx age sex cd4 priorzdv;
run;
The PHREG Procedure

Model Information

Data Set                 WORK.ACTG320
Dependent Variable       TIME
Censoring Variable       CENSOR
Censoring Value(s)       0
Ties Handling            BRESLOW

Number of Observations Read        1151
Number of Observations Used        1151

Summary of the Number of Event and Censored Values

Percent
Total       Event    Censored    Censored

1151          96        1055       91.66

Convergence Status

Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics

Without           With
Criterion     Covariates     Covariates

-2 LOG L        1316.931       1237.651
AIC             1316.931       1247.651
SBC             1316.931       1260.473

Testing Global Null Hypothesis: BETA=0

Test                 Chi-Square       DF     Pr > ChiSq

Likelihood Ratio        79.2798        5         <.0001
Score                   63.1500        5         <.0001
Wald                    55.7066        5         <.0001
                  Analysis of Maximum Likelihood Estimates

Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio

TX          1     -0.65899      0.21529       9.3695       0.0022      0.517
AGE         1      0.02836      0.01127       6.3353       0.0118      1.029
SEX         1      0.09727      0.28412       0.1172       0.7321      1.102
CD4         1     -0.01658      0.00255      42.4134       <.0001      0.984
PRIORZDV    1   -0.0002931      0.00369       0.0063       0.9367      1.000
data out2;
set out1;
z = sqrt(chisq);
z2 = estimate /stderr;
lb = estimate-1.96*stderr;
ub = estimate+1.96*stderr;
run;

proc print data = out2;
var variable estimate stderr z z2 probchisq lb ub;
format estimate z z2 probchisq lb ub f8.3;
format stderr f8.4;
run;
ProbChi
Variable  Estimate    StdErr         z        z2        Sq        lb        ub

TX          -0.659    0.2153     3.061    -3.061     0.002    -1.081    -0.237
AGE          0.028    0.0113     2.517     2.517     0.012     0.006     0.050
SEX          0.097    0.2841     0.342     0.342     0.732    -0.460     0.654
CD4         -0.017    0.0025     6.513    -6.513     0.000    -0.022    -0.012
PRIORZDV    -0.000    0.0037     0.079    -0.079     0.937    -0.008     0.007

Table 3.3, page 84 using the actg320 dataset.

proc phreg data = actg320;
model time*censor(0) = tx age cd4;
run;
The PHREG Procedure

Model Information

Data Set                 WORK.ACTG320
Dependent Variable       TIME
Censoring Variable       CENSOR
Censoring Value(s)       0
Ties Handling            BRESLOW

Number of Observations Read        1151
Number of Observations Used        1151

Summary of the Number of Event and Censored Values

Percent
Total       Event    Censored    Censored

1151          96        1055       91.66

Convergence Status

Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics

Without           With
Criterion     Covariates     Covariates

-2 LOG L        1316.931       1237.771
AIC             1316.931       1243.771
SBC             1316.931       1251.464

Testing Global Null Hypothesis: BETA=0

Test                 Chi-Square       DF     Pr > ChiSq

Likelihood Ratio        79.1602        3         <.0001
Score                   63.0400        3         <.0001
Wald                    55.5635        3         <.0001
                  Analysis of Maximum Likelihood Estimates

Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio

TX          1     -0.65871      0.21504       9.3827       0.0022      0.518
AGE         1      0.02777      0.01115       6.2071       0.0127      1.028
CD4         1     -0.01656      0.00254      42.5390       <.0001      0.984

Table 3.4, page 87 using the whas100 dataset. We convert time to from years to quarters to increase the number of ties and better display the differences in methods for handling ties. These do not match the book exactly.


data whas100_q; set whas100;
time=foltime/30.44 	/* divide by days per month */;
time=round(time/3) 	/* divide by months per quarter */;
if time=0 then time=.5 /* event can't occur at time zero */;
run;

title "Exact";
proc phreg data = whas100_q;
model foltime*folstatus(0) = bmi gender / ties = exact;
run;
Exact
The PHREG Procedure

Analysis of Maximum Likelihood Estimates
Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio
BMI         1     -0.09265      0.03348       7.6594       0.0056      0.912
GENDER      1      0.53408      0.28287       3.5650       0.0590      1.706
title "Breslow";
proc phreg data = whas100_q;
model foltime*folstatus(0) = bmi gender / ties = breslow;
run;
Breslow
The PHREG Procedure

Analysis of Maximum Likelihood Estimates
Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio
BMI         1     -0.08850      0.03299       7.1988       0.0073      0.915
GENDER      1      0.51836      0.28303       3.3543       0.0670      1.679
title "Efron";
proc phreg data = whas100_q;
model foltime*folstatus(0) = bmi gender / ties = efron;
run;
title;
Efron
The PHREG Procedure

Analysis of Maximum Likelihood Estimates
Parameter     Standard                               Hazard
Variable   DF     Estimate        Error   Chi-Square   Pr > ChiSq      Ratio
BMI         1     -0.09459      0.03391       7.7829       0.0053      0.910
GENDER      1      0.53815      0.28256       3.6272       0.0568      1.713



The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.