1 AT_BANNER([NPAR TESTS])
3 AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 < 1])
4 AT_DATA([npar.sps], [dnl
7 DATA LIST LIST NOTABLE /x * w *.
19 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
21 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
22 x,Group1,1.000,6.000,.286,.300,.551
23 ,Group2,2.000,15.000,.714,,
24 ,Total,,21.000,1.000,,
28 AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 > 1])
29 AT_DATA([npar.sps], [dnl
32 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
44 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
46 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
47 x,Group1,1,7,.538,.400,.229
53 AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 = 1])
54 AT_DATA([npar.sps], [dnl
57 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
69 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
71 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
72 x,Group1,1,8,.500,.400,.284
78 AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 < 1])
79 AT_DATA([npar.sps], [dnl
82 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
94 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
96 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
97 x,Group1,1,11,.478,.600,.164
103 AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 > 1])
104 AT_DATA([npar.sps], [dnl
107 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
118 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
120 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
121 x,Group1,1,11,.550,.600,.404
127 AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 = 1])
128 AT_DATA([npar.sps], [dnl
131 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
142 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
144 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
145 x,Group1,1,11,.500,.600,.228
151 AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 < 1])
152 AT_DATA([npar.sps], [dnl
155 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
167 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
169 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
170 x,Group1,1,8,.348,.500,.210
176 AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 > 1])
177 AT_DATA([npar.sps], [dnl
180 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
191 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
193 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
194 x,Group1,1,12,.667,.500,.238
200 AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1])
201 AT_DATA([npar.sps], [dnl
204 DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
216 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
218 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
219 x,Group1,1,10,.500,.500,1.000
225 AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1 Cutpoint])
226 AT_DATA([npar.sps], [dnl
229 DATA LIST LIST NOTABLE /x * w *.
239 /BINOMIAL(0.5) = x (10)
242 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
244 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
245 x,Group1,<= 10,10.000,.385,.500,.327
246 ,Group2,,16.000,.615,,
247 ,Total,,26.000,1.000,,
251 AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1 Named values])
252 AT_DATA([npar.sps], [dnl
255 DATA LIST LIST NOTABLE /x * w *.
265 /BINOMIAL(0.5) = x (10, 20)
268 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
270 ,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
271 x,Group1,10.000,10.000,.435,.500,.678
272 ,Group2,20.000,13.000,.565,,
273 ,Total,,23.000,1.000,,
277 AT_SETUP([NPAR TESTS CHISQUARE])
278 AT_DATA([npar.sps], [dnl
279 DATA LIST NOTABLE LIST /x * y * w *.
306 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
308 ,Observed N,Expected N,Residual
318 ,Observed N,Expected N,Residual
325 Table: Test Statistics
332 ,Observed N,Expected N,Residual
339 Table: Test Statistics
347 ,Category,Observed N,Expected N,Residual,Category,Observed N,Expected N,Residual
348 1,2.00,3.00,3.16,-.16,2.00,4.00,2.21,1.79
349 2,3.00,5.00,5.26,-.26,3.00,1.00,3.68,-2.68
350 3,4.00,2.00,1.58,.42,4.00,2.00,1.11,.89
351 Total,,10.00,,,,7.00,,
353 Table: Test Statistics
361 AT_SETUP([NPAR TESTS CHISQUARE expected values missing])
362 AT_DATA([npar.sps], [dnl
363 DATA LIST NOTABLE LIST /x * y * w *.
378 /EXPECTED = 3 4 5 4 3 1
381 AT_CHECK([pspp -O format=csv npar.sps], [1], [dnl
382 "error: CHISQUARE test specified 6 expected values, but 4 distinct values were encountered in variable y."
384 Table: Test Statistics
392 AT_SETUP([NPAR TESTS CHISQUARE with DESCRIPTIVES])
393 AT_DATA([npar.sps], [dnl
394 DATA LIST NOTABLE LIST /x * y * w * .
408 MISSING VALUES x (4).
413 /STATISTICS=DESCRIPTIVES
416 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
419 ,Category,Observed N,Expected N,Residual,Category,Observed N,Expected N,Residual
420 1,-2.00,.00,1.50,-1.50,-2.00,.00,1.88,-1.88
421 2,-1.00,.00,1.50,-1.50,-1.00,.00,1.88,-1.88
422 3,.00,.00,1.50,-1.50,.00,.00,1.88,-1.88
423 4,1.00,3.00,1.50,1.50,1.00,7.00,1.88,5.13
424 5,2.00,3.00,1.50,1.50,2.00,4.00,1.88,2.13
425 6,3.00,5.00,1.50,3.50,3.00,1.00,1.88,-.88
426 7,4.00,.00,1.50,-1.50,4.00,2.00,1.88,.13
427 8,5.00,1.00,1.50,-.50,5.00,1.00,1.88,-.88
428 Total,,12.00,,,,15.00,,
430 Table: Test Statistics
432 Chi-Square,17.33,22.87
436 Table: Descriptive Statistics
437 ,N,Mean,Std. Deviation,Minimum,Maximum
439 x,12.00,2.47,1.19,1.00,5.00
440 y,15.00,2.07,1.33,1.00,5.00
444 AT_SETUP([NPAR TESTS CHISQUARE, listwise missing])
445 AT_DATA([npar.sps], [dnl
446 DATA LIST NOTABLE LIST /x * y * w * .
460 * MISSING VALUES x (4).
465 /STATISTICS=DESCRIPTIVES
468 AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
471 ,Category,Observed N,Expected N,Residual,Category,Observed N,Expected N,Residual
472 1,-2.00,.00,1.75,-1.75,-2.00,.00,1.75,-1.75
473 2,-1.00,.00,1.75,-1.75,-1.00,.00,1.75,-1.75
474 3,.00,.00,1.75,-1.75,.00,.00,1.75,-1.75
475 4,1.00,3.00,1.75,1.25,1.00,7.00,1.75,5.25
476 5,2.00,3.00,1.75,1.25,2.00,4.00,1.75,2.25
477 6,3.00,5.00,1.75,3.25,3.00,1.00,1.75,-.75
478 7,4.00,2.00,1.75,.25,4.00,2.00,1.75,.25
479 8,5.00,1.00,1.75,-.75,5.00,.00,1.75,-1.75
480 Total,,14.00,,,,14.00,,
482 Table: Test Statistics
484 Chi-Square,13.43,26.00
488 Table: Descriptive Statistics
489 ,N,Mean,Std. Deviation,Minimum,Maximum
491 x,14.00,2.69,1.23,1.00,5.00
492 y,14.00,1.86,1.10,1.00,4.00
496 AT_SETUP([NPAR TESTS WILCOXON])
497 AT_DATA([npar.sps], [dnl
498 data list notable list /foo * bar * w (f8.0).
516 variable labels foo "first" bar "second".
521 /wilcoxon=foo with bar (paired)
525 AT_CHECK([pspp -o pspp.csv npar.sps])
526 AT_CHECK([cat pspp.csv], [0], [dnl
528 ,,N,Mean Rank,Sum of Ranks
529 second - first,Negative Ranks,5,8.60,43.00
530 ,Positive Ranks,8,6.00,48.00
534 Table: Test Statistics
537 Asymp. Sig. (2-tailed),.86
538 Exact Sig. (2-tailed),.89
539 Exact Sig. (1-tailed),.45
543 AT_SETUP([NPAR TESTS WILCOXON with missing values])
544 AT_DATA([npar.sps], [dnl
545 data list notable list /foo * bar * dummy *.
565 variable labels foo "first" bar "second".
568 /wilcoxon=foo with bar (paired)
573 AT_CHECK([pspp -o pspp.csv npar.sps])
574 dnl This is the same output as the previous test.
575 AT_CHECK([cat pspp.csv], [0], [dnl
577 ,,N,Mean Rank,Sum of Ranks
578 second - first,Negative Ranks,5,8.60,43.00
579 ,Positive Ranks,8,6.00,48.00
583 Table: Test Statistics
586 Asymp. Sig. (2-tailed),.86
587 Exact Sig. (2-tailed),.89
588 Exact Sig. (1-tailed),.45
592 AT_SETUP([NPAR TESTS SIGN])
593 AT_DATA([npar.sps], [dnl
596 data list notable list /age * height rank *.
607 /sign=age height WITH height rank (PAIRED)
612 AT_CHECK([pspp -o pspp.csv npar.sps])
613 AT_CHECK([cat pspp.csv], [0], [dnl
616 height - age,Negative Differences,1
617 ,Positive Differences,3
620 rank - height,Negative Differences,3
621 ,Positive Differences,2
625 Table: Test Statistics
626 ,height - age,rank - height
627 Exact Sig. (2-tailed),.625,1.000
628 Exact Sig. (1-tailed),.312,.500
629 Point Probability,.250,.312
634 AT_SETUP([NPAR Kruskal-Wallis test])
637 AT_DATA([kw-simple.sps], [dnl
640 data list notable list /gv * xscore *.
661 3 "handled the ball".
664 /kruskal-wallis xscore by gv (1, 3)
668 AT_CHECK([pspp -o pspp.csv kw-simple.sps])
669 AT_CHECK([cat pspp.csv], [0], [dnl
672 xscore,timed out,5,4.400
673 ,handled the ball,4,11.500
677 Table: Test Statistics
685 dnl Now try a missing value in the group variable
686 AT_DATA([kw-missing-group.sps], [dnl
689 data list notable list /gv * xscore *.
708 missing values gv (2.5).
713 3 "handled the ball".
716 /kruskal-wallis xscore by gv (1, 3)
721 AT_CHECK([pspp -o pspp2.csv kw-missing-group.sps])
723 dnl The result should be the same as before
724 AT_CHECK([diff pspp.csv pspp2.csv], [0])
729 AT_SETUP([NPAR Kruskal-Wallis multiple-variables])
731 AT_DATA([kw-multi.sps], [dnl
734 data list notable list /gv * xscore * yscore.
766 /k-w xscore yscore by gv (1, 5)
772 AT_CHECK([pspp -o pspp.csv kw-multi.sps])
773 AT_CHECK([cat pspp.csv], [0], [dnl
776 xscore,timed out,5,4.400
777 ,handled the ball,4,11.500
780 yscore,handled the ball,4,11.500
785 Table: Test Statistics
787 Chi-Square,,6.406,6.406,
789 Asymp. Sig.,,.041,.041,