BookmarkSubscribeRSS Feed
Anthony_eng
Obsidian | Level 7

I am using SAS EG Version 8.3.  I would like to create an SG Plot based on two separate values within the same variable (column).   Is this possible or do I need to create a dataset for each of the value types that I want?  I have posted example data below.  I want to have the values for type AC and type A42 to show as separate sets of data on the same plot if possible.  My goal is to depict how the two values relate during the experiment.  

 

data contains

ExperimentID  TimeStamp  Value  Type

1                       50                14      AC

1                       85                14.4   AC

1                       100              12.7    A42

1                       105              14.1   AC

1                       115              12.5    A42

 

PROC SGPLOT DATA=WORK.SORTED_ID;
	FORMAT ExperimentID BEST10.;
	BY ExperimentID;
	SCATTER X=TIMESTAMP Y=Value / NOMISSINGGROUP GROUP=Type;
	XAXIS LABEL='Time Elapsed (ms)';
	YAXIS LABEL='Value';
RUN;
1 REPLY 1
Reeza
Super User
GROUP is what I would expect to work. Does the code shown not work? If so, please show the log with the error or show the output and what you want to change.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 245 views
  • 0 likes
  • 2 in conversation