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/>.
16 dnl AT_BANNER([MEANS procedure])
18 AT_SETUP([MEANS simple example])
20 AT_DATA([means-simple.sps], [dnl
23 data list notable list /score * factor *.
53 MEANS TABLES = score BY factor.
56 AT_CHECK([pspp -O format=csv means-simple.sps], [0],
58 Table: Case Processing Summary
60 ,Included,,Excluded,,Total,
61 ,N,Percent,N,Percent,N,Percent
62 score: factor,26,100%,0,0%,26,100%
63 score: ,26,100%,0,0%,26,100%
66 ,factor,Mean,N,Std. Deviation
67 score,1.00000,19.78947,19.00000,4.03566
68 ,2.00000,24.00000,7.00000,5.50757
71 ,Mean,N,Std. Deviation
72 score,20.92308,26.00000,4.75750
79 AT_SETUP([MEANS very simple example])
81 AT_DATA([means-vsimple.sps], [dnl
84 data list notable list /score.
95 AT_CHECK([pspp -O format=csv means-vsimple.sps], [0],
97 Table: Case Processing Summary
99 ,Included,,Excluded,,Total,
100 ,N,Percent,N,Percent,N,Percent
101 score: ,4,100%,0,0%,4,100%
104 ,Mean,N,Std. Deviation
105 score,1.50000,4.00000,.57735
113 AT_SETUP([MEANS default missing])
115 AT_DATA([means-dmiss.sps], [dnl
117 data list notable list /a * g1 * g2 *.
136 AT_CHECK([pspp -O format=csv means-dmiss.sps], [0],
138 Table: Case Processing Summary
140 ,Included,,Excluded,,Total,
141 ,N,Percent,N,Percent,N,Percent
142 a: g1 * g2,6,75%,2,25%,8,100%
143 a: g2,6,75%,2,25%,8,100%
144 a: ,7,87.5%,1,12.5%,8,100%
148 a,1.00,11.00,4.00,1.00
149 ,1.00,21.00,3.00,1.00
150 ,2.00,21.00,6.00,1.00
151 ,2.00,31.00,5.67,3.00
167 AT_SETUP([MEANS linear stats])
169 dnl Slightly more involved example to test the linear statistics
170 AT_DATA([means-linear.sps], [dnl
172 data list notable list /id * group * test1 *
186 add value labels /group 1 "experimental group" 2 "control group".
189 /cells = mean count stddev sum min max range variance kurt skew
194 AT_CHECK([pspp -O format=csv means-linear.sps], [0],
196 Table: Case Processing Summary
198 ,Included,,Excluded,,Total,
199 ,N,Percent,N,Percent,N,Percent
200 test1: group,10,100%,0,0%,10,100%
201 test1: ,10,100%,0,0%,10,100%
204 ,group,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
205 test1,experimental group,86.2000,5.0000,8.9833,431.0000,75.0000,99.0000,24.0000,80.7000,.2727,.3858
206 ,control group,61.8000,5.0000,10.0598,309.0000,50.0000,71.0000,21.0000,101.2000,-3.0437,-.4830
209 ,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
210 test1,74.0000,10.0000,15.6915,740.0000,50.0000,99.0000,49.0000,246.2222,-.5759,-.1262
216 AT_SETUP([MEANS standard errors])
218 AT_DATA([means-stderr.sps], [dnl
220 data list notable list /id * group * test1 *
235 /cells = mean count semean seskew sekurt.
239 AT_CHECK([pspp -O format=csv means-stderr.sps], [0],
241 Table: Case Processing Summary
243 ,Included,,Excluded,,Total,
244 ,N,Percent,N,Percent,N,Percent
245 test1: group,10,100%,0,0%,10,100%
246 test1: ,10,100%,0,0%,10,100%
249 ,group,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
250 test1,1.0000,83.5000,6.0000,4.2485,.8452,1.7408
251 ,2.0000,59.7500,4.0000,5.1700,1.0142,2.6186
254 ,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
255 test1,74.0000,10.0000,4.9621,.6870,1.3342
262 AT_SETUP([MEANS harmonic and geometric means])
264 AT_DATA([means-hg.sps], [dnl
266 data list notable list /x * y *.
277 /cells = mean harmonic geometric
282 AT_CHECK([pspp -O format=csv means-hg.sps], [0],
284 Table: Case Processing Summary
286 ,Included,,Excluded,,Total,
287 ,N,Percent,N,Percent,N,Percent
288 x: ,5,100%,0,0%,5,100%
289 y: ,5,100%,0,0%,5,100%
292 ,Mean,Harmonic Mean,Geom. Mean
293 x,3.0000,2.1898,2.6052
294 y,3.0000,3.0000,3.0000
304 AT_SETUP([MEANS all/none/default])
306 dnl Make sure that /CELLS = {ALL,NONE,DEFAULT} work properly
307 AT_DATA([means-stat-keywords.sps], [dnl
311 DATA LIST NOTABLE LIST /score *.
320 MEANS score /CELLS = ALL.
321 MEANS score /CELLS = DEFAULT.
322 MEANS score /CELLS = NONE.
326 AT_CHECK([pspp -O format=csv means-stat-keywords.sps], [0],
328 Table: Case Processing Summary
330 ,Included,,Excluded,,Total,
331 ,N,Percent,N,Percent,N,Percent
332 score: ,5,100%,0,0%,5,100%
335 ,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
336 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
338 Table: Case Processing Summary
340 ,Included,,Excluded,,Total,
341 ,N,Percent,N,Percent,N,Percent
342 score: ,5,100%,0,0%,5,100%
345 ,Mean,N,Std. Deviation
346 score,22.40,5.00,4.62
348 Table: Case Processing Summary
350 ,Included,,Excluded,,Total,
351 ,N,Percent,N,Percent,N,Percent
352 score: ,5,100%,0,0%,5,100%
364 AT_SETUP([MEANS missing=table ])
366 AT_DATA([means-miss-table.sps], [dnl
367 data list notable list /a * b * g1.
391 AT_CHECK([pspp -O format=csv means-miss-table.sps], [0],
393 Table: Case Processing Summary
395 ,Included,,Excluded,,Total,
396 ,N,Percent,N,Percent,N,Percent
397 a: g1,7,100%,0,0%,7,100%
398 a: ,7,100%,0,0%,7,100%
399 b: g1,6,85.7143%,1,14.2857%,7,100%
400 b: ,6,85.7143%,1,14.2857%,7,100%
414 Table: Case Processing Summary
416 ,Included,,Excluded,,Total,
417 ,N,Percent,N,Percent,N,Percent
418 a: g1,7,100%,0,0%,7,100%
419 a: ,7,100%,0,0%,7,100%
430 Table: Case Processing Summary
432 ,Included,,Excluded,,Total,
433 ,N,Percent,N,Percent,N,Percent
434 a: g1,7,100%,0,0%,7,100%
435 a: ,7,100%,0,0%,7,100%
436 b: g1,6,85.7143%,1,14.2857%,7,100%
437 b: ,6,85.7143%,1,14.2857%,7,100%
451 Table: Case Processing Summary
453 ,Included,,Excluded,,Total,
454 ,N,Percent,N,Percent,N,Percent
455 a: g1,7,100%,0,0%,7,100%
456 a: ,7,100%,0,0%,7,100%
474 AT_SETUP([MEANS user missing values])
476 AT_DATA([means-missing.sps], [dnl
477 data list notable list /a * b * g1.
488 MISSING VALUES a b g1 (9).
490 MEANS a b BY g1 /cells = COUNT .
492 MEANS a b BY g1 /cells = COUNT /missing = include .
494 MEANS a b BY g1 /cells = COUNT /missing = dependent .
498 AT_CHECK([pspp -O format=csv means-missing.sps], [0],
500 Table: Case Processing Summary
502 ,Included,,Excluded,,Total,
503 ,N,Percent,N,Percent,N,Percent
504 a: g1,6,85.7143%,1,14.2857%,7,100%
505 a: ,7,100%,0,0%,7,100%
506 b: g1,5,71.4286%,2,28.5714%,7,100%
507 b: ,6,85.7143%,1,14.2857%,7,100%
521 Table: Case Processing Summary
523 ,Included,,Excluded,,Total,
524 ,N,Percent,N,Percent,N,Percent
525 a: g1,7,100%,0,0%,7,100%
526 a: ,7,100%,0,0%,7,100%
527 b: g1,7,100%,0,0%,7,100%
528 b: ,7,100%,0,0%,7,100%
544 Table: Case Processing Summary
546 ,Included,,Excluded,,Total,
547 ,N,Percent,N,Percent,N,Percent
548 a: g1,7,100%,0,0%,7,100%
549 a: ,7,100%,0,0%,7,100%
550 b: g1,6,85.7143%,1,14.2857%,7,100%
551 b: ,6,85.7143%,1,14.2857%,7,100%
572 AT_SETUP([MEANS empty factor spec])
574 AT_DATA([means-bad.sps], [dnl
575 data list list /outcome *.
582 MEANS TABLES = outcome
586 AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
592 AT_SETUP([MEANS parser bug])
594 dnl This bug caused an infinite loop
595 AT_DATA([means-bad.sps], [dnl
596 DATA LIST notable LIST /a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 fylo *.
598 1 2 3 4 5 6 7 8 9 0 11
601 MEANS TABLES = a1 a2 a3 a4 a5 a6 a7 a8 a9 a10a BY fylo.
604 AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])