Hello,
I'm attempting to create a graph to demonstrate variation in medication use by hospitals and region. I think I've gotten close to what I'm after, but I'm running into some struggles while trying to fine tune the figure.
proc sgpanel data=hospitalgraph;
panelby region / novarname onepanel noborder layout=columnlattice uniscale=column ;
vbar ID / response=all_opioid_Mean stat=mean categoryorder=RESPASC barwidth= 0.6 groupdisplay=cluster ;
vbar ID / response=methadone_mean stat=mean barwidth= 0.4 groupdisplay=cluster ;
rowaxis label="Proportion" discreteorder=data ;
colaxis valueattrs=(size=7) VALUESROTATE=VERTICAL label ='Hospital Number';
format region REGION_.;
run;
Specifically, what are some tips/tricks for:
Thank you,
SO
In addition to adding the PROPORTIONAL option mentioned by @Ksharp , add FITPOLICY=ROTATEALWAYS to the COLAXIS. This forces the axis tick values to rotate, even if there is no collision.
When you used the PROPORTIONAL option, the spacing for the second cell must have compressed in a way that there were collisions on that axis as well, causing the ROTATE fit policy to be applied there as well.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.