%let gpath=C:\;
%let dpi=200;
ods html close;
ods listing gpath="&gpath" image_dpi=&dpi;
data TumorSize;
length Cid $ 3;
label Change='Change from Baseline (%)';
do Id=1 to 25;
cid=put(id, 2.0);
change=30-120*ranuni(2);
Group=ifc(int(ranuni(2)+0.5), 'Treatment 1', 'Treatment 2');
Duration=floor(50+100*ranuni(2));
Drop=ifn(ranuni(2) < 0.3, floor(duration-10), .);
if mod(id, 5) = 1 then Label='C';
if mod(id, 5) = 2 then label='R';
if mod(id, 5) = 3 then label='S';
if mod(id, 5) = 4 then label='P';
if mod(id, 5) = 0 then label='N';
output;
end;
run;
proc sort data=TumorSize out=TumorSizeSort;
by descending change;
run;
ods html;
proc print data=TumorSizeSort(obs=10);
run;
ods html close;
/*--Change in Tumor Size--*/
ods listing style=listing;
ods graphics / reset width=5in height=3in imagename='TumorSize';
title 'Change in Tumor Size';
title2 'ITT Population';
proc sgplot data=TumorSizeSort nowall noborder;
styleattrs datacolors=(cxbf0000 cx4f4f4f) datacontrastcolors=(black);
vbarparm category=cid response=change / group=group datalabel=label
datalabelattrs=(size=5 weight=bold) groupdisplay=cluster clusterwidth=1;
refline 20 -30 / lineattrs=(pattern=shortdash);
xaxis display=none;
yaxis values=(60 to -100 by -20);
inset ("C="="CR" "R="="PR" "S="="SD" "P="="PD" "N="="NE") / title='BCR'
position=bottomleft border textattrs=(size=6 weight=bold) titleattrs=(size=7);
keylegend / title='' location=inside position=topright across=1 border;
run;
title;
/*--Change in Tumor Size with Duration--*/
ods listing style=listing;
ods graphics / reset width=5in height=3.5in imagename='TumorSize_Duration_Extent';
title 'Change in Tumor Size';
title2 'ITT Population';
proc sgplot data=TumorSizeSort nowall noborder nocycleattrs;
styleattrs datacolors=(cxbf0000 cx4f4f4f) datacontrastcolors=(black) axisextent=data;
symbolchar name=mystar char='002a'x / voffset=-0.5 scale=3;
vbarparm category=cid response=change / group=group datalabel=label dataskin=pressed
datalabelattrs=(size=5 weight=bold) groupdisplay=cluster clusterwidth=1;
vbarparm category=cid response=duration / datalabel=duration y2axis dataskin=pressed
datalabelattrs=(size=5 weight=bold) groupdisplay=cluster clusterwidth=1
fillattrs=(color=cxcfcf7f);
scatter x=cid y=drop / y2axis markerattrs=(symbol=mystar color=red size=10);
refline 20 -30 / lineattrs=(pattern=shortdash);
xaxis display=none colorbands=odd colorbandsattrs=(transparency=0.6);
yaxis values=(60 to -100 by -20) offsetmax=0.45 labelpos=datacenter offsetmin=0;
y2axis offsetmin=0.6 offsetmax=0.02 labelpos=datacenter;
inset ("C="="CR" "R="="PR" "S="="SD" "P="="PD" "N="="NE") / title='BCR'
position=bottomleft border textattrs=(size=6 weight=bold) titleattrs=(size=7);
keylegend / title='' border;
run;
title;