%let gpath='C:\'; %let dpi=100; ods html close; %let min=1; %let type=log; /*--OE Brest Cancer Stages Plot--*/ data oeb_grp; input type $1-10 Ethnicity $ Stage; min=&min; datalines; Type 1 White 2.1 Type 1 Black 2.4 Type 1 Hispanic 3.8 Type 2 White 1.8 Type 2 Black 1.2 Type 2 Hispanic 2.8 Type 3 White 2.3 Type 3 Black 3.4 Type 3 Hispanic 3.5 ; run; /*--OE Brest Cancer Stages Plot--*/ data oeb_multi; input type $1-10 White Black Hispanic; ref=type; if mod(_n_, 2)=1 then ref=''; min=&min; WhiteLabel=' White'; BlackLabel=' Black'; HispanicLabel=' Hispanic'; datalines; Type 1 2.1 2.4 3.8 Type 2 1.8 1.2 2.8 Type 3 2.3 3.4 3.5 ; run; /*proc print;run;*/ proc template; define Style OEB; parent = styles.listing; style GraphColors from graphcolors / "gdata1" = cxbfbfbf "gdata2" = cx4f4fff "gdata3" = cx4fcf4f ; end; run; /*--HighLow OEB plot with Log Y axis--*/ ods listing style=oeb gpath=&gpath image_dpi=&dpi; ods graphics / reset noscale width=5in height=3in imagename='OEB_HighLow'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_grp; format stage 4.1; highlow x=type low=min high=stage /group=ethnicity groupdisplay=cluster type=bar highlabel=stage clusterwidth=0.6 lineattrs=(color=grey pattern=solid); yaxis type=&type logbase=2 max=4 offsetmin=0 grid display=(nolabel); xaxis display=(nolabel noticks); keylegend / location=inside position=topleft across=1 noborder; run; /*--Log response axis bar using BarChart in GTL--*/ proc template; define statgraph oeb; begingraph; entrytitle 'OE Breast Cancer Stages by Ethnicity'; layout overlay / yaxisopts=(type=&type logopts=(base=2 viewmin=&min viewmax=4) display=(tickvalues ticks) griddisplay=on) xaxisopts=(display=(tickvalues line)); barchart x=type y=stage / group=ethnicity groupdisplay=cluster name='a' baselineintercept=&min clusterwidth=0.6 barlabel=true dataskin=pressed; discretelegend 'a' / location=inside halign=left valign=top across=1 border=false opaque=true; endlayout; endgraph; end; run; ods graphics / reset width=5in height=3in imagename='OEB_GTL'; proc sgrender data=oeb_grp template=oeb; run; /*--Dot plot of OEB with Log Y axis--*/ ods listing style=listing; ods graphics / reset noscale width=5in height=3in imagename='OEB_Dot'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_multi; format white black hispanic 4.1; dot type / response=white discreteoffset=-0.2 nostatlabel; dot type / response=black discreteoffset= 0.0 nostatlabel; dot type / response=hispanic discreteoffset= 0.2 nostatlabel; xaxis type=&type logbase=2 logstyle=linear min=&min max=4 grid display=(nolabel); yaxis display=(nolabel noticks) offsetmin=0.2 offsetmax=0.2; keylegend / title='Ethnicity:'; run; /*--Dot plot of OEB with Log Y axis--*/ ods graphics / reset noscale width=5in height=3in imagename='OEB_Dot_Bands'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_multi; format white black hispanic 4.1; refline ref / lineattrs=(thickness=60 color=lightgray) transparency=0.6; dot type / response=white discreteoffset=-0.2 nostatlabel markerattrs=(symbol=circlefilled size=11) ; dot type / response=black discreteoffset= 0.0 nostatlabel markerattrs=(symbol=circlefilled size=11); dot type / response=hispanic discreteoffset= 0.2 nostatlabel markerattrs=(symbol=circlefilled size=11); xaxis type=&type logbase=2 logstyle=linear min=&min max=4.1 grid display=(nolabel) offsetmin=0.0 offsetmax=0.0; yaxis display=(nolabel noticks) offsetmin=0.2 offsetmax=0.2; keylegend / title='Ethnicity:'; run; /*--Needle plot of OEB with Log Y axis--*/ ods listing style=listing; ods graphics / reset noscale width=5in height=3in imagename='OEB_Dot_Needle_Band'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_multi nocycleattrs; format white black hispanic 4.1; refline ref / lineattrs=(thickness=60 color=lightgray) transparency=0.6; highlow y=type low=min high=white / type=line discreteoffset=-0.2 lineattrs=(color=lightgray pattern=solid); scatter y=type x=white / discreteoffset=-0.2 name='w' legendlabel='White' markerattrs=graphdata1(symbol=circlefilled size=11) ; highlow y=type low=min high=black / type=line discreteoffset= 0.0 lineattrs=(color=lightgray pattern=solid); scatter y=type x=black / discreteoffset= 0.0 name='b' legendlabel='Black' markerattrs=graphdata2(symbol=circlefilled size=11); highlow y=type low=min high=hispanic / type=line discreteoffset= 0.2 lineattrs=(color=lightgray pattern=solid); scatter y=type x=hispanic / discreteoffset= 0.2 name='h' legendlabel='Hispanic' markerattrs=graphdata3(symbol=circlefilled size=11); xaxis type=&type logbase=2 logstyle=linear min=&min max=4.1 grid display=(nolabel) offsetmin=0.0 offsetmax=0.0; /* xaxis min=&min max=4.1 grid display=(nolabel)offsetmin=0.0 offsetmax=0.0;*/ yaxis display=(nolabel noticks) offsetmin=0.2 offsetmax=0.2; keylegend 'w' 'b' 'h' / title='Ethnicity:'; run; /*--Needle plot of OEB with Log Y axis--*/ ods listing style=listing; ods graphics / reset noscale width=5in height=3in imagename='OEB_Dot_Needle_Band_ClassLabel'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_multi nocycleattrs noautolegend; format white black hispanic 4.1; refline ref / lineattrs=(thickness=60 color=lightgray) transparency=0.6; highlow y=type low=min high=white / type=line discreteoffset=-0.2 highlabel=whitelabel lineattrs=(color=lightgray pattern=solid); scatter y=type x=white / discreteoffset=-0.2 name='w' legendlabel='White' markerattrs=graphdata1(symbol=circlefilled size=11); highlow y=type low=min high=black / type=line discreteoffset= 0.0 highlabel=blacklabel lineattrs=(color=lightgray pattern=solid); scatter y=type x=black / discreteoffset= 0.0 name='b' legendlabel='Black' markerattrs=graphdata2(symbol=circlefilled size=11); highlow y=type low=min high=hispanic / type=line discreteoffset= 0.2 highlabel=hispaniclabel lineattrs=(color=lightgray pattern=solid); scatter y=type x=hispanic / discreteoffset= 0.2 name='h' legendlabel='Hispanic' markerattrs=graphdata3(symbol=circlefilled size=11); xaxis type=&type logbase=2 logstyle=linear min=&min max=4.1 grid display=(nolabel) offsetmin=0; /* xaxis min=&min max=4.1 grid display=(nolabel) offsetmin=0;*/ yaxis display=(nolabel noticks) offsetmin=0.2 offsetmax=0.2; run; /*--Needle plot of OEB with Log Y axis--*/ ods listing style=listing; ods graphics / reset noscale width=5in height=3in imagename='OEB_Dot_Needle_Band_ValueLabel'; title 'OE Breast Cancer Stages by Ethnicity'; proc sgplot data=oeb_multi nocycleattrs; format white black hispanic 4.1; refline ref / lineattrs=(thickness=60 color=lightgray) transparency=0.6; highlow y=type low=min high=white / type=line discreteoffset=-0.2 highlabel=white lineattrs=(color=lightgray pattern=solid); scatter y=type x=white / discreteoffset=-0.2 name='w' legendlabel='White' markerattrs=graphdata1(symbol=circlefilled size=11); highlow y=type low=min high=black / type=line discreteoffset= 0.0 highlabel=black lineattrs=(color=lightgray pattern=solid); scatter y=type x=black / discreteoffset= 0.0 name='b' legendlabel='Black' markerattrs=graphdata2(symbol=circlefilled size=11); highlow y=type low=min high=hispanic / type=line discreteoffset= 0.2 highlabel=hispanic lineattrs=(color=lightgray pattern=solid); scatter y=type x=hispanic / discreteoffset= 0.2 name='h' legendlabel='Hispanic' markerattrs=graphdata3(symbol=circlefilled size=11); xaxis type=&type logbase=2 logstyle=linear min=&min max=4 grid display=(nolabel) offsetmin=0; yaxis display=(nolabel noticks) offsetmin=0.2 offsetmax=0.2; keylegend 'w' 'b' 'h' / title='Ethnicity:'; run;