1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([GLM procedure])
19 AT_SETUP([GLM latin square design])
20 AT_KEYWORDS([categorical categoricals])
22 dnl This example comes from :
23 dnl http://ssnds.uwo.ca/statsexamples/spssanova/latinsquareresults.html
24 AT_DATA([latin.sps], [dnl
26 data list notable fixed /a 1 b 3 c 5 y 7-10(2).
66 variable labels a 'Factor A' b 'Factor B' c 'Factor C' y 'Criterion'.
75 AT_CHECK([pspp -O format=csv latin.sps | sed 's/329.62[[678]]/329.62/'], [0],
77 Table: Tests of Between-Subjects Effects
78 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
79 Corrected Model,263.064,15,17.538,5.269,.000
80 Intercept,815.103,1,815.103,244.910,.000
81 Factor A,78.869,5,15.774,4.739,.005
82 Factor B,28.599,5,5.720,1.719,.176
83 Factor C,155.596,5,31.119,9.350,.000
84 Error,66.563,20,3.328,,
86 Corrected Total,329.62,35,,,
91 AT_SETUP([GLM 2 by 2 factorial design])
92 AT_KEYWORDS([categorical categoricals])
94 AT_DATA([2by2.sps], [dnl
96 data list notable list /Factor0 * Factor1 * points (F10).
120 glm points by Factor0 Factor1
127 AT_CHECK([pspp -O format=csv 2by2.sps ], [0],
129 Table: Tests of Between-Subjects Effects
130 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
131 Corrected Model,8667.053,3,2889.018,5.043,.012
132 Intercept,2256018.640,1,2256018.640,3937.693,.000
133 Factor0,313.394,1,313.394,.547,.470
134 Factor1,5157.508,1,5157.508,9.002,.008
135 Factor0 × Factor1,3196.150,1,3196.150,5.579,.031
136 Error,9166.865,16,572.929,,
137 Total,2273852.559,20,,,
138 Corrected Total,17833.918,19,,,
144 AT_SETUP([GLM Type I and II Sums of Squares])
145 AT_KEYWORDS([categorical categoricals])
147 dnl The following example comes from
148 dnl http://www.uvm.edu/~dhowell/StatPages/More_Stuff/Type1-3.pdf
149 AT_DATA([data-inc.sps], [dnl
152 data list notable list /dv * Agrp * B0 * B1 * B2 * i0 * i1 * i2 * sss *.
164 11 1 0 0 1 0 0 1 1.00
165 12 1 0 0 1 0 0 1 1.00
166 14 1 0 0 1 0 0 1 1.00
167 11 1 -1 -1 -1 -1 -1 -1 1.00
168 15 1 -1 -1 -1 -1 -1 -1 1.00
169 16 1 -1 -1 -1 -1 -1 -1 1.00
170 10 1 -1 -1 -1 -1 -1 -1 1.00
171 9 1 -1 -1 -1 -1 -1 -1 1.00
172 7 -1 1 0 0 -1 0 0 2.00
173 9 -1 1 0 0 -1 0 0 2.00
174 10 -1 1 0 0 -1 0 0 2.00
175 9 -1 1 0 0 -1 0 0 2.00
176 3 -1 0 1 0 0 -1 0 2.00
177 8 -1 0 1 0 0 -1 0 2.00
178 9 -1 0 1 0 0 -1 0 2.00
179 11 -1 0 1 0 0 -1 0 2.00
180 9 -1 0 0 1 0 0 -1 2.00
181 12 -1 0 0 1 0 0 -1 2.00
182 14 -1 0 0 1 0 0 -1 2.00
183 8 -1 0 0 1 0 0 -1 2.00
184 7 -1 0 0 1 0 0 -1 2.00
185 11 -1 -1 -1 -1 1 1 1 2.00
186 14 -1 -1 -1 -1 1 1 1 2.00
187 10 -1 -1 -1 -1 1 1 1 2.00
188 12 -1 -1 -1 -1 1 1 1 2.00
189 13 -1 -1 -1 -1 1 1 1 2.00
190 11 -1 -1 -1 -1 1 1 1 2.00
191 12 -1 -1 -1 -1 1 1 1 2.00
194 do if B0 = -1 AND B1 = -1 AND B2 = -1.
198 do if B0 = 0 AND B1 = 0 AND B2 = 1.
202 do if B0 = 0 AND B1 = 1 AND B2 = 0.
206 do if B0 = 1 AND B1 = 0 AND B2 = 0.
211 AT_DATA([type1.sps], [dnl
212 include 'data-inc.sps'.
220 /design Bgrp Agrp Bgrp * Agrp
225 AT_CHECK([pspp -O format=csv type1.sps], [0],
227 Table: Tests of Between-Subjects Effects
228 ,Type I Sum Of Squares,df,Mean Square,F,Sig.
229 Corrected Model,216.017,7,30.860,5.046,.001
231 Agrp,9.579,1,9.579,1.566,.220
232 Bgrp,186.225,3,62.075,10.151,.000
233 Agrp × Bgrp,20.212,3,6.737,1.102,.364
234 Error,183.457,30,6.115,,
236 Corrected Total,399.474,37,,,
238 Table: Tests of Between-Subjects Effects
239 ,Type I Sum Of Squares,df,Mean Square,F,Sig.
240 Corrected Model,216.017,7,30.860,5.046,.001
242 Bgrp,193.251,3,64.417,10.534,.000
243 Agrp,2.553,1,2.553,.418,.523
244 Bgrp × Agrp,20.212,3,6.737,1.102,.364
245 Error,183.457,30,6.115,,
247 Corrected Total,399.474,37,,,
251 AT_DATA([type2.sps], [dnl
252 include 'data-inc.sps'.
260 AT_CHECK([pspp -O format=csv type2.sps], [0],
262 Table: Tests of Between-Subjects Effects
263 ,Type II Sum Of Squares,df,Mean Square,F,Sig.
264 Corrected Model,216.017,7,30.860,5.046,.001
266 Agrp,2.553,1,2.553,.418,.523
267 Bgrp,186.225,3,62.075,10.151,.000
268 Agrp × Bgrp,20.212,3,6.737,1.102,.364
269 Error,183.457,30,6.115,,
271 Corrected Total,399.474,37,,,
278 AT_SETUP([GLM excluded intercept])
279 AT_KEYWORDS([categorical categoricals])
281 dnl The following example comes from
283 dnl Rudolf N. Cardinal
284 dnl Graduate-level statistics for psychology and neuroscience
285 dnl ANOVA in practice, and complex ANOVA designs
286 dnl Version of 2 May 2004
288 dnl Downloaded from: http://egret.psychol.cam.ac.uk/psychology/graduate/Guide_to_ANOVA.pdf
290 AT_DATA([intercept-exclude.sps], [dnl
293 data list notable list /depvar * A *.
328 AT_CHECK([pspp -O format=csv intercept-exclude.sps], [0],
330 Table: Tests of Between-Subjects Effects
331 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
332 Model,1636.826,2,818.413,43.556,.000
333 A,1636.826,2,818.413,43.556,.000
334 Error,338.216,18,18.790,,
337 Table: Tests of Between-Subjects Effects
338 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
339 Corrected Model,98.568,1,98.568,5.246,.034
340 Intercept,1538.258,1,1538.258,81.867,.000
341 A,98.568,1,98.568,5.246,.034
342 Error,338.216,18,18.790,,
344 Corrected Total,436.784,19,,,
350 AT_SETUP([GLM missing values])
351 AT_KEYWORDS([categorical categoricals])
353 AT_DATA([glm.data], [dnl
392 AT_DATA([glm-miss.sps], [dnl
394 data list file='glm.data' notable fixed /a 1 b 3 c 5 y 7-10(2).
397 recode y (else=SYSMIS).
406 AT_CHECK([pspp -O format=csv glm-miss.sps], [0], [dnl
407 Table: Tests of Between-Subjects Effects
408 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
409 Corrected Model,251.621,14,17.973,4.969,.002
410 Intercept,628.376,1,628.376,173.737,.000
411 a,72.929,4,18.232,5.041,.009
412 b,20.703,5,4.141,1.145,.380
413 c,135.179,5,27.036,7.475,.001
414 Error,54.253,15,3.617,,
416 Corrected Total,305.874,29,,,
421 AT_DATA([glm-miss2.sps], [dnl
423 data list file='glm.data' notable fixed /a 1 b 3 c 5 y 7-10(2).
433 AT_CHECK([pspp -O format=csv glm-miss2.sps], [0], [dnl
434 Table: Tests of Between-Subjects Effects
435 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
436 Corrected Model,251.621,14,17.973,4.969,.002
437 Intercept,628.376,1,628.376,173.737,.000
438 a,72.929,4,18.232,5.041,.009
439 b,20.703,5,4.141,1.145,.380
440 c,135.179,5,27.036,7.475,.001
441 Error,54.253,15,3.617,,
443 Corrected Total,305.874,29,,,
447 dnl Now for some missing values in the factor variables.
449 AT_DATA([glm-miss3.sps], [dnl
451 data list file=glm.data notable fixed /a 1 b 3 c 5 y 7-10(2).
454 recode a (else=SYSMIS).
463 AT_CHECK([pspp -O format=csv glm-miss3.sps], [0], [dnl
464 Table: Tests of Between-Subjects Effects
465 ,Type III Sum Of Squares,df,Mean Square,F,Sig.
466 Corrected Model,251.621,14,17.973,4.969,.002
467 Intercept,628.376,1,628.376,173.737,.000
468 a,72.929,4,18.232,5.041,.009
469 b,20.703,5,4.141,1.145,.380
470 c,135.179,5,27.036,7.475,.001
471 Error,54.253,15,3.617,,
473 Corrected Total,305.874,29,,,