Hi Experts,
I am trying to generate the bar chart by using the below code in sas 9.2 version.
data have;
input disease$ days treat grade;
cards;
fever 4 2 2
fever 1 2 1
;
legend1 across=1 mode=protect position=(TOP RIGHT OUTSIDE) ;
axis1 label=("Count" ) order=(0 to 4 by 1) minor=none;
axis2 label=("Treatment") order=(1,2) minor=none ;
axis3 label=( "Days") order=(1 to 7 by 1) minor=none ;
proc gchart data=have;
by disease;
vbar treat / group=days subgroup=grade midpoints=(1 2 ) raxis=axis1
maxis=axis2
gaxis=axis3 discrete space=0.5 noframe legend=legend1 width=2.5;
run;
quit;
The problem here is i am getting a
WARNING: Order value specified in the AXIS statement does not match a midpoint value.
This is related to the gaxis=axis3, as i want to display the dummy days as well. so could you please suggest required changes to the code and avoid the warning.
Thanks,
Jag
I believe the warning is not coming from the ORDER on the axis3 statement (the group axis), but from the ORDER on the axis2 statement (midpoint axis). I think if you just remove the ORDER from that statement, the MIDPOINT option on the VBAR statement will give you what you want. Let me know if that does not work for you. Thanks!
Per your suggestion i tried the following but still the warning is coming
legend1 across=1 mode=protect position=(TOP RIGHT OUTSIDE) ;
axis1 label=("Count" ) order=(0 to 4 by 1) minor=none;
axis2 label=("Treatment") minor=none ;
axis3 label=( "Days") order=(1 to 7 by 1) minor=none ;
proc gchart data=have;
by disease;
vbar treat / group=days subgroup=grade midpoints=(1 2 ) raxis=axis1
maxis=axis2
gaxis=axis3 lref=0 cref=cyan wref=5 discrete space=0.5 noframe legend=legend1 width=2.5;
run;
quit;
Hi Dan,
Could you please let me know if there is any alternative approach.
Thanks,
Jag
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.