I have the following code:
/* Vertical Bar Chart */
Axis order=("NH White" "NH other" "Hispanic" "NH Black");
Proc GCHART data=WORK.RACEFLU3;
Vbar race / sumvar=rowpercent raxis=axis;
Run;
It displays the % of people vaccinated (numeric) by race/ethnicity (character). I'm trying to get those race/ethnicity categories to appear sorted by descending % on the horizontal axis (so: "NH White" "NH other" "Hispanic" "NH Black").
But whatever I'm doing above doesn't work and the suggestions I've found so far online don't really help, either.
Any ideas?
1. Sort your data before graphing.
2. Try SGPLOT + HBAR/VBAR which allows you a little more control than SAS/GRAPH.
If you need help with code, please post sample data or provide code that uses one of the datasets in the SASHELP library, such as CLASS, CARS or HEART.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: