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

Hello all,

I use the SG PANEL procedure including a "BY" statement in the code below to produce the following graphs:

 

proc sgpanel data=_011;
by gcs_group;
panelby order/columns=5 novarname;
scatter x=o_discharge_fiscal_year y=los_sans_alc_mean / LEGENDLABEL= "All cases"

                                                                                             MARKERATTRS=(symbol=circlefilled color=red size=10)

                                                                                             TRANSPARENCY=0.3

                                                                                             DATALABEL=los_sans_alc_mean

                                                                                             DATALABELATTRS=(color=black size=4)

                                                                                             DATALABELPOS=top;
rowaxis values=(5 to 50 by 10) valueattrs=(size=7) grid;
colaxis grid valueattrs=(size=7);
title h=12pt justify=left italic 'Figure 7: Average LOS by hospital by ISS';
footnote ' ';
format order hosp_order. los_sans_alc_mean 4.1;
run;

 

Figure 1.png

 

Figure 2.png

 

As you can see, because the the y-axis values that creates those two figures are very different from each other (the first figure values range between 6.3 and 14.1 and the second figure between 1.0 and 45.6) and I use only one "ROWAXIS" statement in the code, the values in the first graph has the illusion of "stability" (i.e. supressed by the values I choose in the ROWAXIS statement).

 

I was wondering if there is any way to assign different values to each y-axis based on the variable in the "BY" statement? In this case for instance something like, for Figure 1 (GCS:13-15) rowaxis values=(5 to 15 by 5) and for Figure 2 (GCS:3-8) rowaxis values=(5 to 50 by 10). Perhaps the easiest way to write two seperate SG PANEL codes?

 

Thanks in advance!

 

Recep

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Perhaps you want Uniscale=column on the Panelby without a rowaxis values list. Each row would have it's own y scale.

View solution in original post

2 REPLIES 2
ballardw
Super User

Perhaps you want Uniscale=column on the Panelby without a rowaxis values list. Each row would have it's own y scale.

Recep
Quartz | Level 8

Thanks a lot for a prompt response!

 

Recep

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 5606 views
  • 0 likes
  • 2 in conversation