I would like to know how I can create a dual axis bar chart with different categories using SAS commands. I am attaching an image that is an example of what I need to do. The example is very accurate, except that I do not need the line graph. Since I am using private data, I cannot upload the data set or my commands. I would truly appreciate any help.
See new Graphically Speaking article inspired by your question.
Did you have a look at Sample 41975: Annotate a right vertical axis on PROC GCHART output, it should help you.
This is the output of the sample.
And you can always use @GraphGuy page Robert Allison's SAS/Graph Examples! which has more examples that you can think of (or Graphics Samples Output Gallery).
Hope that helps.
Cheers,
Damo
@priscilabaddouh wrote:
I cannot upload the data set or my commands.
The data I agree can be sensitive. If you have sufficient information in program code to violate any sensitivity rules I would be very skeptical though. Or change the name of your data set from sensitivename to genericname (HAVE is frequently used on this forum for any existing data set) and similar for variable names.
This should work for you:
proc sgplot data=sashelp.class;
yaxis refticks=(label values);
vbar age / response=weight stat=sum group=sex;
run;
Thanks!
Dan
See new Graphically Speaking article inspired by your question.
Thank you so much. I could not be more thankful. Have an amazing day!
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.