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 🙂

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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