libname data 'C:\Data'; %let gpath=C:\; ods html close; %let w=4in; %let h=3in; %let dpi=200; ods listing style=htmlblue gpath="&gpath" image_dpi=&dpi; /*--This sample uses data from sample 49_2_1--*/ proc format; value risk 1='ALL' 2='AML-Low Risk' 3='AML-High Risk'; /*--Survival Plot Data--*/ ods html; proc print data=data.survivalPlotData (obs=10) noobs; run; ods html close; /*--Survival Plot with LegendItem--*/ ods graphics / reset maxlegendarea=50 width=5in height=3in imagename='SurvivalPlot'; title 'Product-Limit Survival Estimates'; title2 h=0.8 'With Number of AML Subjects at Risk'; proc sgplot data=data.SurvivalPlotData; legenditem type=marker name='c' / markerattrs=(symbol=plus color=black) label='Censored'; step x=time y=survival / group=stratum lineattrs=(pattern=solid) name='s'; scatter x=time y=censored / markerattrs=(symbol=plus) GROUP=stratum; xaxistable atrisk / x=tatrisk class=stratum location=outside colorgroup=stratum; keylegend 'c' / location=inside position=topright; keylegend 's'; yaxis min=0; run; /*--Data for Swimmer Plot--*/ data swimmer; input item stage $4-12 low high highcap $25-40 status $40-60 start end durable; startline=start; endline=end; if status ne ' ' then do; if end eq . then endline=high-0.3; if start eq . then startline=low+0.3; end; if stage eq ' ' then durable=.; datalines; 1 Stage 1 0 18.5 FilledArrow Complete response 6.5 13.5 -0.25 2 Stage 2 0 17.0 Complete response 10.5 17.0 -0.25 3 Stage 3 0 14.0 FilledArrow Partial response 2.5 3.5 -0.25 3 0 14.0 FilledArrow Partial response 6.0 . -0.25 4 Stage 4 0 13.5 FilledArrow Partial response 7.0 11.0 . 4 0 13.5 FilledArrow Partial response 11.5 . . 5 Stage 1 0 12.5 FilledArrow Complete response 3.5 4.5 -0.25 5 0 12.5 FilledArrow Complete response 6.5 8.5 -0.25 5 0 12.5 FilledArrow Partial response 10.5 . -0.25 6 Stage 2 0 12.6 FilledArrow Partial response 2.5 7.0 . 6 0 12.6 FilledArrow Partial response 9.5 . . 7 Stage 3 0 11.5 Complete response 4.5 11.5 -0.25 8 Stage 1 0 9.5 Complete response 1.0 9.5 -0.25 9 Stage 4 0 8.3 FilledArrow Partial response 6.0 . . 10 Stage 2 0 4.2 FilledArrow Complete response 1.2 . . ; run; /*--Attribute Map--*/ data attrmap; length ID $ 9 linecolor markercolor fillcolor $ 20; input id $ value $10-30 linecolor $ markercolor $ fillcolor $; datalines; status Complete response darkred darkred gray status Partial response blue blue gray stage Stage 1 darkred darkred green stage Stage 2 black black yellow stage Stage 3 black black orange stage Stage 4 black black red ; run; /*--Swimmer plot with Legend Items--*/ ods graphics on / reset height=3.5in width=6in imagename='Swimmer_940M5'; title 'Subject Response Stage by Month'; footnote J=l h=0.8 'Each bar represents one subject in the study.'; footnote2 J=l h=0.8 'A durable responder is a subject who has confirmed response for at least 183 days (6 months).'; proc sgplot data= swimmer dattrmap=attrmap nocycleattrs noborder; legenditem type=marker name='ResStart' / markerattrs=(symbol=trianglefilled color=darkgray size=9) label='Response start'; legenditem type=marker name='ResEnd' / markerattrs=(symbol=circlefilled color=darkgray size=9) label='Response end'; legenditem type=marker name='RightArrow' / markerattrs=(symbol=trianglerightfilled color=darkgray size=12) label='Continued response'; highlow y=item low=low high=high / highcap=highcap type=bar group=stage fill nooutline dataskin=gloss lineattrs=(color=black) name='stage' barwidth=1 nomissinggroup transparency=0.3 attrid=stage; highlow y=item low=startline high=endline / group=status lineattrs=(thickness=2 pattern=solid) name='status' nomissinggroup attrid=status; scatter y=item x=durable / markerattrs=(symbol=squarefilled size=6 color=black) name='Durable' legendlabel='Durable responder'; scatter y=item x=start / markerattrs=(symbol=trianglefilled size=8) group=status attrid=status; scatter y=item x=end / markerattrs=(symbol=circlefilled size=8) group=status attrid=status; xaxis display=(nolabel) values=(0 to 20 by 1) valueshint grid; yaxis reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1; keylegend 'stage' / title='Disease Stage'; keylegend 'status' 'Durable' 'ResStart' 'ResEnd' 'RightArrow' / noborder location=inside position=bottomright across=1 linelength=20; run; footnote;