8209bc7298ad2e24f985bfad3a6d3246f9d7c00b
[pspp-builds.git] / tests / language / stats / glm.at
1 AT_BANNER([GLM procedure])
2
3 AT_SETUP([GLM latin square design])
4
5 dnl This example comes from :
6 dnl  http://ssnds.uwo.ca/statsexamples/spssanova/latinsquareresults.html
7 AT_DATA([latin.sps], [dnl
8 set format = F20.3.
9 data list notable  fixed /a 1 b 3 c 5 y 7-10(2).
10 begin data.
11 1 1 6  3.5
12 1 2 2  8.9
13 1 3 3  9.6
14 1 4 4 10.5
15 1 5 5  3.1
16 1 6 1  5.9
17 2 1 2  4.2
18 2 2 6  1.9
19 2 3 5  3.7
20 2 4 3 10.2
21 2 5 1  7.2
22 2 6 4  7.6
23 3 1 1  6.7
24 3 2 4  5.8
25 3 3 6 -2.7
26 3 4 2  4.6
27 3 5 3  4.0
28 3 6 5 -0.7
29 4 1 4  6.6
30 4 2 1  4.5
31 4 3 2  3.7
32 4 4 5  3.7
33 4 5 6 -3.3
34 4 6 3  3.0
35 5 1 3  4.1
36 5 2 5  2.4
37 5 3 4  6.0
38 5 4 1  5.1
39 5 5 2  3.5
40 5 6 6  4.0
41 6 1 5  3.8
42 6 2 3  5.8
43 6 3 1  7.0
44 6 4 6  3.8
45 6 5 4  5.0
46 6 6 2  8.6
47 end data.
48
49 variable labels a 'Factor A' b 'Factor B' c 'Factor C' y 'Criterion'.
50
51 glm y by   b a c
52   /method=sstype(3)
53   /intercept=include
54   /criteria=alpha(.05)
55   /design = a b c
56   .
57 ])
58
59 AT_CHECK([pspp -O format=csv latin.sps | sed 's/329.62[[678]]/329.62/'], [0],
60   [dnl
61 warning: GLM is experimental.  Do not rely on these results.
62
63 Table: Tests of Between-Subjects Effects
64 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
65 Corrected Model,263.064,15,17.538,5.269,.000
66 Intercept,815.103,1,815.103,244.910,.000
67 Factor A,78.869,5,15.774,4.739,.005
68 Factor B,28.599,5,5.720,1.719,.176
69 Factor C,155.596,5,31.119,9.350,.000
70 Error,66.563,20,3.328,,
71 Total,1144.730,36,,,
72 Corrected Total,329.62,35,,,
73 ])
74
75 AT_CLEANUP
76
77 AT_SETUP([GLM 2 by 2 factorial design])
78
79 AT_DATA([2by2.sps], [dnl
80 set format = F20.3.
81 data list notable  list /Factor0 * Factor1 * points (F10).
82 begin data.
83 1       4       332
84 1       4       380
85 1       4       371
86 1       4       366
87 1       4       354
88 1       0       259.5
89 1       0       302.5
90 1       0       296
91 1       0       349
92 1       0       309
93 2       4       354.67
94 2       4       353.5
95 2       4       304
96 2       4       365
97 2       4       339
98 2       0       306
99 2       0       339
100 2       0       353
101 2       0       351
102 2       0       333
103 end data.
104
105 glm points by Factor0 Factor1
106   /method=sstype(3)
107   /intercept=include
108   /criteria=alpha(.05)
109   .
110 ])
111
112
113 AT_CHECK([pspp -O format=csv 2by2.sps ], [0],
114   [dnl
115 warning: GLM is experimental.  Do not rely on these results.
116
117 Table: Tests of Between-Subjects Effects
118 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
119 Corrected Model,8667.053,3,2889.018,5.043,.012
120 Intercept,2256018.640,1,2256018.640,3937.693,.000
121 Factor0,313.394,1,313.394,.547,.470
122 Factor1,5157.508,1,5157.508,9.002,.008
123 Factor0 * Factor1,3196.150,1,3196.150,5.579,.031
124 Error,9166.865,16,572.929,,
125 Total,2273852.559,20,,,
126 Corrected Total,17833.918,19,,,
127 ])
128
129 AT_CLEANUP