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

Hello there,

 

I'm using SCPANEL (SAS 9.4) to display animal interactions over a series of years.

 

I use

     panelby year / layout=panel columns=2 rows=3;

statement to get all the 6 yearly graphs, and a BY statement to get animal pairs.

    by species1 species2;

 

Where species1 and species2 contain the common name of the species.

 

I use

    title "Interactions between #byval(species1) and #byval(species2) ";

 

The procedure gives the correct display, but across BY groups it keeps the same scaling on the graphs, whereas each set of panels (for a BY group) should be rescaled for the values (number of interactions)  applicable to that species pair.

 

As it is, the scaling for rare species pairs are still done to the axis limits applicable to the very common species which is 100;s of times more (5,000 as max value on Y axis instead of 20 or 30 as max value on Y axis).

 

I can partialy releave the problem   by using

    panelby year / layout=panel columns=2 rows=3 UNISCALE=COLUMN;

but this leaves all the rows in a panel potentially scaled differently, which makes it difficult to visually compare years.

 

----------

 

Is there some setting to make the BY processing to essentially start completely fresh within the BY group (instead of in this case) using some information (Y axix scale) across the whole dataset.

 

If this can't be done, I probably will need to code up a macro to do the BY processing. That is calling up PROC SGPANEL for each pair of species on the data set.

 

Thanks for your thoughts.

 

Ian

 

SAS version info (from a macro we developed)

NOTE: SAS version [sysvlong4] is 9.04.01M4P11092016, Site id [syssite] = 10007393
NOTE: Server Operating system [sysscp]:[sysscpl] is WIN:X64_SR12R2
NOTE: [_CLIENTAPP] Client application is SAS Studio

1 ACCEPTED SOLUTION

Accepted Solutions
IanShannon
Fluorite | Level 6

After much testing and SAS Tech Support, the answer is it cant be done.  There appears to be no switch or setting to turn off the unusual way of doing BY processing.

 

Proc SGPANEL is (in my opinion) incorrectly written, in that it gets information about the WHOLE dataset - across all by groups - to determine the axis scaling.  I'm file with it using the whole PANELBY group to determine the axis scaling, but not the whole dataset.

 

I have used a hack which makes separate calls to SGPANEL to achieve what I wanted.  SAS Tech Support also show me a way using PROC TEMPLATE and PROC SGRENDER.  Rather mind blowing to get round a deficiency in the SAS code for SGPANEL.

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

Without actual data and the full code you are using for the proc it is hard to be sure that any solution will work.

 

If your axis is discrete perhaps the PROPORTIONAL option on the PANELBY might help.

 

 

 

 

IanShannon
Fluorite | Level 6

After much testing and SAS Tech Support, the answer is it cant be done.  There appears to be no switch or setting to turn off the unusual way of doing BY processing.

 

Proc SGPANEL is (in my opinion) incorrectly written, in that it gets information about the WHOLE dataset - across all by groups - to determine the axis scaling.  I'm file with it using the whole PANELBY group to determine the axis scaling, but not the whole dataset.

 

I have used a hack which makes separate calls to SGPANEL to achieve what I wanted.  SAS Tech Support also show me a way using PROC TEMPLATE and PROC SGRENDER.  Rather mind blowing to get round a deficiency in the SAS code for SGPANEL.

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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