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,
%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);
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
Have you tried
options nobyline;
?
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.
Ready to level-up your skills? Choose your own adventure.