BookmarkSubscribeRSS Feed
marieK
Obsidian | Level 7
Hallo,

i created a Panelgraph--Macro and have some problems with my legend.
If i do the graphs scatter and Reg alone everything works fine: with the scatter-Graph i get a symbol-legend for my wildtype-subgroups. The Reg-Graph gives me the legend for the Regression-Lines for my wildtype-subgroups. If i do both like below in my syntax i get a legend with symbols and lines not just for my two wildtype-subgroups, but also for a third group (i think missing values?), also if i dont have any missing values.

Do you have any idea what i can do for having symbols and lines in my legend and that just for my wildtype-Subgroups?


%Macro Panelgraf(Vari=, name=);

proc sgpanel data=final;
panelby genotype sex /layout=lattice novarname;

Scatter x=age y=&Vari /Group=wildtype name='scatter' ;
Reg x=age y=&Vari / Group=wildtype name='Reg' Degree=1 nomarkers;
keylegend 'scatter' 'Reg';

run;
ODS GRAPHICS OFF;
%Mend Panelgraf;

thank you in advance (i use SAS 9.2. Phase 1).

marie
2 REPLIES 2
DanH_sas
SAS Super FREQ
Hey Marie,

The issue you found was fixed in the phase 2 release of SAS 9.2. However, because you are doing a DEGREE=1 regression, you can work around this issue by specifying MAXPOINTS=2 on your REG statement. Let me know if this works for you.

Thanks!
Dan
marieK
Obsidian | Level 7
Hi Dan,

thank you very much. It is working 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1151 views
  • 0 likes
  • 2 in conversation