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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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