Statistical Graphics Using ODS |
PROC LIFETEST, like other statistical procedures, provides a PLOTS= option and other options for modifying its output without requiring template changes. See Chapter 49, The LIFETEST Procedure, for more information. Those options are sufficient for most purposes. This example shows ways that you can change the template when those options are not sufficient.
This example changes the default title of the survival plot in PROC LIFETEST from "Product-Limit Survival Estimate" to "Kaplan-Meier Plot" through a template change. Subsequent parts of this example change other aspects of the plot including the legend, inset table, ticks, and the overall layout—all through template changes.
This example uses the BMT data set from the section Survival Estimate Plot with PROC LIFETEST. The following steps create the SAS data set:
proc format; value risk 1='ALL' 2='AML-Low Risk' 3='AML-High Risk'; run; data BMT; input Group T Status @@; format Group risk.; label T='Disease Free Time'; datalines; 1 2081 0 1 1602 0 1 1496 0 1 1462 0 1 1433 0 ... more lines ... ;
The following statements run PROC LIFETEST to determine the template name:
ods graphics on; ods trace output; proc lifetest data=BMT plots=survival(cb=hw test); time T * Status(0); strata Group / test=logrank; run; ods trace off;
The trace output results (not shown) show that the template name for the survival plot is Stat.Lifetest.Graphics.ProductLimitSurvival. The following statements display the template:
proc template; source Stat.Lifetest.Graphics.ProductLimitSurvival; run;
Copyright © SAS Institute, Inc. All Rights Reserved.