Modifying the Plot Title in the Revised Template

This example changes the title of the survival plot in PROC LIFETEST from Product-Limit Survival Estimates to Kaplan-Meier Plot as follows, using the modularized template with macros:


%let TitleText0 = "Kaplan-Meier Plot";
%let TitleText1 = &titletext0 " for " STRATUMID;
%let TitleText2 = &titletext0;


The %SurvivalTemplateRestore macro from the preceding section, Creating a Template That Is Easy to Modify, provides the modularized template code. The three %LET statements modify the titles, and the %SurvivalTemplate macro compiles the modified template. The following step, along with the modified template, creates Output 22.3.3:

proc lifetest data=sashelp.BMT plots=survival(cb=hw test);
   time T * Status(0);
   strata Group;

You can restore the default macros, macro variables, and template by running the following steps:


proc template;
   delete Stat.Lifetest.Graphics.ProductLimitSurvival / store=sasuser.templat;

Output 22.3.3: Kaplan-Meier Plot Created with the Revised Template

Kaplan-Meier Plot Created with the Revised Template