BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
priscilabaddouh
Fluorite | Level 6

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. 

1 ACCEPTED SOLUTION
5 REPLIES 5
Damo
SAS Employee

Hi @priscilabaddouh

 

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.

image.png

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

ballardw
Super User

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

DanH_sas
SAS Super FREQ

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

priscilabaddouh
Fluorite | Level 6

Thank you so much. I could not be more thankful. Have an amazing day!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3590 views
  • 3 likes
  • 5 in conversation