Maybe a trivial question, but how can I make the graphs (scatterplots) generated from SGPlot to show the BY variables as the graph title and not "Variables ordered by Q3"? This came about after I used PROC Transpose to change my data from wide to long format and after which I sorted the response variable according to a categorical grouping with PROC Sort.
I can't find anything on this in the documentation or on the web and I'm getting desperate 😞
Thanks.
Your question isn't clear to me, but at a guess:
proc sgplot ...;
by avariable;
title "The by variable value here is #byvar1"; /* Note you can also use #byval1 */
scatter x=... y=...;
run;
http://www2.sas.com/proceedings/sugi23/Coders/p75.pdf
Your question isn't clear to me, but at a guess:
proc sgplot ...;
by avariable;
title "The by variable value here is #byvar1"; /* Note you can also use #byval1 */
scatter x=... y=...;
run;
http://www2.sas.com/proceedings/sugi23/Coders/p75.pdf
Another guess: when you use PROC TRANSPOSE, the new variables are given a default label. If you don't like the label on the axes, you can use the XAXIS and YAXIS statements to change them:
proc sgplot;
scatter x=x y=y;
xaxis label="My X label";
yaxis label="My Y label";
run;
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!
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.