Data visualization with SAS programming

SGPANEL variable y-axis values

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

SGPANEL variable y-axis values

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


Accepted Solutions
Solution
3 weeks ago
Grand Advisor
Posts: 10,210

Re: SGPANEL variable y-axis values

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


All Replies
Solution
3 weeks ago
Grand Advisor
Posts: 10,210

Re: SGPANEL variable y-axis values

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

Contributor
Posts: 31

Re: SGPANEL variable y-axis values

Thanks a lot for a prompt response!

 

Recep

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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