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 ?
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:
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:
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.