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

Hi, I'm trying to create a bar graph in SAS with many sub-divisions but with little progress. Does anyone know how to make the following graph in SAS? It is very important that I get all 8 groups and the three subgroups within each, and the yes/no response (find attached). I'm on version 9.4. Thanks!sasexample.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

This example should help you:

 

proc sgpanel data=sashelp.heart;
panelby weight_status / onepanel layout=columnlattice novarname noborder;
vbar chol_status / group=sex groupdisplay=cluster;
rowaxis grid;
run;

If you want to move the headers to the bottom, specify COLHEADERPOS=bottom on the PANELBY statement.

 

Hope this helps!

Dan

View solution in original post

3 REPLIES 3
ballardw
Super User

@richart wrote:

Hi, I'm trying to create a bar graph in SAS with many sub-divisions but with little progress. Does anyone know how to make the following graph in SAS? It is very important that I get all 8 groups and the three subgroups within each, and the yes/no response (find attached). I'm on version 9.4. Thanks!sasexample.PNG


Your example looks like an oldish PROC GCHART graph.

It would help to show what you have attempted so far, preferably with a bit of example data. This might require some data transformations depending upon your current data structure.

DanH_sas
SAS Super FREQ

This example should help you:

 

proc sgpanel data=sashelp.heart;
panelby weight_status / onepanel layout=columnlattice novarname noborder;
vbar chol_status / group=sex groupdisplay=cluster;
rowaxis grid;
run;

If you want to move the headers to the bottom, specify COLHEADERPOS=bottom on the PANELBY statement.

 

Hope this helps!

Dan

richart
Fluorite | Level 6

That is better than I could have dreamed! Cheers!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 745 views
  • 1 like
  • 3 in conversation