BookmarkSubscribeRSS Feed
viviyeah
Fluorite | Level 6

I read a competing risk example from a SAS link (https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_sashelp_sect007.htm&docsetVersion...), which performs the CIF curve using the following codes:

ods graphics on;
title 'Cause-specific Analysis';
proc phreg data=Bmt plots(overlay)=cif;
   class Disease (order=internal ref=first);
   model T*Status(0)=Disease / eventcode(cox)=1;
   baseline covariates=Risk out=out2 cif=_all_;
run;

Another way the construct the CIF curve is using the following codes: 

proc lifetest data=Bmt notable
outcif=CR_CIF_OUTPUT
plots=cif(test);
time T*Status(0) / eventcode=1;
strata Disease;
run;

 

The question is how I customize the curve? For example, how to set the x axis range, like "0 to 800 by 100"? How to add the at-risk table? Also line thickness? I saw a post suggesting can put the plot created using "proc lifetest" into the "sgplot" codes, which can better customize the curve. Any solution or suggestion about customizing the CIF? Thank you!

 

 

 

3 REPLIES 3
ballardw
Super User

You can usually get the data that was used to create a plot using something like:

ods output graphname=wanteddatasetname;

The graphname you would supply depends on the options.

You can get the names of all of the ODS output objects by running your code one time with:

 

ods trace on;

<your code goes here>

ods trace off;

The log will have list of objects created. If you add the option "/ listing" after the trace on then the name of the object should appear before it in the results window.

 

After you have the data set you should be able to write SGPLOT code to modify the elments you want. You will want to look at the data set carefully though. The names of some things may not be quite as expected.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 4555 views
  • 0 likes
  • 3 in conversation