1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
* How to print mean +/- SD in a table.
* Raynald Levesque.

DATA LIST LIST /ageband amount.
BEGIN DATA
1 25
1 35
1 58
2 52
2 53
2 84
3 51
3 41
3 26
3 52
END DATA.
LIST.
AGGREGATE
  /OUTFILE=*
  /BREAK=ageband
  /mean1 = MEAN(amount) /stddev = SD(amount).
STRING answer(A25).
COMPUTE answer=CONCAT(STRING(mean1,F8.2),' +/- ',STRING(stddev,F8.2)).
LIST.