I am trying to plot a chart with multiple scenarios. The code currently used to display it is as follows:
title 'Unemployment Rate Scenario';
proc sgplot data=ifrs_econ_scnr;
series x=ReportingDate y=Raw_UMP/group = Iteration;
format ReportingDate yyqc4.;
yaxis label= 'Unemployment Rate';
refline '30Jun2017'd / axis = x;
run;
The chart is grouped by 'Iteration' and I wanted to know if I could highlight 1 particular iteration (e.g. 1) in the plot and make it a bit more prominent (e.g. change weight of the line). Any ideas?
In a DATA step, before SGPLOT, create a new variable for just iteration 1. Then add a second SERIES statement after the first that just displays that iteration. Use options to make the line heavier or change the color or do what it takes to make it more prominent.
Make the first series black, with a heavier line and the remains as light grey. In fact, it'll probably end up similar to a confidence/prediction interval/band, which is another option to consider. Summarize the data ahead of time to get the max/min to set up prediction intervals and use that to define a band instead.
SGPLOT has examples in the documentation of plotting a line series with banded intervals.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.