BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Melk
Lapis Lazuli | Level 10

I have some data I am creating vbars for as such:

 

Y             TIME             GROUP           GENDER

1.1              0                    A                      F

1.5              1                    A                      F

1.3              0                    B                      F

1.4              1                    B                      F

1.5              0                    A                      M

1.7              1                    A                      M

 

 

There are no males in group b, but when I run the below code, I get a blank area for group B under the male panel. There was actually never supposed to be males in group b, so I dont want this to display at all. I just want one panel that is for females that displays groups a and b, and then one panel for males that only displays group A. Any way to do this?

 

proc sgpanel data=x;
     panelby gender / novarname;
     vbar group / response=y group=time  groupdisplay=cluster stat=mean;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
JeffMeyers
Barite | Level 11

Hello,

   Try adding UNISCALE=ROW to your panelby statement.

 

  ods graphics / reset;
proc sgpanel data=x;
     panelby gender / novarname uniscale=row;
     vbar group / response=y group=time  groupdisplay=cluster stat=mean;
run;

SGPanel.png

View solution in original post

3 REPLIES 3
JeffMeyers
Barite | Level 11

Hello,

   Try adding UNISCALE=ROW to your panelby statement.

 

  ods graphics / reset;
proc sgpanel data=x;
     panelby gender / novarname uniscale=row;
     vbar group / response=y group=time  groupdisplay=cluster stat=mean;
run;

SGPanel.png

Melk
Lapis Lazuli | Level 10

This is great. Is there any way to get the vertical bars to be the same size for all?

Jay54
Meteorite | Level 14

Add proportional option to panelby statement:

  PANELBY var / PROPORTIONAL;

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
  • 1125 views
  • 3 likes
  • 3 in conversation