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

I'm creating a series of scatterplots using proc sgpanel. I want them to be organised by my population categories, so I created a new variable to use a number so they're in the proper order. The thing I want to change is the heading in each cell. I took out the variable name, so now it just shows '1', '2', etc. However, I want them to say 'Total population, 5k', 'Total population, 10k', etc. Is there a way to do this? Or do I have to set it up a certain way before doing proc sgpanel? Thanks!

 

data want;
    set want;
        if series ='tot5k' then nseries=1;
        else if series='tot10k' then nseries=2;
        else if series='tot15k' then nseries=3;
run;

proc format;
    value nseries     1='Total population, 5k'
                               2='Total population, 10k'
                               3='Total population, 15k';
run;

ods graphics / antialias=on antialiasmax=4300 subpixel=on;
proc sgpanel data=want;
    panelby nseries / novarname columns=4;
    scatter x=case y=measure;
    colaxis label='Cases';
    rowaxis label='Measure';
    refline 30 / axis=y label=('Cut-point');
run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Just adding the FORMAT statement on the proc should do it for you:

 

proc sgpanel data=want;

    format nseries nseries.;
    panelby nseries / novarname columns=4;
    scatter x=case y=measure;
    colaxis label='Cases';
    rowaxis label='Measure';
    refline 30 / axis=y label=('Cut-point');
run;

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Just adding the FORMAT statement on the proc should do it for you:

 

proc sgpanel data=want;

    format nseries nseries.;
    panelby nseries / novarname columns=4;
    scatter x=case y=measure;
    colaxis label='Cases';
    rowaxis label='Measure';
    refline 30 / axis=y label=('Cut-point');
run;

wernie
Quartz | Level 8
Ah, yes! That should have been obvious, but for some reason, it wasn't. Worked perfectly. Thanks 🙂

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2370 views
  • 1 like
  • 2 in conversation