%let gpath='C:\'; %let dpi=200; proc format; value id 1='County' 2='Memorial'; run; data rating; length Cat $20; format Name id.; do Cat='Cardiac', 'Pediatrics', 'Gastroenterology', 'Oncology', 'ENT', 'Nephrology'; do Id=1 to 20; Rating=0.3 + 0.7*ranuni(2); if id=1 or id=2 then do; name=id; rating2=rating; end; else do; name=.; rating2=.; end; output; end; end; run; /*--Distribution of Hospital Ratings--*/ proc template; define statgraph Rating_Box; begingraph; entrytitle 'Hospital Rating Distribution by Specialty'; layout overlay / xaxisopts=(display=(ticks tickvalues)) yaxisopts=(display=(ticks tickvalues)) ; boxplot x=cat y=rating / orient=horizontal; discretelegend 'a'; endlayout; endgraph; end; run ods listing gpath=&gpath image_dpi=&dpi; ods graphics / reset width=5in height=3in imagename='Rating_Box'; proc sgrender data=rating template=Rating_Box; run; /*--Distribution of Hospital Ratings with Specfic Overlay--*/ proc template; define statgraph Rating_Overlay; begingraph; entrytitle 'Hospital Rating by Specialty'; layout overlay / xaxisopts=(display=(ticks tickvalues)) yaxisopts=(display=(ticks tickvalues)) ; boxplot x=cat y=rating / orient=horizontal; scatterplot y=cat x=rating2 / group=name name='a' includemissinggroup=false; discretelegend 'a'; endlayout; endgraph; end; run ods listing gpath=&gpath image_dpi=&dpi; ods graphics / reset width=5in height=3in imagename='Rating_Overlay'; proc sgrender data=rating template=Rating_Overlay; run; /*--Distribution of Hospital Ratings with Specfic Overlay Label--*/ proc template; define statgraph Rating_Label; begingraph; entrytitle 'Hospital Rating by Specialty'; layout overlay / xaxisopts=(display=(ticks tickvalues)) yaxisopts=(display=(ticks tickvalues)) ; boxplot x=cat y=rating / orient=horizontal; scatterplot y=cat x=rating2 / datalabel=name group=name; endlayout; endgraph; end; run ods listing gpath=&gpath image_dpi=&dpi; ods graphics / reset width=5in height=3in imagename='Rating_Label'; proc sgrender data=rating template=Rating_Label; run; /*--Distribution of Hospital Ratings with Specfic Overlay Label--*/ proc template; define statgraph Rating_Label_Vert; begingraph; entrytitle 'Hospital Rating by Specialty'; layout overlay / xaxisopts=(display=(ticks tickvalues)) yaxisopts=(display=(ticks tickvalues)) ; boxplot x=cat y=rating; scatterplot x=cat y=rating2 / datalabel=name group=name; endlayout; endgraph; end; run ods listing gpath=&gpath image_dpi=&dpi; ods graphics / reset width=5in height=3in imagename='Rating_Label_Vert'; proc sgrender data=rating template=Rating_Label_Vert; run;