I am seeking a reference that will help me create what I believe is called a "positive-negative" bar chart (although I'm not sure). Here's an example visual I found on the web at http://beatexcel.com/positive-negative-bar-chart/ .
In the SAS documentation I found this reference (specifically the BASELINEINTERCEPT statement) https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=grstatgraph&docsetTarget=...
But this is not helpful to me because I prefer/need to do SGPLOT or other SAS Graphics procedures rather than this if possible.
This is a sample dataset I'm trying to graph in this way.
data have;
input day $ value ;
datalines;
Wednesday 1.13203258
Tuesday 1.055489878
Thursday 0.050301811
Monday -0.145520643
Saturday -0.281669589
Sunday -0.281669589
Friday -1.360262415
;
Basic HBAR for the data shown:
proc sgplot data=have; hbar day /response=value; run;
And possible order control using the categoryorder option.
proc sgplot data=have; hbar day /response=value categoryorder=respdesc; run;
Basic HBAR for the data shown:
proc sgplot data=have; hbar day /response=value; run;
And possible order control using the categoryorder option.
proc sgplot data=have; hbar day /response=value categoryorder=respdesc; run;
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.