BookmarkSubscribeRSS Feed
fbm
Calcite | Level 5 fbm
Calcite | Level 5

Is there a way to suppress the titles in Proc Lifetest output (the figure of survival curves) in SAS 9.4? The default title is 'Product Limit Survival Estimates'. I don't want any title to appear. I've tried altering the template but I keep getting error messages. I ran the following code:

 

proc template;
source Stat.Lifetest.Graphics.ProductLimitSurvival;
run;
data _null_;
%let url = //support.sas.com/documentation/onlinedoc/stat/ex_code/131;
infile "http:&url/templft.html" device=url;
file 'macros.tmp';
input;
if index(_infile_, '</pre>') then stop;
if pre then put _infile_;
if index(_infile_, '<pre>') then pre + 1;
run;
%inc 'macros.tmp' / nosource;

%ProvideSurvivalMacros
%let StepOpts = lineattrs=(thickness=2.5);
%let LegendOpts = title =GROUPNAME location=inside across=1 autoalign=(Top);
%let InsetOpts = autoalign=(BottomLeft);

%let TitleText0 = ;
%let TitleText1 = &TitleText0 "for" stratumid;
%let TitleText2 = &TitleText0;

%CompileSurvivalTemplates

 

Thank you!

5 REPLIES 5
Reeza
Super User

This modifies things, but you don't show how you call the procedure. 

 

Can you please post your full code and log? If you can include your output that's always helpful. 

And specify what version of SAS your'e using as well.

 


@fbm wrote:

Is there a way to suppress the titles in Proc Lifetest output (the figure of survival curves) in SAS 9.4? The default title is 'Product Limit Survival Estimates'. I don't want any title to appear. I've tried altering the template but I keep getting error messages. I ran the following code:

 

proc template;
source Stat.Lifetest.Graphics.ProductLimitSurvival;
run;
data _null_;
%let url = //support.sas.com/documentation/onlinedoc/stat/ex_code/131;
infile "http:&url/templft.html" device=url;
file 'macros.tmp';
input;
if index(_infile_, '</pre>') then stop;
if pre then put _infile_;
if index(_infile_, '<pre>') then pre + 1;
run;
%inc 'macros.tmp' / nosource;

%ProvideSurvivalMacros
%let StepOpts = lineattrs=(thickness=2.5);
%let LegendOpts = title =GROUPNAME location=inside across=1 autoalign=(Top);
%let InsetOpts = autoalign=(BottomLeft);

%let TitleText0 = ;
%let TitleText1 = &TitleText0 "for" stratumid;
%let TitleText2 = &TitleText0;

%CompileSurvivalTemplates

 

Thank you!


 

fbm
Calcite | Level 5 fbm
Calcite | Level 5

I'm using SAS 9.4. This is my full code except for the proc lifetest part.

 

Below is the error message in the log which is really long.

 

Thanks!

 %ProvideSurvivalMacros
NOTE: Overwriting existing template/link: Stat.Lifetest.Graphics.ProductLimitSurvival
NOTE: STATGRAPH 'Stat.Lifetest.Graphics.ProductLimitSurvival' has been saved to: SASUSER.TEMPLAT
NOTE: Overwriting existing template/link: Stat.Lifetest.Graphics.ProductLimitSurvival2
NOTE: STATGRAPH 'Stat.Lifetest.Graphics.ProductLimitSurvival2' has been saved to: SASUSER.TEMPLAT
NOTE: PROCEDURE TEMPLATE used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


852   %let StepOpts = lineattrs=(thickness=2.5);
853   %let LegendOpts = title =GROUPNAME location=inside across=1 autoalign=(Top);
854   %let InsetOpts = autoalign=(BottomLeft);
855   %let TitleText0 = ;
856   %let TitleText1 = &TitleText0 "for" stratumid;
857   %let TitleText2 = &TitleText0;
858   %CompileSurvivalTemplates
NOTE 137-205: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
12                          if (EXISTS(STRATUMID)) entrytitle &titletext1;
12  ! else                   entrytitle &titletext0;                      endif;
                                                   -
                                                   22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.

NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
12                          if (EXISTS(STRATUMID)) entrytitle &titletext1;
12  ! else                   entrytitle &titletext0;                      endif;
                                                   -
                                                   76
ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
14     if (PLOTATRISK=1)
                     -
                     79
                     200
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
1                           if (PLOTHW=1 AND PLOTEP=0)          bandplot LimitUpper=HW_UCL
                                      -
-
                                      79
79
                                      76
76
1   ! LimitLower=HW_LCL x=TIME /             modelname="Survival" fillattrs=GRAPHCONFIDENCE
1   !       name="HW" legendlabel=LABELHW;       endif;       if (PLOTHW=0 AND
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
3               bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME /
3   ! modelname="Survival" fillattrs=GRAPHCONFIDENCE             name="EP" legendlabel=LABELEP;
3   !     endif;       if (PLOTHW=1 AND PLOTEP=1)          bandplot LimitUpper=HW_UCL
                                 -
                                 79
                                 76
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
6      fillattrs=GRAPHDATA2             datatransparency=.55 name="EP" legendlabel=LABELEP;
6   ! endif;       if (PLOTCL=1)          if (PLOTHW=1 OR PLOTEP=1)             bandplot
                             -                      -
                             79                     79
                             200                    76
6   ! LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME /
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
9      fillattrs=GRAPHCONFIDENCE name="CL"                legendlabel=LABELCL;          endif;
9   !    endif;        stepplot y=SURVIVAL x=TIME / name="Survival" &tips legendlabel="Survival"
9   !               &stepopts;        if (PLOTCENSORED=1)
                                                      -
                                                      79
                                                      200
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
11              scatterplot y=CENSORED x=TIME / &censored &tiplabel             name="Censored"
11  ! legendlabel="Censored";       endif;        if (PLOTCL=1 OR PLOTHW=1 OR PLOTEP=1)
                                                            -
                                                            79
                                                            76
11  ! discretelegend "Censored" "CL" "HW" "EP" / location=outside
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
12                 halign=center;       else          if (PLOTCENSORED=1)
                                                                      -
                                                                      79
                                                                      200
12  ! discretelegend "Censored" / location=inside
12  ! autoalign=(topright bottomleft);          endif;       endif;
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
14              if (PLOTATRISK=1)             innermargin / align=bottom;                axistable
                              -
                              79
                              200
14  !  x=TATRISK value=ATRISK / &atriskopts;             endinnermargin;          endif;
NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
23     entrytitle &titletext2;
                             -
                             22
                             76
NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
25                          if (EXISTS(SECONDTITLE))                         entrytitle
                                      -
                                      79
                                      76
25  ! SECONDTITLE / textattrs=GRAPHVALUETEXT;                      endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
1                           if (PLOTHW=1)          bandplot LimitUpper=HW_UCL LimitLower=HW_LCL
                                      -
-
                                      79
79
                                      200
200
1   ! x=TIME / &bandopts                   datatransparency=Transparency;       endif;       if
1   ! (PLOTEP=1)          bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME /
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
3                        datatransparency=Transparency;       endif;       if (PLOTCL=1)
                                                                                     -
-
                                                                                     79
79
                                                                                     200
76
3   ! if (PLOTHW=1 OR PLOTEP=1)             bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME
3   ! / &bandopts                      display=(outline) outlineattrs=
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
6      &tips &stepopts;        if (PLOTCENSORED=1)          scatterplot y=CENSORED x=TIME /
                                               -
                                               79
                                               200
6   ! &groups &tiplabel &censored;       endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
8               if (PLOTATRISK=1)             innermargin / align=bottom;                axistable
                              -
                              79
                              200
8   !  x=TATRISK value=ATRISK / &atriskopts &classopts;             endinnermargin;          endif
8   ! ;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
12              if (PLOTCENSORED=1)             if (PLOTTEST=1)                layout gridded /
                                -                           -
                                79                          79
                                200                         200
12  ! rows=2 &insetopts;                   entry &censorstr;                   %pValue
12  !     endlayout;             else                layout gridded / rows=1
NOTE: Line generated by the invoked macro "PVALUE".
1                        if (PVALUE < .0001)          entry TESTNAME " p " eval (PUT(PVALUE,
                                    -                                               -
-
                                    79                                              79
79
                                    200                                             200
200
1   ! PVALUE6.4));       else          entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
1   ! endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
13     &insetopts;                   entry &censorstr;                endlayout;             endif
13  ! ;          else             if (PLOTTEST=1)                layout gridded / rows=1
                                              -
                                              79
                                              200
13  ! &insetopts;                   %pValue                endlayout;
NOTE: Line generated by the invoked macro "PVALUE".
1                        if (PVALUE < .0001)          entry TESTNAME " p " eval (PUT(PVALUE,
                                    -                                               -
-
                                    79                                              79
79
                                    200                                             200
200
1   ! PVALUE6.4));       else          entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
1   ! endif;
WARNING: Object will not be saved.
ERROR 79-322: Expecting a ).

ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 76-322: Syntax error, statement will be ignored.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.

NOTE 137-205: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
40                          if (EXISTS(STRATUMID)) entrytitle &titletext1;
40  ! else                   entrytitle &titletext0;                      endif;
                                                   -
                                                   22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.

NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
40                          if (EXISTS(STRATUMID)) entrytitle &titletext1;
40  ! else                   entrytitle &titletext0;                      endif;
                                                   -
                                                   76
ERROR 76-322: Syntax error, statement will be ignored.

NOTE: Line generated by the invoked macro "SINGLESTRATUM".
1                           if (PLOTHW=1 AND PLOTEP=0)          bandplot LimitUpper=HW_UCL
                                      -
-
                                      79
79
                                      76
76
1   ! LimitLower=HW_LCL x=TIME /             modelname="Survival" fillattrs=GRAPHCONFIDENCE
1   !       name="HW" legendlabel=LABELHW;       endif;       if (PLOTHW=0 AND
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
3               bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME /
3   ! modelname="Survival" fillattrs=GRAPHCONFIDENCE             name="EP" legendlabel=LABELEP;
3   !     endif;       if (PLOTHW=1 AND PLOTEP=1)          bandplot LimitUpper=HW_UCL
                                 -
                                 79
                                 76
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
6      fillattrs=GRAPHDATA2             datatransparency=.55 name="EP" legendlabel=LABELEP;
6   ! endif;       if (PLOTCL=1)          if (PLOTHW=1 OR PLOTEP=1)             bandplot
                             -                      -
                             79                     79
                             200                    76
6   ! LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME /
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
9      fillattrs=GRAPHCONFIDENCE name="CL"                legendlabel=LABELCL;          endif;
9   !    endif;        stepplot y=SURVIVAL x=TIME / name="Survival" &tips legendlabel="Survival"
9   !               &stepopts;        if (PLOTCENSORED=1)
                                                      -
                                                      79
                                                      200
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
11              scatterplot y=CENSORED x=TIME / &censored &tiplabel             name="Censored"
11  ! legendlabel="Censored";       endif;        if (PLOTCL=1 OR PLOTHW=1 OR PLOTEP=1)
                                                            -
                                                            79
                                                            76
11  ! discretelegend "Censored" "CL" "HW" "EP" / location=outside
NOTE: Line generated by the invoked macro "SINGLESTRATUM".
12                 halign=center;       else          if (PLOTCENSORED=1)
                                                                      -
                                                                      79
                                                                      200
12  ! discretelegend "Censored" / location=inside
12  ! autoalign=(topright bottomleft);          endif;       endif;
NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
47     entrytitle &titletext2;
                             -
                             22
                             76
NOTE: Line generated by the invoked macro "COMPILESURVIVALTEMPLATES".
49                          if (EXISTS(SECONDTITLE))                         entrytitle
                                      -
                                      79
                                      76
49  ! SECONDTITLE / textattrs=GRAPHVALUETEXT;                      endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
1                           if (PLOTHW=1)          bandplot LimitUpper=HW_UCL LimitLower=HW_LCL
                                      -
-
                                      79
79
                                      200
200
1   ! x=TIME / &bandopts                   datatransparency=Transparency;       endif;       if
1   ! (PLOTEP=1)          bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME /
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
3                        datatransparency=Transparency;       endif;       if (PLOTCL=1)
                                                                                     -
-
                                                                                     79
79
                                                                                     200
76
3   ! if (PLOTHW=1 OR PLOTEP=1)             bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME
3   ! / &bandopts                      display=(outline) outlineattrs=
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
6      &tips &stepopts;        if (PLOTCENSORED=1)          scatterplot y=CENSORED x=TIME /
                                               -
                                               79
                                               200
6   ! &groups &tiplabel &censored;       endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
10              if (PLOTCENSORED=1)             if (PLOTTEST=1)                layout gridded /
                                -                           -
                                79                          79
                                200                         200
10  ! rows=2 &insetopts;                   entry &censorstr;                   %pValue
10  !     endlayout;             else                layout gridded / rows=1
NOTE: Line generated by the invoked macro "PVALUE".
1                        if (PVALUE < .0001)          entry TESTNAME " p " eval (PUT(PVALUE,
                                    -                                               -
-
                                    79                                              79
79
                                    200                                             200
200
1   ! PVALUE6.4));       else          entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
1   ! endif;
NOTE: Line generated by the invoked macro "MULTIPLESTRATA".
11     &insetopts;                   entry &censorstr;                endlayout;             endif
11  ! ;          else             if (PLOTTEST=1)                layout gridded / rows=1
                                              -
                                              79
                                              200
11  ! &insetopts;                   %pValue                endlayout;
NOTE: Line generated by the invoked macro "PVALUE".
1                        if (PVALUE < .0001)          entry TESTNAME " p " eval (PUT(PVALUE,
                                    -                                               -
-
                                    79                                              79
79
                                    200                                             200
200
1   ! PVALUE6.4));       else          entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
1   ! endif;
WARNING: Object will not be saved.
NOTE: PROCEDURE TEMPLATE used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds

WARNING: Errors were produced.
NOTE: The SAS System stopped processing this step because of errors.

ERROR 79-322: Expecting a ).

ERROR 76-322: Syntax error, statement will be ignored.

ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.


ballardw
Super User

The code below is I believe what you would need to change:

 

proc template;                                                                
   define table Stat.Lifetest.ProductLimitEstimates;                          
      notes "Product-Limit Survival";                                         
      column GrpNumVar GrpChrVar Timelist GenericTime Censor NumberAtRisk     
         ObservedEvents Survival Failure StdErr Failed Left Freq              
         GenericIDNumeric GenericIDCharacter;                                 
      header h1;                                                              
                                                                              
      define h1;                                                              
         text "Product-Limit Survival Estimates";                             
         space = 1;                                                           
         spill_margin;                                                        
         first_panel;                                                         
      end;                                                                    
      parent = Stat.Lifetest.ProductLimitEstimates0;                          
   end;                                                                       
run;                    

The text in Define h1 should read as desired. You want to make sure that you are not overwriting the original version in SAShelp.tmplstat though.

 

fbm
Calcite | Level 5 fbm
Calcite | Level 5

How do I make sure that I am not overwriting the original version in SAShelp.tmplstat?

 

Thanks

ballardw
Super User

@fbm wrote:

How do I make sure that I am not overwriting the original version in SAShelp.tmplstat?

 

Thanks


You set a path to a store that is elsewhere such as:

 

ods path sasuser.template(update) sashelp.tmplmst(read);

This creates a custom store for you in the SASUSER library with write and delete ability (the update) and says you are going to read onlyfrom the sashelp.tmplmst.

Then something like

 

proc template;

   edit Stat.Lifetest.ProductLimitEstimates;

      edit h1;

          text= "whatever";

      end;  

   end;

run;

 

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3924 views
  • 0 likes
  • 3 in conversation