The PHREG Procedure

Example 86.8 Survival Curves

(View the complete code for this example.)

You might want to use your regression analysis results to predict the survivorship of subjects of specific covariate values. The COVARIATES= data set in the BASELINE statement enables you to specify the sets of covariate values for the prediction. On the other hand, you might want to summarize the survival experience of an average patient for a given population. The DIRADJ option in the BASELINE statement computes the direct adjusted survival curve that averages the estimated survival curves for patients whose covariates are represented in the COVARIATES= data set. By using the PLOTS= option in the PROC PHREG statement, you can use ODS Graphics to display the predicted survival curves. You can elect to output the predicted survival curves in a SAS data set by optionally specifying the OUT= option in the BASELINE statement. This example illustrates how to obtain the covariate-specific survival curves and the direct adjusted survival curve by using the Myeloma data set in Example 86.1, where variables LogBUN and HGB were identified as the most important prognostic factors. Suppose you want to compute the predicted survival curves for two sets of covariate values: (LogBUN=1.0, HGB=10) and (LogBUN=1.8, HGB=12). These values are saved in the data set Inrisks in the following DATA step. Also created in this data set is the variable Id, whose values will be used in identifying the covariate sets in the survival plot.

data Inrisks;
   length Id $20;
   input LogBUN HGB Id $12-31;
   datalines;
1.00 10.0  logBUN=1.0 HGB=10
1.80 12.0  logBUN=1.8 HGB=12
;

The following statements plot the survival functions in Output 86.8.1 and save the survival estimates in the data set Pred1:

ods graphics on;
proc phreg data=Myeloma plots(overlay)=survival;
   model Time*VStatus(0)=LogBUN HGB;
   baseline covariates=Inrisks out=Pred1 survival=_all_/rowid=Id;
run;

The COVARIATES= option in the BASELINE statement specifies the data set that contains the set of covariates of interest. The PLOTS= option in the PROC PHREG statement creates the survival plot. The OVERLAY suboption overlays the two curves in the same plot. If the OVERLAY suboption is not specified, each curve is displayed in a separate plot. The ROWID= option in the BASELINE statement specifies that the values of the variable Id in the COVARIATES= data set be used to identify the curves in the plot. The SURVIVAL=_ALL_ option in the BASELINE statement requests that the estimated survivor function, standard error, and lower and upper confidence limits for the survivor function be output into the SAS data set that is specified in the OUT= option.

The survival Plot (Output 86.8.1) contains two curves, one for each of row of covariates in the data set Inrisks.

Output 86.8.1: Estimated Survivor Function Plot

Estimated Survivor Function Plot


The following statements print out the observations in the data set Pred1 for the realization LogBUN=1.00 and HGB=10.0:

proc print data=Pred1(where=(logBUN=1 and HGB=10));
run;

As shown in Output 86.8.2, 32 observations represent the survivor function for the realization LogBUN=1.00 and HGB=10.0. The first observation has survival time 0 and survivor function estimate 1.0. Each of the remaining 31 observations represents a distinct event time in the input data set Myeloma. These observations are presented in ascending order of the event times. Note that all the variables in the COVARIATES=InRisks data set are included in the OUT=Pred1 data set. Likewise, you can print out the observations that represent the survivor function for the realization LogBUN=1.80 and HGB=12.0.

Output 86.8.2: Survivor Function Estimates for LogBUN=1.0 and HGB=10.0

ObsIdLogBUNHGBTimeSurvivalStdErrSurvivalLowerSurvivalUpperSurvival
1logBUN=1.0 HGB=101100.001.00000...
2logBUN=1.0 HGB=101101.250.986780.010430.966551.00000
3logBUN=1.0 HGB=101102.000.965590.019070.928921.00000
4logBUN=1.0 HGB=101103.000.958180.021800.916381.00000
5logBUN=1.0 HGB=101105.000.941880.027470.889550.99729
6logBUN=1.0 HGB=101106.000.906350.037960.834920.98389
7logBUN=1.0 HGB=101107.000.877420.045350.792900.97096
8logBUN=1.0 HGB=101109.000.866460.048010.777290.96585
9logBUN=1.0 HGB=1011011.000.810840.059760.701780.93686
10logBUN=1.0 HGB=1011013.000.798000.062380.684640.93012
11logBUN=1.0 HGB=1011014.000.783840.065150.666010.92251
12logBUN=1.0 HGB=1011015.000.769650.067790.647620.91467
13logBUN=1.0 HGB=1011016.000.740710.072690.611100.89781
14logBUN=1.0 HGB=1011017.000.710050.077600.573150.87966
15logBUN=1.0 HGB=1011018.000.693920.079980.553600.86980
16logBUN=1.0 HGB=1011019.000.660620.084420.514250.84865
17logBUN=1.0 HGB=1011024.000.642100.086910.492480.83717
18logBUN=1.0 HGB=1011025.000.623600.089210.471120.82542
19logBUN=1.0 HGB=1011026.000.605230.091360.450230.81359
20logBUN=1.0 HGB=1011032.000.585490.093710.427840.80122
21logBUN=1.0 HGB=1011035.000.565340.095930.405390.78840
22logBUN=1.0 HGB=1011037.000.544650.098160.382570.77542
23logBUN=1.0 HGB=1011041.000.501780.101660.337330.74639
24logBUN=1.0 HGB=1011051.000.475460.103680.310090.72901
25logBUN=1.0 HGB=1011052.000.445100.105220.280060.70741
26logBUN=1.0 HGB=1011054.000.412660.106890.248370.68560
27logBUN=1.0 HGB=1011058.000.374650.108910.211920.66232
28logBUN=1.0 HGB=1011066.000.336260.109800.177310.63772
29logBUN=1.0 HGB=1011067.000.285290.110290.133720.60864
30logBUN=1.0 HGB=1011088.000.224120.109280.086190.58282
31logBUN=1.0 HGB=1011089.000.158640.103170.044350.56750
32logBUN=1.0 HGB=1011092.000.091800.085450.014810.56907


Next, the DIRADJ option in the BASELINE statement is used to request a survival curve that represents the survival experience of an average patient in the population in which the COVARIATES= data set is sampled. When the DIRADJ option is specified, PROC PHREG computes the direct adjusted survival function by averaging the predicted survival functions for the rows in the COVARIATES= data set. The following statements plot the direct adjusted survival function in Output 86.8.3.

proc phreg data=Myeloma plots=survival;
   model Time*VStatus(0)=LogBUN HGB;
   baseline covariates=Myeloma survival=_all_/diradj;
run;

When the DIRADJ option is specified in the BASELINE statement, the default COVARIATES= data set is the input data set. For clarity, the COVARIATES=MYELOMA is specified in the BASELINE statement in the preceding PROC PHREG call.

Output 86.8.3: Average Survival Function for the Myeloma Data

Average Survival Function for the  Data


If neither the COVARIATES= data set nor the DIRADJ option is specified in the BASELINE statement, PROC PHREG computes a predicted survival curve based on , the average values of the covariate vectors in the input data (Neuberger et al. 1986). This curve represents the survival experience of a patient with an average prognostic index equal to the average prognostic index of all patients. This approach has a couple of drawbacks: it is possible that no patient could ever have such an average index, and it does not account for the variability in the prognostic factor from patient to patient.

The DIRADJ option is particularly useful if the model contains a categorical explanatory variable that represents different treatments of interest. By specifying this categorical variable in the GROUP= option, you obtain a direct adjusted survival curve for each category of the variable. In addition, you can use the OUTDIFF= option to save all pairwise differences of these direct adjusted survival probabilities in a data set. For illustration, consider a model that also includes the categorical variable Frac, which has a value 0 if a patient did not have a fracture at diagnosis and 1 otherwise, as an explanatory variable. The following statements plot the adjusted survival curves in Output 86.8.4 and save the differences of the direct adjusted survival probabilities in the data set Diff1:

proc phreg data=Myeloma plots(overlay)=survival;
   class Frac;
   model Time*VStatus(0)=LogBUN HGB Frac;
   baseline covariates=Myeloma outdiff=Diff1 survival=_all_/diradj group=Frac;
run;

Because the CLASS variable Frac is specified as the GROUP= variable, a separate direct adjusted survival curve is computed for each value of the variable Frac. Each direct adjusted survival curve is the average of the predicted survival curves for all the patients in the entire Myeloma data set with their Frac value set to a specific constant. For example, the direct adjusted survival curve for Frac=0 (no fracture at diagnosis) is computed as follows:

  1. The value of the variable Frac is set to 0 for all observations in the Myeloma data set.

  2. The survival curve for each observation in the modified data set is computed.

  3. All the survival curves computed in step 2 are averaged.

Output 86.8.4: Average Survival by Fracture Status

Average Survival by Fracture Status


Output 86.8.4 shows that patients without fracture at diagnosis have better survival than those with fractures. Differences in the survival probabilities and their standard errors are displayed in Output 86.8.5.

proc print data=Diff1;
run;

Output 86.8.5: Differences in the Survival between Fracture and Nonfracture

ObsFracFrac2TimeSurvDiffStdErr
1011.250.010740.01199
2012.000.026530.02605
3013.000.031650.03063
4015.000.041910.03963
5016.000.061150.05669
6017.000.074160.06853
7019.000.078540.07261
80111.000.096690.09002
90113.000.099980.09327
100114.000.103190.09644
110115.000.106110.09937
120116.000.111170.10464
130117.000.115320.10922
140118.000.117040.11120
150119.000.119690.11447
160124.000.120720.11593
170125.000.121450.11713
180126.000.121890.11808
190132.000.122080.11883
200135.000.121970.11933
210137.000.121550.11956
220141.000.119830.11924
230151.000.118210.11850
240152.000.115800.11714
250154.000.112620.11507
260158.000.108240.11203
270166.000.103010.10814
280167.000.094510.10130
290188.000.082480.09133
300189.000.068470.08033
310192.000.050380.06515