Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The LIFEHAZ macro produces parametric plots of hazard functions based on models fitted by PROC LIFEREG. In the LIFEREG procedure, you must specify OUTEST=name1 in the PROC LIFEREG statement. You must also use the OUTPUT statement with OUT=name2 and XBETA=name3. By default, the hazard is plotted for the mean value of the XBETA option (the linear predictor). If you want a plot for a specific observation, you must specify the observation number (OBSNO) when you invoke the macro. The macro requires SAS/GRAPH software.
To use the macro, you must first read it into your SAS session. This can be done by simply copying the text of the macro into the editor window and then running it. Alternatively, you can use the %INCLUDE statement to specify the name and location of the file containing the macro (which must have a .sas extension). Once the macro has been read in to SAS, you can use it repeatedly during your SAS session. For an example using the LIFEHAZ macro, see the section Generating Predictions and Hazard Functions in Chapter 4, "Estimating Parametric Regression Models with PROC LIFEREG."