Hello SAS Communities,
I have the following table:
StateCd | HypRelDeathInd | Frequency | ColPercent |
Iowa | Yes | 3 | 1.53 |
Mississippi | Yes | 6 | 2.90 |
Utah | Yes | 2 | 1.18 |
There is a Weight option you can specify after the slash, but from your description I think you want to specify the colpct as a response
proc sgplot data=mydata;
vbar StateCd /
response=ColPct;
run;
Hi Adhuna - to build off of what ghosh responded, below is the code I would use to achieve this 🙂
VBAR StateCd / RESPONSE = ColPercent
FILLATTRS = (COLOR = LIGHTSALMON)
DATALABEL = COLPercent;
FORMAT COLPercent 6.4;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.