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([MEANS procedure])
19 AT_SETUP([MEANS simple example])
21 AT_DATA([means-simple.sps], [dnl
24 data list notable list /score * factor *.
54 MEANS TABLES = score BY factor.
57 AT_CHECK([pspp -O format=csv means-simple.sps], [0],
59 Table: Case Processing Summary
61 ,Included,,Excluded,,Total,
62 ,N,Percent,N,Percent,N,Percent
63 score: factor,26,100%,0,0%,26,100%
64 score: ,26,100%,0,0%,26,100%
67 ,factor,Mean,N,Std. Deviation
68 score,1.00000,19.78947,19.00000,4.03566
69 ,2.00000,24.00000,7.00000,5.50757
72 ,Mean,N,Std. Deviation
73 score,20.92308,26.00000,4.75750
80 AT_SETUP([MEANS very simple example])
82 AT_DATA([means-vsimple.sps], [dnl
85 data list notable list /score.
96 AT_CHECK([pspp -O format=csv means-vsimple.sps], [0],
98 Table: Case Processing Summary
100 ,Included,,Excluded,,Total,
101 ,N,Percent,N,Percent,N,Percent
102 score: ,4,100%,0,0%,4,100%
105 ,Mean,N,Std. Deviation
106 score,1.50000,4.00000,.57735
114 AT_SETUP([MEANS default missing])
116 AT_DATA([means-dmiss.sps], [dnl
118 data list notable list /a * g1 * g2 *.
137 AT_CHECK([pspp -O format=csv means-dmiss.sps], [0],
139 Table: Case Processing Summary
141 ,Included,,Excluded,,Total,
142 ,N,Percent,N,Percent,N,Percent
143 a: g1 * g2,6,75%,2,25%,8,100%
144 a: g2,6,75%,2,25%,8,100%
145 a: ,7,87.5%,1,12.5%,8,100%
149 a,1.00,11.00,4.00,1.00
150 ,1.00,21.00,3.00,1.00
151 ,2.00,21.00,6.00,1.00
152 ,2.00,31.00,5.67,3.00
168 AT_SETUP([MEANS linear stats])
170 dnl Slightly more involved example to test the linear statistics
171 AT_DATA([means-linear.sps], [dnl
173 data list notable list /id * group * test1 *
187 add value labels /group 1 "experimental group" 2 "control group".
190 /cells = mean count stddev sum min max range variance kurt skew
195 AT_CHECK([pspp -O format=csv means-linear.sps], [0],
197 Table: Case Processing Summary
199 ,Included,,Excluded,,Total,
200 ,N,Percent,N,Percent,N,Percent
201 test1: group,10,100%,0,0%,10,100%
202 test1: ,10,100%,0,0%,10,100%
205 ,group,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
206 test1,experimental group,86.2000,5.0000,8.9833,431.0000,75.0000,99.0000,24.0000,80.7000,.2727,.3858
207 ,control group,61.8000,5.0000,10.0598,309.0000,50.0000,71.0000,21.0000,101.2000,-3.0437,-.4830
210 ,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
211 test1,74.0000,10.0000,15.6915,740.0000,50.0000,99.0000,49.0000,246.2222,-.5759,-.1262
217 AT_SETUP([MEANS standard errors])
219 AT_DATA([means-stderr.sps], [dnl
221 data list notable list /id * group * test1 *
236 /cells = mean count semean seskew sekurt.
240 AT_CHECK([pspp -O format=csv means-stderr.sps], [0],
242 Table: Case Processing Summary
244 ,Included,,Excluded,,Total,
245 ,N,Percent,N,Percent,N,Percent
246 test1: group,10,100%,0,0%,10,100%
247 test1: ,10,100%,0,0%,10,100%
250 ,group,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
251 test1,1.0000,83.5000,6.0000,4.2485,.8452,1.7408
252 ,2.0000,59.7500,4.0000,5.1700,1.0142,2.6186
255 ,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
256 test1,74.0000,10.0000,4.9621,.6870,1.3342
263 AT_SETUP([MEANS harmonic and geometric means])
265 AT_DATA([means-hg.sps], [dnl
267 data list notable list /x * y *.
278 /cells = mean harmonic geometric
283 AT_CHECK([pspp -O format=csv means-hg.sps], [0],
285 Table: Case Processing Summary
287 ,Included,,Excluded,,Total,
288 ,N,Percent,N,Percent,N,Percent
289 x: ,5,100%,0,0%,5,100%
290 y: ,5,100%,0,0%,5,100%
293 ,Mean,Harmonic Mean,Geom. Mean
294 x,3.0000,2.1898,2.6052
295 y,3.0000,3.0000,3.0000
305 AT_SETUP([MEANS all/none/default])
307 dnl Make sure that /CELLS = {ALL,NONE,DEFAULT} work properly
308 AT_DATA([means-stat-keywords.sps], [dnl
312 DATA LIST NOTABLE LIST /score *.
321 MEANS score /CELLS = ALL.
322 MEANS score /CELLS = DEFAULT.
323 MEANS score /CELLS = NONE.
327 AT_CHECK([pspp -O format=csv means-stat-keywords.sps], [0],
329 Table: Case Processing Summary
331 ,Included,,Excluded,,Total,
332 ,N,Percent,N,Percent,N,Percent
333 score: ,5,100%,0,0%,5,100%
336 ,Mean,N,Std. Deviation,S.E. Mean,Sum,Min,Max,Range,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,First,Last,Harmonic Mean,Geom. Mean
337 score,22.40,5.00,4.62,2.06,112.00,16.00,29.00,13.00,21.30,1.85,2.00,.11,.91,22.00,23.00,21.61,22.01
339 Table: Case Processing Summary
341 ,Included,,Excluded,,Total,
342 ,N,Percent,N,Percent,N,Percent
343 score: ,5,100%,0,0%,5,100%
346 ,Mean,N,Std. Deviation
347 score,22.40,5.00,4.62
349 Table: Case Processing Summary
351 ,Included,,Excluded,,Total,
352 ,N,Percent,N,Percent,N,Percent
353 score: ,5,100%,0,0%,5,100%
365 AT_SETUP([MEANS missing=table ])
367 AT_DATA([means-miss-table.sps], [dnl
368 data list notable list /a * b * g1.
392 AT_CHECK([pspp -O format=csv means-miss-table.sps], [0],
394 Table: Case Processing Summary
396 ,Included,,Excluded,,Total,
397 ,N,Percent,N,Percent,N,Percent
398 a: g1,7,100%,0,0%,7,100%
399 a: ,7,100%,0,0%,7,100%
400 b: g1,6,85.7143%,1,14.2857%,7,100%
401 b: ,6,85.7143%,1,14.2857%,7,100%
415 Table: Case Processing Summary
417 ,Included,,Excluded,,Total,
418 ,N,Percent,N,Percent,N,Percent
419 a: g1,7,100%,0,0%,7,100%
420 a: ,7,100%,0,0%,7,100%
431 Table: Case Processing Summary
433 ,Included,,Excluded,,Total,
434 ,N,Percent,N,Percent,N,Percent
435 a: g1,7,100%,0,0%,7,100%
436 a: ,7,100%,0,0%,7,100%
437 b: g1,6,85.7143%,1,14.2857%,7,100%
438 b: ,6,85.7143%,1,14.2857%,7,100%
452 Table: Case Processing Summary
454 ,Included,,Excluded,,Total,
455 ,N,Percent,N,Percent,N,Percent
456 a: g1,7,100%,0,0%,7,100%
457 a: ,7,100%,0,0%,7,100%
475 AT_SETUP([MEANS user missing values])
477 AT_DATA([means-missing.sps], [dnl
478 data list notable list /a * b * g1.
489 MISSING VALUES a b g1 (9).
491 MEANS a b BY g1 /cells = COUNT .
493 MEANS a b BY g1 /cells = COUNT /missing = include .
495 MEANS a b BY g1 /cells = COUNT /missing = dependent .
499 AT_CHECK([pspp -O format=csv means-missing.sps], [0],
501 Table: Case Processing Summary
503 ,Included,,Excluded,,Total,
504 ,N,Percent,N,Percent,N,Percent
505 a: g1,6,85.7143%,1,14.2857%,7,100%
506 a: ,7,100%,0,0%,7,100%
507 b: g1,5,71.4286%,2,28.5714%,7,100%
508 b: ,6,85.7143%,1,14.2857%,7,100%
522 Table: Case Processing Summary
524 ,Included,,Excluded,,Total,
525 ,N,Percent,N,Percent,N,Percent
526 a: g1,7,100%,0,0%,7,100%
527 a: ,7,100%,0,0%,7,100%
528 b: g1,7,100%,0,0%,7,100%
529 b: ,7,100%,0,0%,7,100%
545 Table: Case Processing Summary
547 ,Included,,Excluded,,Total,
548 ,N,Percent,N,Percent,N,Percent
549 a: g1,7,100%,0,0%,7,100%
550 a: ,7,100%,0,0%,7,100%
551 b: g1,6,85.7143%,1,14.2857%,7,100%
552 b: ,6,85.7143%,1,14.2857%,7,100%
573 AT_SETUP([MEANS empty factor spec])
575 AT_DATA([means-bad.sps], [dnl
576 data list list /outcome *.
583 MEANS TABLES = outcome
587 AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
593 AT_SETUP([MEANS parser bug])
595 dnl This bug caused an infinite loop
596 AT_DATA([means-bad.sps], [dnl
597 DATA LIST notable LIST /a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 fylo *.
599 1 2 3 4 5 6 7 8 9 0 11
602 MEANS TABLES = a1 a2 a3 a4 a5 a6 a7 a8 a9 a10a BY fylo.
605 AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])