pivot table procedure conceptually works
[pspp] / examples / pivot.sps
1 * Based on the tutorial at http://www.ats.ucla.edu/stat/spss/library/sp_pivot.htm.
2 data list list notable/sex tumor dose statistics (f1) data (f5.1).
3 value labels
4       /sex 0 'Female' 1 'Male'
5       /tumor 0 'Absent' 1 'Present' 2 'Total'
6       /dose 0 'Control' 1 'Low' 2 'Medium' 3 'High' 4 'Total'
7       /statistics 0 'Count' 1 'Tumor%'.
8 begin data.
9 0 0 0 0  6
10 0 0 0 1 21.4
11 0 0 1 0 11
12 0 0 1 1 39.3
13 0 0 2 0  6
14 0 0 2 1 21.4
15 0 0 3 0  5
16 0 0 3 1 17.9
17 0 0 4 0 28
18 0 0 4 1  100
19 0 1 0 0  6
20 0 1 0 1 26.1
21 0 1 1 0  5
22 0 1 1 1 21.7
23 0 1 2 0  6
24 0 1 2 1 26.1
25 0 1 3 0  6
26 0 1 3 1 26.1
27 0 1 4 0 23
28 0 1 4 1  100
29 0 2 0 0 12
30 0 2 0 1 23.5
31 0 2 1 0 16
32 0 2 1 1 31.4
33 0 2 2 0 12
34 0 2 2 1 23.5
35 0 2 3 0 11
36 0 2 3 1 21.6
37 0 2 4 0 51
38 0 2 4 1  100
39 1 0 0 0 18
40 1 0 0 1 30.5
41 1 0 1 0 11
42 1 0 1 1 18.6
43 1 0 2 0 17
44 1 0 2 1 28.8
45 1 0 3 0 13
46 1 0 3 1 22.0
47 1 0 4 0 59
48 1 0 4 1  100
49 1 1 0 0  3
50 1 1 0 1 25.0
51 1 1 1 0  3
52 1 1 1 1 25.0
53 1 1 2 0  2
54 1 1 2 1 16.7
55 1 1 3 0  4
56 1 1 3 1 33.3
57 1 1 4 0 12
58 1 1 4 1  100
59 1 2 0 0 21
60 1 2 0 1 29.6
61 1 2 1 0 14
62 1 2 1 1 19.7
63 1 2 2 0 19
64 1 2 2 1 26.8
65 1 2 3 0 17
66 1 2 3 1 23.9
67 1 2 4 0 71
68 1 2 4 1  100
69 end data.
70
71 format sex tumor dose(f1).
72 *select if tumor=1 and statistics=1.
73 debug pivot /rows=sex tumor statistics/columns=dose/data=data.
74