%let gpath='C:\';
%let dpi=200;
ods html close;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Generate Tumor Size data--*/
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), 'Trt1', 'Trt2');
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';
if change > 0 then do; low=0; high=change; lowlabel=''; highlabel=label; end;
else do; high=0; low=change; lowlabel=label; highlabel=''; end;
output;
end;
run;
/*--Change in Tumor Size Graph--*/
ods listing style=listing;
ods graphics / reset width=5in height=3in imagename='TumorSize';
title 'Change in Tumor Size';
title2 'ITT Population';
proc sgplot data=TumorSize nowall noborder;
styleattrs datacolors=(cxbf0000 cx4f4f4f) datacontrastcolors=(black);
vbar cid / response=change group=group categoryorder=respdesc 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;
/*--Generate Injection Site Reaction data--*/
data Incidence;
drop fac;
label Incidence='Incidence of Erythema';
fac=0.6;
do Time= '0 Min', '10 Min', '20 Min', '30 Min', '60 Min', '2 Hr', '4 Hr', '8 hr', '24 Hr', '72 Hr';
do Group='Cohort 1', 'Cohort 2', 'Cohort 3', 'Cohort 4';
Incidence=fac/2+ ranuni(3)*fac;
output;
end;
fac = 0.6*fac;
end;
run;
/*--Incidence Graph--*/
ods graphics / reset width=5in height=3in imagename='Incidence';
title 'Incidence of Injection-site Reaction by Time and Cohort - Erythema';
title2 'ATT Population';
ods listing style=journal3;
proc sgplot data=Incidence nowall noborder;
styleattrs datacolors=(gray pink lightgreen lightblue ) datacontrastcolors=(black);
vbar time / response=incidence group=group groupdisplay=cluster baselineattrs=(thickness=0);
xaxis discreteorder=data;
yaxis offsetmax=0.2;
keylegend / title='' location=inside position=top across=2 border autoitemsize valueattrs=(size=8);
run;
title;