BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ammarhm
Lapis Lazuli | Level 10

The following code will produce a plot of the hazards function

ods select HazardPlot;
ods graphics on;
proc lifetest data=sashelp.BMT plots=hazard;
   time T * Status(0);
run;
ods graphics off;

I am trying to remove the title of the plot where it says "epanechnikov kernel-smoothed hazard function ", and to remove the "Bandwidth" comment below the graph

I usually use the steps described in this documentation to customise my Kaplan Meier plots:

https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf

However, the above document does not address how to deal with hazard plots.. Any thought about how to remove the title or customise it in the hazard plot and how to remove the bandwidth comment?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ammarhm
Lapis Lazuli | Level 10

Solved using proc template and entrytitle keyword

 

proc template;
source  Stat.Lifetest.Graphics.SmoothedHazard;
define statgraph Stat.Lifetest.Graphics.SmoothedHazard;
   dynamic NStrata Kernel Bandwidth confLimits GroupName maxTime _byline_ _bytitle_ _byfootnote_;
   BeginGraph;
         entrytitle  "";
         layout overlay / yaxisopts=(label="Estimated Hazard Rate" shortlabel="Hazard") xaxisopts=(linearopts=(viewmax=MAXTIME));
            bandplot LimitUpper=UPPER LimitLower=LOWER x=TIME / displayTail=false modelname="Hazard" name="Confidence" LegendLabel=
               CONFLIMITS;
            seriesplot y=HAZARD x=TIME / name="Hazard";
            if (EXISTS(CONFLIMITS))
               DISCRETELEGEND "Confidence" / location=outside halign=center valign=bottom;
            endif;
         endlayout;

   EndGraph;
end;
run;

View solution in original post

1 REPLY 1
ammarhm
Lapis Lazuli | Level 10

Solved using proc template and entrytitle keyword

 

proc template;
source  Stat.Lifetest.Graphics.SmoothedHazard;
define statgraph Stat.Lifetest.Graphics.SmoothedHazard;
   dynamic NStrata Kernel Bandwidth confLimits GroupName maxTime _byline_ _bytitle_ _byfootnote_;
   BeginGraph;
         entrytitle  "";
         layout overlay / yaxisopts=(label="Estimated Hazard Rate" shortlabel="Hazard") xaxisopts=(linearopts=(viewmax=MAXTIME));
            bandplot LimitUpper=UPPER LimitLower=LOWER x=TIME / displayTail=false modelname="Hazard" name="Confidence" LegendLabel=
               CONFLIMITS;
            seriesplot y=HAZARD x=TIME / name="Hazard";
            if (EXISTS(CONFLIMITS))
               DISCRETELEGEND "Confidence" / location=outside halign=center valign=bottom;
            endif;
         endlayout;

   EndGraph;
end;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 301 views
  • 2 likes
  • 1 in conversation