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

Hi all,

I am using the below code to draw a frequency distribution/histogram and getting the graphs as in the attachment. I don't know how I can

remove the "cluster=1" or "1" title above the graphs. I am drawing these graphs per cluster but I don't want that information since I am indicating it in the title.

 

Thanks,

 

 

 

 

 

SGPanel96.pngSGPlot.png

 


%macro graphs2(g, p,r,a);
 
ods graphics / width=400px height=250px;
proc sgpanel data = &g._gr_&a. ;
title "Scale Score: &p &r.";

panelby cluster / columns = 1 rows=1  uniscale = column novarname;
histogram   &g._scale_score  /  transparency=0.25 fillattrs=(color=black)   ;
label &g._scale_score= 'Scale Score'; 
rowaxis label= 'Count'; 
colaxis  values=(910 to 945 by 5) valueshint;
	   run;

ods graphics / width=400px height=250px;
proc sort data=&g._gr_&a. ;
 by cluster;
run;

proc sgplot data=&g._gr_&a. PCTLEVEL=BY;
title "Proficiency Level:&p &r.";
vbar &g._pl / stat=pct  transparency=0.25 fillattrs=(color=black)  ;
yaxis label= 'Percent' ;
xaxis label= 'Proficiency Level';
 by cluster;
run;

%mend;
%graphs2 (listening,List,1-2,1);
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

You have two options:

1. Keep the code you have and add the NOHEADER option to the PANELBY statement.

2. Since you're generating one cell per graph, you can use SGPLOT with a BY statement to generate this output instead. SGPLOT has options for creating uniform axes across BY-groups. You would also want to use the statement "OPTIONS NOBYLINE;" (before the procedure) to suppress the BY-line, as you have the information you want in your title.

 

Hope this helps!

Dan

View solution in original post

3 REPLIES 3
andreas_lds
Jade | Level 19

Have you tried

options nobyline;

?

DanH_sas
SAS Super FREQ

You have two options:

1. Keep the code you have and add the NOHEADER option to the PANELBY statement.

2. Since you're generating one cell per graph, you can use SGPLOT with a BY statement to generate this output instead. SGPLOT has options for creating uniform axes across BY-groups. You would also want to use the statement "OPTIONS NOBYLINE;" (before the procedure) to suppress the BY-line, as you have the information you want in your title.

 

Hope this helps!

Dan

dustychair
Pyrite | Level 9
That worked! Thank you so much!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 1520 views
  • 3 likes
  • 3 in conversation