%let gpath='.';
ods html close;
%let w=4in;
%let dpi=200;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Grouped Series--*/
data seriesMultiVar;
label Drug_A='Drug A' Drug_B='Drug B' Drug_C='Drug C';
drop i;
format Date Date9.;
do i=0 to 355 by 15, 365 to 365 by 1;
date='01jan2009'd+i;
Drug_A = 16+ 3*sin(i/90+0.5) + 1*sin(3*i/90+0.7);
Drug_B = 10+ 3*sin(i/90+0.5) + 1*cos(3*i/90+0.7);
Drug_C = 10+ 3*cos(i/90+0.5) + 1*sin(3*i/90+0.7);;
output;
end;
run;
/*ods html;*/
/*proc print data=seriesMultiVar(obs=6);*/
/* var date drug_a drug_b drug_c;*/
/*run;*/
/*ods html close;*/
/*--Grouped Series--*/
data seriesGroup;
drop Drug_A Drug_B Drug_C;
set seriesMultiVar;
Drug='Drug A'; Response=Drug_A; output;
Drug='Drug B'; Response=Drug_B; output;
Drug='Drug C'; Response=Drug_C; output;
run;
/*ods html;*/
/*proc print data=seriesGroup(obs=6);*/
/* var date drug response;*/
/*run;*/
/*ods html close;*/
/*--Series Plot--*/
ods graphics / reset width=5in height=3in imagename='Series';
title 'Response by Date';
proc sgplot data=seriesMultiVar;
series x=date y=Drug_A;
xaxis display=(nolabel);
run;
/*--Series Plot Sparse Smooth Thick--*/
ods graphics / reset width=5in height=3in imagename='SeriesSmoothThk';
title 'Response by Date';
proc sgplot data=seriesMultiVar subpixel;
series x=date y=Drug_A / smoothconnect
lineattrs=(thickness=3);
xaxis display=(nolabel);
run;
/*--Multi Var Series Plot Sparse Smooth Thick--*/
ods graphics / reset width=5in height=3in imagename='SeriesMulti';
title 'Response by Date';
proc sgplot data=seriesMultiVar subpixel noborder;
series x=date y=Drug_A / smoothconnect lineattrs=(thickness=3);
series x=date y=Drug_B / smoothconnect lineattrs=(thickness=3);
series x=date y=Drug_C / smoothconnect lineattrs=(thickness=3);
xaxis display=(nolabel);
yaxis label='Response';
run;
/*--Grouped Series Plot Sparse Smooth Thick Label--*/
ods graphics / reset width=5in height=3in attrpriority=color imagename='SeriesGroupLabelArrow';
title 'Response by Date';
proc sgplot data=seriesGroup subpixel noborder;
series x=date y=response / group=drug lineattrs=(thickness=3)
arrowheadpos=end arrowheadshape=barbed curvelabel;
xaxis display=(nolabel);
yaxis display=(noline noticks) grid;
run;
/*--Icon--*/
ods listing image_dpi=100;
ods graphics / reset width=2.7in height=1.8in attrpriority=color imagename='SeriesIcon';
title 'Response by Date';
proc sgplot data=seriesGroup subpixel noborder;
series x=date y=response / group=drug lineattrs=(thickness=3)
arrowheadpos=end arrowheadshape=barbed curvelabel;
xaxis display=(nolabel);
yaxis display=(noline noticks) grid;
run;