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:
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;
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;
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;
tyvm 🙂
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.