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;
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.