I want to get the plot of score by section for each ID, that is,one page for each ID, and draw a line to label the mean. I have many many IDs so I used a macro to do it. Here is my code:
PROC MEANS DATA=temp2 NOPRINT N MEAN STD;
OUTPUT OUT=summary N=TOT MEAN=mean_score STD=std_score;
if section='' then delete;
proc sort data=summary2;
AXIS1 ORDER=(0 TO 4 BY 1);
PROC GPLOT DATA=temp2 ANNO=anno_data;
PLOT score*section / haxis=axis1;
The first plot (ID=1) is correct. For ID=2, the data doesn't have section 3, but sas still draw a line at y=77.6, I guess this is the mean for a3 when ID=1, so it seemed it passed the value of last run. I don't understand how this happen. Thanks in advance.
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.