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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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