1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
* QUESTION. How can I do a scatter plot for each member of the group,
* and identify the position of the member in the chart.

* ANSWER.

* --------------------------DEFINE MACRO ----------------------.
DEFINE !PRINT(!POS=!TOKENS(1))

!DO !counter = 1 !TO !1.
compute you=0.
if $casenum=!counter you=!counter.

* You could use a chart template to have a differently shape symbol for the given member.
GRAPH
   /SCATTERPLOT(BIVAR)=id WITH cumsco BY you
   /MISSING=LISTWISE .
!DOEND.

!ENDDEFINE.
*----------------------------END OF MACRO ----------------.


INPUT PROGRAM.
LOOP id=1 TO 10.
COMPUTE score=UNIFORM(50).
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.

compute cumsco=0.
Do if $casenum=1.
compute cumsco=score.
else.
compute cumsco = lag(cumsco)+score.
end if.

* Call macro.
!PRINT 10.