Hi,
SAS published the booklet: How to solve the data science skills shortage
in which a few bar charts are displayed.
I was wondering how to reproduce some of the style using SAS
1. In this graph, there are two subgraphs with subtitles
2. In this graph both title, and legend are aligned with the y-axis.
3. The bars are rounded at their end and statistics within the bars are rounded.
proc sql;
create table have as
select sex,status,bp_status,sum(weight) as weight
from sashelp.heart(obs=50)
group by sex,status,bp_status;
quit;
proc sgpanel data=have ;
title 'XXXXXXXXXXXXXXXX';
panelby sex/spacing=20 columns=1 noborder noheader;
inset sex/nolabel position=nw textattrs=(size=20) ;
scatter y=status x=weight/group=bp_status markerattrs=(symbol=circlefilled size=28 )
groupdisplay=cluster transparency=0.3;
hbarparm category=status response=weight/group=bp_status groupdisplay=cluster
barwidth=0.8 nooutline name='a';
scatter y=status x=weight/group=bp_status markerattrs=(symbol=circlefilled size=28 color=graydd)
groupdisplay=cluster transparency=0.3 ;
scatter y=status x=weight/group=bp_status markerchar=weight groupdisplay=cluster
markercharattrs=(color=black weight=bold);
rowaxis offsetmin=0.4;
colaxis display=none;
keylegend 'a' /position=top noborder;
run;
proc sql;
create table have as
select sex,status,bp_status,sum(weight) as weight
from sashelp.heart(obs=50)
group by sex,status,bp_status;
quit;
proc sgpanel data=have ;
title 'XXXXXXXXXXXXXXXX';
panelby sex/spacing=20 columns=1 noborder noheader;
inset sex/nolabel position=nw textattrs=(size=20) ;
scatter y=status x=weight/group=bp_status markerattrs=(symbol=circlefilled size=28 )
groupdisplay=cluster transparency=0.3;
hbarparm category=status response=weight/group=bp_status groupdisplay=cluster
barwidth=0.8 nooutline name='a';
scatter y=status x=weight/group=bp_status markerattrs=(symbol=circlefilled size=28 color=graydd)
groupdisplay=cluster transparency=0.3 ;
scatter y=status x=weight/group=bp_status markerchar=weight groupdisplay=cluster
markercharattrs=(color=black weight=bold);
rowaxis offsetmin=0.4;
colaxis display=none;
keylegend 'a' /position=top noborder;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.