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;
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;
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;
This is great. Is there any way to get the vertical bars to be the same size for all?
Add proportional option to panelby statement:
PANELBY var / PROPORTIONAL;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.