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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.