Data visualization with SAS programming

how to do a dot plot for paired samples

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

how to do a dot plot for paired samples

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

 

 


Accepted Solutions
Solution
‎12-17-2015 04:03 PM
Super User
Posts: 11,134

Re: how to do a dot plot for paired samples

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


All Replies
Solution
‎12-17-2015 04:03 PM
Super User
Posts: 11,134

Re: how to do a dot plot for paired samples

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;

 

 

New Contributor
Posts: 3

Re: how to do a dot plot for paired samples

tyvm Smiley Happy
Super User
Posts: 19,167

Re: how to do a dot plot for paired samples

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;
New Contributor
Posts: 3

Re: how to do a dot plot for paired samples

tyvm Smiley Happy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 634 views
  • 0 likes
  • 3 in conversation