%let gpath='C:\'; %let dpi=200; ods html close; data MostFrequentAE; input AE $1-30 A B Low Mean High; label a='Percent'; label b='Percent'; if mod (_n_, 2) = 0 then RefAE=ae; datalines; ARTHRALGIA 1 3 1 7 48 NAUSIA 4 18 2 4 8 ANOREXIA 2 3 0.9 3.8 16 HEMATURIA 2 4 0.8 3.2 15 INSOMNIA 3 5.5 1.1 3.0 7 VOMITING 3.5 6 1.2 2.5 6 DYSPEPSIA 4 10 1.1 2.4 4.5 WEIGHT DECREASE 1.5 3 0.5 2.0 4.2 RESIPRATORY DISORDER 3 4 0.4 1.4 4 HEADACHE 7 10 0.8 1.1 2 GASTROESOPHAGEAL REFLUX 3 4 0.5 1.05 3.8 BACK PAIN 5 6 0.8 1.04 2 CHRONIC OBSTRUCTIVE AIRWAY 22 38 0.6 0.7 0.8 DYSPNEA 7 2.5 0.13 0.3 0.7 ; run; proc sort data=MostFrequentAE out= MostFrequentAESort; by mean; run; /*ods html;*/ /*proc print noobs; run;*/ /*ods html close;*/ ods listing gpath=&gpath image_dpi=&dpi; /*--Create single cell graph--*/ ods listing sge=off image_dpi=&dpi gpath=&gpath; ods graphics / reset width=5in height=3in imagename="Single_Graph_V94"; Title 'Most Frequent On Therapy Adverse Events'; proc sgplot data= MostFrequentAESort nocycleattrs; scatter y=ae x=a / name='a' legendlabel='Drug A (N=216)' markerattrs=graphdata1; scatter y=ae x=b / name='b' legendlabel='Drug B (N=431)' markerattrs=graphdata2; keylegend 'a' 'b'; yaxis display=(nolabel noticks) valueattrs=(size=7) fitpolicy=none colorbands=odd colorbandsattrs=(transparency=0.5); xaxis label='Percent' labelpos=datacenter grid; run; title; footnote; /*--SAS 9.2--*/ ods graphics / reset width=5in height=3in imagename="Two_In_One_V92"; Title 'Most Frequent On Therapy Adverse Events Sorted By Relative Risk'; proc sgplot data= MostFrequentAESort nocycleattrs; refline refae / lineattrs=(thickness=12) transparency=0.8; scatter y=ae x=a / name='a' legendlabel='Drug A (N=216)' markerattrs=graphdata1; scatter y=ae x=b / name='b' legendlabel='Drug B (N=431)' markerattrs=graphdata2; scatter y=ae x=mean / xerrorlower=low xerrorupper=high x2axis markerattrs=graphdatadefault(symbol=x) errorbarattrs=(pattern=solid); refline 40 / axis=x; keylegend 'a' 'b'; yaxis display=(nolabel noticks); xaxis offsetmax=0.5 grid labelattrs=(size=8) label='Percent '; x2axis offsetmin=0.5 type=log logbase=2 logstyle=logexpand grid max=64 labelattrs=(size=8) label=' Relative Risk with 95% CL'; run; title; footnote; /*--Create graph using HighLow to avoid caps and Y FitPolicy=none--*/ ods graphics / reset width=5in height=3in imagename="Two_In_One_V93"; Title 'Most Frequent On Therapy Adverse Events Sorted By Relative Risk'; proc sgplot data= MostFrequentAESort nocycleattrs; refline refae / lineattrs=(thickness=12) transparency=0.8; scatter y=ae x=a / name='a' legendlabel='Drug A (N=216)' markerattrs=graphdata1; scatter y=ae x=b / name='b' legendlabel='Drug B (N=431)' markerattrs=graphdata2; highlow y=ae low=low high=high / x2axis; scatter y=ae x=mean / x2axis markerattrs=(symbol=x); refline 40 / axis=x; keylegend 'a' 'b'; yaxis display=(nolabel noticks) valueattrs=(size=7) fitpolicy=none; xaxis offsetmax=0.5 grid labelattrs=(size=8) valueattrs=(size=7) label='Percent '; x2axis offsetmin=0.5 type=log logbase=2 logstyle=logexpand grid max=64 labelattrs=(size=8) valueattrs=(size=7) label=' Relative Risk with 95% CL'; run; /*--Create graph using ColorBands, NOERRORCAPS, LABELPOS=DATACENTER and Y FitPolicy=none--*/ ods listing sge=off image_dpi=&dpi gpath=&gpath; ods graphics / reset width=5in height=3in imagename="Two_In_One_V94"; Title 'Most Frequent On Therapy Adverse Events Sorted By Relative Risk'; proc sgplot data= MostFrequentAESort nocycleattrs; scatter y=ae x=a / name='a' legendlabel='Drug A (N=216)' markerattrs=graphdata1; scatter y=ae x=b / name='b' legendlabel='Drug B (N=431)' markerattrs=graphdata2; scatter y=ae x=mean / xerrorlower=low xerrorupper=high x2axis markerattrs=(symbol=x) noerrorcaps; refline 40 / axis=x; keylegend 'a' 'b'; yaxis display=(nolabel noticks) valueattrs=(size=7) fitpolicy=none colorbands=odd colorbandsattrs=(transparency=0.5); xaxis offsetmax=0.5 grid labelattrs=(size=8) valueattrs=(size=7) label='Percent' labelpos=datacenter minor; x2axis offsetmin=0.5 type=log logbase=2 logstyle=logexpand grid max=64 labelattrs=(size=8) valueattrs=(size=7) labelpos=datacenter label='Relative Risk with 95% CL'; run; title; footnote; /*--Create Icon--*/ ods listing gpath=&gpath image_dpi=100; ods graphics / reset width=2.7in height=1.8in imagename="Two_In_One_Icon"; Title 'Most Frequent On Therapy Adverse Events'; proc sgplot data= MostFrequentAE(obs=8) nocycleattrs noautolegend; scatter y=ae x=a / name='a' legendlabel='Drug A (N=216)' markerattrs=graphdata1; scatter y=ae x=b / name='b' legendlabel='Drug B (N=431)' markerattrs=graphdata2; scatter y=ae x=mean / xerrorlower=low xerrorupper=high x2axis markerattrs=(symbol=x) noerrorcaps; refline 17 / axis=x; /* keylegend 'a' 'b';*/ yaxis display=(nolabel noticks) valueattrs=(size=7) fitpolicy=none reverse colorbands=odd colorbandsattrs=(transparency=0.5); xaxis offsetmax=0.5 grid labelattrs=(size=8) valueattrs=(size=7) label='Percent' labelpos=datacenter minor; x2axis offsetmin=0.5 type=log logbase=2 logstyle=logexpand grid max=64 labelattrs=(size=8) valueattrs=(size=7) labelpos=datacenter label='Risk with 95% CL'; run; title; footnote;