1 AT_BANNER([GLM procedure])
3 AT_SETUP([GLM latin square design])
5 dnl This example comes from :
6 dnl http://ssnds.uwo.ca/statsexamples/spssanova/latinsquareresults.html
7 AT_DATA([latin.sps], [dnl
9 data list notable fixed /a 1 b 3 c 5 y 7-10(2).
49 variable labels a 'Factor A' b 'Factor B' c 'Factor C' y 'Criterion'.
58 AT_CHECK([pspp -O format=csv latin.sps | sed 's/329.62[[678]]/329.62/'], [0],
60 Table: Tests of Between-Subjects Effects
61 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
62 Corrected Model,263.064,15,17.538,5.269,.000
63 Intercept,815.103,1,815.103,244.910,.000
64 Factor A,78.869,5,15.774,4.739,.005
65 Factor B,28.599,5,5.720,1.719,.176
66 Factor C,155.596,5,31.119,9.350,.000
67 Error,66.563,20,3.328,,
69 Corrected Total,329.62,35,,,
74 AT_SETUP([GLM 2 by 2 factorial design])
76 AT_DATA([2by2.sps], [dnl
78 data list notable list /Factor0 * Factor1 * points (F10).
102 glm points by Factor0 Factor1
109 AT_CHECK([pspp -O format=csv 2by2.sps ], [0],
111 Table: Tests of Between-Subjects Effects
112 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
113 Corrected Model,8667.053,3,2889.018,5.043,.012
114 Intercept,2256018.640,1,2256018.640,3937.693,.000
115 Factor0,313.394,1,313.394,.547,.470
116 Factor1,5157.508,1,5157.508,9.002,.008
117 Factor0 * Factor1,3196.150,1,3196.150,5.579,.031
118 Error,9166.865,16,572.929,,
119 Total,2273852.559,20,,,
120 Corrected Total,17833.918,19,,,
126 AT_SETUP([GLM Type I and II Sums of Squares])
128 dnl The following example comes from
129 dnl http://www.uvm.edu/~dhowell/StatPages/More_Stuff/Type1-3.pdf
130 AT_DATA([data-inc.sps], [dnl
133 data list notable list /dv * Agrp * B0 * B1 * B2 * i0 * i1 * i2 * sss *.
145 11 1 0 0 1 0 0 1 1.00
146 12 1 0 0 1 0 0 1 1.00
147 14 1 0 0 1 0 0 1 1.00
148 11 1 -1 -1 -1 -1 -1 -1 1.00
149 15 1 -1 -1 -1 -1 -1 -1 1.00
150 16 1 -1 -1 -1 -1 -1 -1 1.00
151 10 1 -1 -1 -1 -1 -1 -1 1.00
152 9 1 -1 -1 -1 -1 -1 -1 1.00
153 7 -1 1 0 0 -1 0 0 2.00
154 9 -1 1 0 0 -1 0 0 2.00
155 10 -1 1 0 0 -1 0 0 2.00
156 9 -1 1 0 0 -1 0 0 2.00
157 3 -1 0 1 0 0 -1 0 2.00
158 8 -1 0 1 0 0 -1 0 2.00
159 9 -1 0 1 0 0 -1 0 2.00
160 11 -1 0 1 0 0 -1 0 2.00
161 9 -1 0 0 1 0 0 -1 2.00
162 12 -1 0 0 1 0 0 -1 2.00
163 14 -1 0 0 1 0 0 -1 2.00
164 8 -1 0 0 1 0 0 -1 2.00
165 7 -1 0 0 1 0 0 -1 2.00
166 11 -1 -1 -1 -1 1 1 1 2.00
167 14 -1 -1 -1 -1 1 1 1 2.00
168 10 -1 -1 -1 -1 1 1 1 2.00
169 12 -1 -1 -1 -1 1 1 1 2.00
170 13 -1 -1 -1 -1 1 1 1 2.00
171 11 -1 -1 -1 -1 1 1 1 2.00
172 12 -1 -1 -1 -1 1 1 1 2.00
175 do if B0 = -1 AND B1 = -1 AND B2 = -1.
179 do if B0 = 0 AND B1 = 0 AND B2 = 1.
183 do if B0 = 0 AND B1 = 1 AND B2 = 0.
187 do if B0 = 1 AND B1 = 0 AND B2 = 0.
192 AT_DATA([type1.sps], [dnl
193 include 'data-inc.sps'.
201 /design Bgrp Agrp Bgrp * Agrp
206 AT_CHECK([pspp -O format=csv type1.sps], [0],
208 Table: Tests of Between-Subjects Effects
209 Source,Type I Sum of Squares,df,Mean Square,F,Sig.
210 Corrected Model,216.017,7,30.860,5.046,.001
212 Agrp,9.579,1,9.579,1.566,.220
213 Bgrp,186.225,3,62.075,10.151,.000
214 Agrp * Bgrp,20.212,3,6.737,1.102,.364
215 Error,183.457,30,6.115,,
217 Corrected Total,399.474,37,,,
219 Table: Tests of Between-Subjects Effects
220 Source,Type I Sum of Squares,df,Mean Square,F,Sig.
221 Corrected Model,216.017,7,30.860,5.046,.001
223 Bgrp,193.251,3,64.417,10.534,.000
224 Agrp,2.553,1,2.553,.418,.523
225 Bgrp * Agrp,20.212,3,6.737,1.102,.364
226 Error,183.457,30,6.115,,
228 Corrected Total,399.474,37,,,
232 AT_DATA([type2.sps], [dnl
233 include 'data-inc.sps'.
241 AT_CHECK([pspp -O format=csv type2.sps], [0],
243 Table: Tests of Between-Subjects Effects
244 Source,Type II Sum of Squares,df,Mean Square,F,Sig.
245 Corrected Model,216.017,7,30.860,5.046,.001
247 Agrp,2.553,1,2.553,.418,.523
248 Bgrp,186.225,3,62.075,10.151,.000
249 Agrp * Bgrp,20.212,3,6.737,1.102,.364
250 Error,183.457,30,6.115,,
252 Corrected Total,399.474,37,,,
259 AT_SETUP([GLM excluded intercept])
261 dnl The following example comes from
263 dnl Rudolf N. Cardinal
264 dnl Graduate-level statistics for psychology and neuroscience
265 dnl ANOVA in practice, and complex ANOVA designs
266 dnl Version of 2 May 2004
268 dnl Downloaded from: http://egret.psychol.cam.ac.uk/psychology/graduate/Guide_to_ANOVA.pdf
270 AT_DATA([intercept-exclude.sps], [dnl
273 data list notable list /depvar * A *.
308 AT_CHECK([pspp -O format=csv intercept-exclude.sps], [0],
310 Table: Tests of Between-Subjects Effects
311 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
312 Model,1636.826,2,818.413,43.556,.000
313 A,1636.826,2,818.413,43.556,.000
314 Error,338.216,18,18.790,,
317 Table: Tests of Between-Subjects Effects
318 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
319 Corrected Model,98.568,1,98.568,5.246,.034
320 Intercept,1538.258,1,1538.258,81.867,.000
321 A,98.568,1,98.568,5.246,.034
322 Error,338.216,18,18.790,,
324 Corrected Total,436.784,19,,,
330 AT_SETUP([GLM missing values])
332 AT_DATA([glm.data], [dnl
371 AT_DATA([glm-miss.sps], [dnl
373 data list file='glm.data' notable fixed /a 1 b 3 c 5 y 7-10(2).
376 recode y (else=SYSMIS).
385 AT_CHECK([pspp -O format=csv glm-miss.sps], [0], [dnl
386 Table: Tests of Between-Subjects Effects
387 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
388 Corrected Model,251.621,14,17.973,4.969,.002
389 Intercept,628.376,1,628.376,173.737,.000
390 a,72.929,4,18.232,5.041,.009
391 b,20.703,5,4.141,1.145,.380
392 c,135.179,5,27.036,7.475,.001
393 Error,54.253,15,3.617,,
395 Corrected Total,305.874,29,,,
400 AT_DATA([glm-miss2.sps], [dnl
402 data list file='glm.data' notable fixed /a 1 b 3 c 5 y 7-10(2).
412 AT_CHECK([pspp -O format=csv glm-miss2.sps], [0], [dnl
413 Table: Tests of Between-Subjects Effects
414 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
415 Corrected Model,251.621,14,17.973,4.969,.002
416 Intercept,628.376,1,628.376,173.737,.000
417 a,72.929,4,18.232,5.041,.009
418 b,20.703,5,4.141,1.145,.380
419 c,135.179,5,27.036,7.475,.001
420 Error,54.253,15,3.617,,
422 Corrected Total,305.874,29,,,
426 dnl Now for some missing values in the factor variables.
428 AT_DATA([glm-miss3.sps], [dnl
430 data list file=glm.data notable fixed /a 1 b 3 c 5 y 7-10(2).
433 recode a (else=SYSMIS).
442 AT_CHECK([pspp -O format=csv glm-miss3.sps], [0], [dnl
443 Table: Tests of Between-Subjects Effects
444 Source,Type III Sum of Squares,df,Mean Square,F,Sig.
445 Corrected Model,251.621,14,17.973,4.969,.002
446 Intercept,628.376,1,628.376,173.737,.000
447 a,72.929,4,18.232,5.041,.009
448 b,20.703,5,4.141,1.145,.380
449 c,135.179,5,27.036,7.475,.001
450 Error,54.253,15,3.617,,
452 Corrected Total,305.874,29,,,