BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
oussema
Obsidian | Level 7

Hello All,

I'm trying to connect points by using sgplot but it doesn't work. The option connect exists only with vbox statement and not with scatter statement. You find attached the first figure (but points are not connected. In fact every ID has its assessment in every visit and I'm trying to connect every four points which are assessments of each ID). I need also to connect the three points in the second figure . Is there any solution ?  

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Without any code or test data, this is just theory.  But you have the points you want to draw lines between (these would be your scatter points), but isolate the ones you want and set them into other variables, then have a line plot which plots those points.  E.g

proc sgplot...;
  scatter x=x y=y;
  series x=new_varx y=new_vary;
run;

new vars are the ones holding the datapoints of interest.

 

For plenty of examples look here:

https://blogs.sas.com/content/graphicallyspeaking/

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Without any code or test data, this is just theory.  But you have the points you want to draw lines between (these would be your scatter points), but isolate the ones you want and set them into other variables, then have a line plot which plots those points.  E.g

proc sgplot...;
  scatter x=x y=y;
  series x=new_varx y=new_vary;
run;

new vars are the ones holding the datapoints of interest.

 

For plenty of examples look here:

https://blogs.sas.com/content/graphicallyspeaking/

oussema
Obsidian | Level 7

Thank you, but making new variables for each id is not needed. We can use the 'group' option is 'series' statement and it will solve the problem. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 12200 views
  • 1 like
  • 2 in conversation