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 2024

Innovate_SAS_Blue.png

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. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 10717 views
  • 1 like
  • 2 in conversation