I am doing a survival curve using proc sgplot and the group statement. I have a total of 8 groups. I need some of the groups to have dotted lines and some of them to have full lines and specify every groups colour.
How to put it into the following code?
proc sgplot data=abc2; series x=weeks y=SURVIVAL1 /group = exp_event; run;
The column names in an attributes map are reserved keywords, so they must be spelled as they are expected. In your screenshot, you have spelled the expected "fillcolor" with the alternate "fillcolour" spelling. Also, for a series plot, you should be using "linecolor" instead of "fillcolor".
@PeterClemmensen is correct. You' will want to use an attributes map. Here is a simple example using a SERIES plot below:
data attrmap; retain ID "myid" nocase "true"; input value $ linecolor $ linepattern $; cards; F pink solid M blue dash ; run; proc sgplot data=sashelp.class dattrmap=attrmap; series x=name y=weight / group=sex attrid=myid; run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.