I'm looking to plot two separate variables on the same bar graph. I am currently using proc gbarline to plot one of the variables, but I'd like another to be displayed next to it as another bar (not a line - essentially another "sumvar" statement). Is this possible, or is there another way/procedure that will perform this? Thanks!
Gbarline supports subgrouped bars (stacked segments), but not grouped bars (side-by-side).
One possible work-around is to use Gchart to create the bar chart, and then use annotate
to draw the line. Here's an example:
Thank you for the information, but it's not quite what I'm looking for. I'm not actually wanting to put a line on the bar graph, I'm wanting to just make a bar graph that looks like the one you just posted (without the line) - but with two different variables. I do not have a "type" that both the variables I want to plot are under; they are each their own and must be plotted separately. Because I also need to plot by subgroups, transposing the data to put them under one heading is not possible. Can I simply combine two different bar graphs?
Hmm ... well, if you don't want a line, then you definitely don't want to be using Proc GBarline
You can combine 2 bar charts with Proc GReplay ... but I don't think the results would be what you're wanting.
Could you possibly post up some example data?
And, better yet, maybe "draw" a picture of the graph you're wanting (scan in a hand-drawn graph, or use a drawing package, or something) to show us what you're wanting?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.