Hello all, I don't have any issues with getting different marker symbols for the group variable; however, I need to change the color of the symbols based on another variable.
I am familiar with the grouplc option, but my version of SAS, which is 9.4, must not be the most up to date version because this option is not recognized.
Is there a different way to achieve this without the grouplc option?
Thanks!
Run the following to identify your version for starters:
proc setinit;run;
Have you tried the STYLEATTRS statement in PROC SGPLOT? Can you provide sample data we can work with?
Running your code, for current version it says 9.04.01M3P062415
STYLEATTRS does help with the styling, but I am not sure specifically how I would achieve what I need using it. Here is a sample data (not real):
ID | DATE | AGE | VALUE | SUPPORT LEVEL |
1 | 1/1/2016 | 10 | 30 | 1 |
1 | 1/3/2017 | 11 | 35 | 2 |
2 | 2/2/2016 | 11 | 35 | 2 |
2 | 2/5/2017 | 12 | 30 | 3 |
3 | 5/14/2017 | 10 | 36 | 1 |
3 | 5/15/2017 | 10 | 31 | 3 |
x is Age, y is Value, the group is ID but I need the color to be by support level
Is the coloring variable continuous or discrete?
I don't believe it to be continuous. I used colorresponse and gradlegend in the scatter to switch the coloring to a different variable other than the group. Now there is a gradient. As you can see in the sample data above, I don't need a gradient just solid colors, but this is the only way I have found thus far.
Thanks!
If the number of unique combinations between your two class variables is reasonable, you can use an attributes map to bind unique symbol shapes and colors to each crossing. You will need to create a variable that contains unique values that represents each crossing. Here is a blog post that will give you an introduction to attributes maps if you have not used them: http://blogs.sas.com/content/graphicallyspeaking/2012/02/27/roses-are-red-violets-are-blue/
Hope this helps!
Dan
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.