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

Hi,

 

How do I do a plot that looks like this?

Any sample code would be highly appreciated.

 

Many thanks in advance.

 

YiFan

 

 

 

simple dot plot with connecting lines for paired samples:

 

sample.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

If you have a variable which identifies each pair then something like

 

proc sgplot data=have noautolegend nocycleattrs;

   series x=treatment y=glucose / group=Pairidvariable markers Markerattrs= (symbol=CircleFilled)

   ;

 run;

 

 

View solution in original post

4 REPLIES 4
ballardw
Super User

If you have a variable which identifies each pair then something like

 

proc sgplot data=have noautolegend nocycleattrs;

   series x=treatment y=glucose / group=Pairidvariable markers Markerattrs= (symbol=CircleFilled)

   ;

 run;

 

 

ykang0
Calcite | Level 5
tyvm 🙂
Reeza
Super User

Here's one way using SGPLOT. The key thing is to get your data in the right format.

 

data have;
call streaminit(20);

do i=1 to 10;
glucose=rand('normal', 120, 10); A=10; output;
glucose=rand('normal', 120, 10); A=30;
output;
end;
run;

proc sgplot data=have;
series x=A y=glucose/group=i markers MARKERATTRS=(Symbol=circlefilled);
xaxis values=(0 to 40 by 10);
run;
ykang0
Calcite | Level 5

tyvm 🙂

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
  • 4 replies
  • 2856 views
  • 0 likes
  • 3 in conversation