BookmarkSubscribeRSS Feed
jzl
Calcite | Level 5 jzl
Calcite | Level 5
I am using proc lifetest and ODS graphics to plot a Kaplan-meier survival curve. I'd like to increase the thickness of the curve. Any help would be greatly appreciated!
7 REPLIES 7
DanH_sas
SAS Super FREQ
The following steps should get you there:

1) Determine which ODS Graphics template needs to be modified. To do this, do
"ods trace on;" before the proc lifetest. You will see the ODS objects in the log. You should see one for the graph. The template name will start with stat.lifetest.graphics.

2) Find the template in the template store. To bring up the template window, type "odst" in the command box. Navigate to sashelp.tmplmst->stat->lifetest->graphics. Your template should be in there. Right-click on it and select "edit".

3) Search for "stepplot". Everwhere you see a STEPPLOT statement, add the following (make sure it is added after the "/"): lineattrs=(thickness=2).

4) Compile the template by clicking on the little "running man" in the toolbar. This should compile the template and put it in sasuser.templat->stat->lifetest->graphics. You can navigate over an see it. The log will also tell you if the compile was successful. You can now rerun your proc lifetest and see the thickness change. If you want to go back to the old template, just navigate to it in sasuser and delete it.

Hope this help!
Dan
jzl
Calcite | Level 5 jzl
Calcite | Level 5
That worked great! Thanks Dan! By the way, is there a place or document that I can read more about how to modify these ODS Graphics templates?
Alchemy1ndex
Fluorite | Level 6

Hi Dan,

I have two follow-up comments/questions here. I realize this post was made about 7 years ago, but I hope you can still help me here.

1. When I go into edit the templates, after typing "odst", the path is under Sashelp.Tmplstat, not Tmplmst. Is this correct?

2. After finding the template I need to edit, when I right click, I do not have the option to edit it, I only have the option to open it. When I open the template, I does not let me edit it directly in that environment. Any idea why this may be happening?

 

I am using SAS version 9.4.

 

Thank you,

TJ

DanH_sas
SAS Super FREQ

1. Yes, the templates are now divided across different item stores based on product. SASHELP.TMPLSTAT should be the correct one for your case.

2. The best thing to do is to copy the template to your program editor, make your changes, and submit the code like any other program. By default, your modified template should be written to SASUSER.TEMPLAT. Normally, this location is searched first for templates before SASHELP (unless you have modified ODS PATH). Therefore, when you run your proc, you should see your changes.

 

Hope this helps!

Dan 

DanH_sas
SAS Super FREQ
This chapter on the SAS support site demonstrates some of the most common template modifications (http://support.sas.com/publishing/pubcat/chaps/63120.pdf).

Hope this helps,
Dan
Rick_SAS
SAS Super FREQ

See the chapter "Customizing the Kaplan-Meier Survival Plot" in the SAS/STAT documentation.

In particular, read about how to download and use the template-modification macros.

and then read the section titled "Changing the Line Thickness."

 

Alchemy1ndex
Fluorite | Level 6

Awesome! Thank you. I will go ahead and try these suggestions out.

 

Edit: This worked beautifully Dan! Thank you for opening my eyes up to the world of SAS templates!

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 7 replies
  • 2585 views
  • 0 likes
  • 4 in conversation