I am using proc sgplot and i need sybols in graph as for one treatment as 1 and other treatment as 2 and other treatment as P.
How can i do it using sgplot
What version of SAS are you using?
SAS 9.4
Are you scatter plots grouped or overlaid? It might be helpful to see a snippit of the SGPLOT code.
Attached a layout. in this instaed of circle i need '1' and instead of '*' i need as '2' and other one as 'P' may be.
The reason I need to know if your SGPLOT code is using groups versus overlays is that it will make a difference in the solution. Is your plot statement using the GROUP option, or are you using three plot statements?
In 9.4 there is an option symbol=, for which you can put a character in to display for each plot. See this:
http://blogs.sas.com/content/graphicallyspeaking/?s=symbol%3D
Note that blog is very useful for any graph questions.
Here is a sample solution both the GROUPED and OVERLAID cases:
Overlaid:
proc sgplot data=sashelp.class;
symbolchar name=plot1 char='0031'x;
symbolchar name=plot2 char='0032'x;
scatter x=age y=height / markerattrs=(symbol=plot1 size=12pt);
scatter x=age y=height / markerattrs=(symbol=plot2 size=12pt);
run;
Grouped (two solutions):
ods graphics / attrpriority=none;
proc sgplot data=sashelp.class;
symbolchar name=plot1 char='0031'x;
symbolchar name=plot2 char='0032'x;
styleattrs datasymbols=(plot1 plot2);
scatter x=age y=height / group=sex markerattrs=(size=12pt);
run;
- OR -
data attrmap;
retain id "gender";
input value $ markersymbol $;
cards;
F plot1
M plot2
;
run;
proc sgplot data=sashelp.class dattrmap=attrmap;
symbolchar name=plot1 char='0031'x;
symbolchar name=plot2 char='0032'x;
scatter x=age y=height / group=sex markerattrs=(size=12pt) attrid=gender;
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.