This usually indicates there is no data for section 3 and ID=2.
In that case, the value of &a3 retains its value that it had when ID=1.
Your code doesn't seem to need macros here, it can all by done using BY Variables, if I am not mistaken. I have not tested this code:
PROC MEANS DATA=temp(where=(section^=' ')) NOPRINT N MEAN STD;
VAR score;
CLASS ID section;
OUTPUT OUT=summary N=TOT MEAN=mean_score STD=std_score;
RUN;
%ANNOMAC
DATA anno_data;
set summary;
%SYSTEM(2,2)
if section=1 then do; %LINE(0.7,mean_score,1.3,mean_score,BLACK,1,4); end;
if section=2 then do; %LINE(1.7,mean_score,2.3,mean_score,BLACK,1,4); end;
if section=3 then do; %LINE(2.7,mean_score,3.3,mean_score,BLACK,1,4); end;
RUN;
AXIS1 ORDER=(0 TO 4 BY 1);
PROC GPLOT DATA=temp;
by id;
PLOT score*section / haxis=axis1 ANNO=anno_data;
RUN;
QUIT;
Message was edited by: Paige
... View more