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
time T*Status(0) / eventcode=1;
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!
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.
I have a macro that can create and customize the curves for you:
See example 6
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.