%let gpath=C:\; ods html close; %let w=5in; %let h=3.5in; %let dpi=200; ods listing gpath="&gpath" image_dpi=&dpi; /*--Macro by Perry Watts--*/ %macro RGBHex(rr,gg,bb); %sysfunc(compress(CX%sysfunc(putn(&rr,hex2.)) %sysfunc(putn(&gg,hex2.)) %sysfunc(putn(&bb,hex2.)))) %mend RGBHex; /*--Key in some data--*/ data efficiency; input Country $ AtBirth Gain Expense; datalines; IE 81 4 2000 MT 80 4 2200 ES 79 5 2000 NL 79 3 3200 SE 79 4 2500 UK 79 4 2450 FL 78 4 2450 DE 77 5 3550 FR 76 6 3050 EL 75.5 4 2000 LU 76 6 3250 AT 76 6 2900 CY 75.5 3 1600 DK 75.5 6 3000 ; run; data efficiency2; label expense='Health care expense per capita'; length Cat $80; set efficiency; Cat='Healthy life expectancy at birth *'; Value=AtBirth; output; Cat='Potential gains in healthy life expectancy w/o increase in health care expense'; Value=Gain; Expense=.; output; run; /*proc print;run;*/ /*--Graph sorted by life expectancy at birth--*/ ods graphics / reset width=&w height=&h noborder imagename='EU_Efficiency'; title 'A closer look at relative efficiency in EU healthcare systems'; footnote j=l h=6pt italic bold '* According to Heijink R. et al, adjusted for the impact of lifestyle differences,' ' such as smoking and alcohol consumption (2015)'; proc sgplot data=efficiency2 noborder; styleattrs datacolors=(%rgbhex(91,187,229) %rgbhex(59,138,197) %rgbhex(233,68,147)) axisextent=data; vbarparm category=country response=Value / group=cat groupdisplay=stack outlineattrs=(color=white) barwidth=0.7 baselineattrs=(thickness=0) filltype=gradient; vbarparm category=country response=expense / barwidth=0.3 y2axis outlineattrs=(color=white) baselineattrs=(thickness=0); yaxis label='Healthy life expectancy at birth in years' values=(0 to 90 by 10) offsetmax=0.2 valueattrs=(size=6) labelattrs=(size=7) labelposition=datacenter; y2axis label='Health care expentiture per capita' values=(0 to 4500 by 500) offsetmax=0.2 valueattrs=(size=6) labelattrs=(size=7) labelposition=datacenter; xaxis display=(noline noticks nolabel) valueattrs=(size=6 weight=bold); keylegend / across=1 noborder valueattrs=(size=7); inset 'Member States achieve very different levels of health outcomes for the same money spent.' ' All Member States could have better results without spending more and by increasing ' 'expentiture efficiency.' / textattrs=(size=7pt) position=top; run; /*--Sort by Expense--*/ proc sort data=efficiency out=efficiency_by_expense; by descending expense; run; data efficiency3; length Cat $80; label expense='Health care expense per capita'; set efficiency_by_expense; Cat='Healthy life expectancy at birth *'; Value=AtBirth; output; Cat='Potential gains in healthy life expectancy w/o increase in health care expense'; Value=Gain; Expense=.; output; run; /*proc print;run;*/ /*--Graph sorted by expense--*/ ods graphics / reset width=&w height=&h noborder imagename='EU_Efficiency_by_Expense'; title 'A closer look at relative efficiency in EU healthcare systems'; footnote j=l h=6pt italic bold '* According to Heijink R. et al, adjusted for the impact of lifestyle differences,' ' such as smoking and alcohol consumption (2015)'; proc sgplot data=efficiency3 noborder; styleattrs datacolors=(%rgbhex(91,187,229) %rgbhex(59,138,197) %rgbhex(233,68,147)) axisextent=data; vbarparm category=country response=Value / group=cat groupdisplay=stack outlineattrs=(color=white) barwidth=0.7 baselineattrs=(thickness=0); vbarparm category=country response=expense / barwidth=0.3 y2axis outlineattrs=(color=white) baselineattrs=(thickness=0); yaxis label='Healthy life expectancy at birth in years' grid values=(0 to 90 by 10) offsetmax=0.2 valueattrs=(size=6) labelattrs=(size=7) labelposition=datacenter; y2axis label='Health care expentiture per capita' values=(0 to 4500 by 500) offsetmax=0.2 valueattrs=(size=6) labelattrs=(size=7) labelposition=datacenter; xaxis display=(noline noticks nolabel) valueattrs=(size=6 weight=bold); keylegend / across=1 noborder valueattrs=(size=7); inset 'Member States achieve very different levels of health outcomes for the same money spent.' ' All Member States could have better results without spending more and by increasing ' 'expentiture efficiency.' / textattrs=(size=7pt) position=top; run; title; footnote; /*--Icon--*/ ods listing image_dpi=100; ods graphics / reset width=2.7in height=1.8in imagename='EU_Icon'; title 'A closer look at relative efficienty in EU healthcare systems'; proc sgplot data=efficiency3 noborder; styleattrs datacolors=(%rgbhex(91,187,229) %rgbhex(59,138,197) %rgbhex(233,68,147)) axisextent=data; vbarparm category=country response=Value / group=cat groupdisplay=stack outlineattrs=(color=white) barwidth=0.7 baselineattrs=(thickness=0); vbarparm category=country response=expense / barwidth=0.3 y2axis outlineattrs=(color=white) baselineattrs=(thickness=0); yaxis label='Healthy life expectancy' values=(0 to 90 by 10) grid gridattrs=(pattern=solid); y2axis label='Health care expense' values=(0 to 4500 by 500); xaxis display=(noline noticks nolabel) valueattrs=(size=7) fitpolicy=none; keylegend / across=1 noborder; run; title;