BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
js5
Pyrite | Level 9 js5
Pyrite | Level 9

Dear community,

 

I need to generate powerpoint slides with Kaplan-Meier plots in them, no tables. I have achieved this with the following code:

%macro draw_kaplan_meier(population=, parameter=, title=, strata=, condition=);

	title %if &parameter EQ PFS %then "Progression Free Survival";
		%if &parameter EQ OS %then "Overall Survival";
		;
	title2 &title;

	proc lifetest data=adtte(where=(&population and PARAM EQ "&parameter" %if %length(&condition) GT 0 %then and &condition;)) plots=survival(atrisk(maxlen=20)) notable;
		time DAY * CENSORED(1);
		strata &strata %if %sysfunc(countw(&strata)) GT 1 %then /nolabel;;
	quit;

%mend draw_kaplan_meier;


proc template;
	define style styles.pptlsmallfont;
		parent=styles.powerpointlight;
		scheme "PPT Light Small Font" /
			body_font = ("Calibri, <MTsans-serif>, <sans-serif>", 14pt)
			heading_font = ("Calibri, <MTsans-serif>, <sans-serif>", 36pt);
	end;
run;

ods graphics on;
ods escapechar="~";
ods noproctitle;
ods powerpoint image_dpi=450 style=pptlsmallfont
	file="&output_path\kaplan_meier.pptx";
ods exclude CensoredSummary (persist) HomStats (persist) LogrankHomCov (persist) WilcoxonHomCov (persist) HomTests (persist) Legend (persist);

%draw_kaplan_meier(population=SAFFL EQ "Y", parameter=PFS, title=%str(Safety population), strata=SUBGR_A)
%draw_kaplan_meier(population=SAFFL EQ "Y", parameter=OS, title=%str(Safety population), strata=SUBGR_B)

title;
title2;
ods powerpoint close;

Unfortunately, despite all the exclusions, I can't get rid of the Testing Homogeneity of Survival Curves for DAY over Strata title, which causes the desired KM plot to scale down unnecessarily. Do you know if there is a way to suppress this title? Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
MichaelL_SAS
SAS Employee

It looks like the text you want to suppress is a note in ODS not a title. I believe either adding the name of that note (HomogeneityNote) to the exclude list or switching from excluding output to selecting the output you want to keep should work. 

 

I used this little toy example based on the code you provided and Example 74.2  in the PROC LIFETEST documentation to find the name of the note and test excluding it. 

 

 

/* Store ODS objects in test document */
ods document name=test(write); ods exclude CensoredSummary HomStats LogrankHomCov WilcoxonHomCov HomTests Legend ; proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable; time T * Status(0); strata Group / test=logrank adjust=sidak; run; ods document close;
/* List objects in test document */ proc document name=test; list /levels=all; quit;

procDocOut.png

 

 

 

/*  Add note to exclude list */
ods exclude CensoredSummary  HomStats LogrankHomCov WilcoxonHomCov  HomTests Legend HomogeneityNote;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable;
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
run;


/* Select only Homogeneity Tests and Survival Curves */
ods select  SurvDiff SurvivalPlot;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable;
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
run;

 

 

View solution in original post

2 REPLIES 2
MichaelL_SAS
SAS Employee

It looks like the text you want to suppress is a note in ODS not a title. I believe either adding the name of that note (HomogeneityNote) to the exclude list or switching from excluding output to selecting the output you want to keep should work. 

 

I used this little toy example based on the code you provided and Example 74.2  in the PROC LIFETEST documentation to find the name of the note and test excluding it. 

 

 

/* Store ODS objects in test document */
ods document name=test(write); ods exclude CensoredSummary HomStats LogrankHomCov WilcoxonHomCov HomTests Legend ; proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable; time T * Status(0); strata Group / test=logrank adjust=sidak; run; ods document close;
/* List objects in test document */ proc document name=test; list /levels=all; quit;

procDocOut.png

 

 

 

/*  Add note to exclude list */
ods exclude CensoredSummary  HomStats LogrankHomCov WilcoxonHomCov  HomTests Legend HomogeneityNote;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable;
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
run;


/* Select only Homogeneity Tests and Survival Curves */
ods select  SurvDiff SurvivalPlot;
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 500) notable;
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
run;

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 2219 views
  • 1 like
  • 2 in conversation