03-06-2017 03:09 PM
I am trying to ouput a KM curve using proc lifetest, but with with transparent background. This way, I can overlay the image over another JPEG image and see if the curves overlap. At the moment, the JPEG image appears with white, non-transparent background. I wish to keep everything the same (curve colors, etc) except the the background.
ods rtf file="&outputloc\test.rtf";
proc lifetest data=test method=KM
plots=survival(atrisk=0 to 30 by 3) timelist=0 to 30 by 3;
title1 'Kaplan-Meier Plot for OS';
ods rtf close;
03-06-2017 03:33 PM
I'm assuming you're not using SAS 9.4 since you're not using ODS PPT?
Anyways, here's a starter on customizing survival plots. It's not as easy as you'd like, unfortunately.
03-06-2017 03:52 PM
With SAS 9.40M3, GTL supports output with transparent background. You will also have to make the wall transparent.
See OPAQUE option in BEGINGRAPH.
03-07-2017 09:05 AM
If you have SAS 9.40M3 (M3 is important), you can do one of the following:
Change the PROC Lifetest template.
Or, run the lifetest procedure and get the data saved to a sas data set using ODS OUTPUT.
/*--Get survival plot data from LIFETEST procedure--*/
ods graphics on;
ods output Survivalplot=SurvivalPlotData;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500);
time T * Status(0);
strata Group / test=logrank adjust=sidak;
/*--Survival Plot with outer Risk Table using AxisTable Transparent--*/
ods html close;
ods graphics / reset imagename='Survival Plot_SG_V94_Trans';
title 'Product-Limit Survival Estimates';
title2 h=0.8 'With Number of AML Subjects at Risk';
proc sgplot data=SurvivalPlotData noopaque nowall;
step x=time y=survival / group=stratum lineattrs=(pattern=solid) name='s';
scatter x=time y=censored / markerattrs=(symbol=plus) name='c';
scatter x=time y=censored / markerattrs=(symbol=plus) GROUP=stratum;
xaxistable atrisk / x=tatrisk location=outside class=stratum colorgroup=stratum;
keylegend 'c' / location=inside position=topright;
03-07-2017 09:24 AM
Thank you Sanjay_SAS! I tried running this code, but I guess I do not have M3 because I got an error message that the "noopaque" option is unrecognized. Is M3 something that can be dowloaded or do I have to purchase it separately?
03-07-2017 10:28 AM
I believe you (or your company) can upgrade to a new maintenance release.
Contact firstname.lastname@example.org, or, call our customer service line 919-677-8003.