Dear everyone,
How are you?
Can I please ask how do I join the 2 points (amount in 2000 & 2001) of the same individual in each level of the x-axis?
Thank you for your help.
FYI here is the code.
ods graphics / antialias=off;
proc sgplot data=tmp;
scatter x=item01 y=amt / group=year groupdisplay=cluster clusterwidth=0.5;
xaxis type=discrete;
run;
ods graphics off;
The answer always depends on the SAS release you are using. Please include program and sample data so we can run the use case. In the graph above, YEAR is a group role, so values for 2000 and 2001 are plotted as side by side clusters. They do not have specific axis values.
Your best bet is to plot a graph using SGPANEL, with PANELBY=item01. Then, each panel can have a SERIES x=year y=amount. You can use other options to move the header values down to look like axis values, and suppress cell borders, etc.
Potentially, if you have SAS9.40M1, you could define data for a POLYGON plot using discreteoffset=column to draw lines between each group value, but that may be more laborious, but better than SGAnnotate.
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.
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.