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 dnl Some machines return .313 instead of .312 for the Point Probability
614 dnl (see bug #31611).
615 AT_CHECK([sed 's/\.313$/.312/' pspp.csv], [0], [dnl
618 height - age,Negative Differences,1
619 ,Positive Differences,3
622 rank - height,Negative Differences,3
623 ,Positive Differences,2
627 Table: Test Statistics
628 ,height - age,rank - height
629 Exact Sig. (2-tailed),.625,1.000
630 Exact Sig. (1-tailed),.312,.500
631 Point Probability,.250,.312
636 AT_SETUP([NPAR Kruskal-Wallis test])
639 AT_DATA([kw-simple.sps], [dnl
642 data list notable list /gv * xscore *.
663 3 "handled the ball".
666 /kruskal-wallis xscore by gv (1, 3)
670 AT_CHECK([pspp -o pspp.csv kw-simple.sps])
671 AT_CHECK([cat pspp.csv], [0], [dnl
674 xscore,timed out,5,4.400
675 ,handled the ball,4,11.500
679 Table: Test Statistics
687 dnl Now try a missing value in the group variable
688 AT_DATA([kw-missing-group.sps], [dnl
691 data list notable list /gv * xscore *.
710 missing values gv (2.5).
715 3 "handled the ball".
718 /kruskal-wallis xscore by gv (1, 3)
723 AT_CHECK([pspp -o pspp2.csv kw-missing-group.sps])
725 dnl The result should be the same as before
726 AT_CHECK([diff pspp.csv pspp2.csv], [0])
731 AT_SETUP([NPAR Kruskal-Wallis multiple-variables])
733 AT_DATA([kw-multi.sps], [dnl
736 data list notable list /gv * xscore * yscore.
768 /k-w xscore yscore by gv (1, 5)
774 AT_CHECK([pspp -o pspp.csv kw-multi.sps])
775 AT_CHECK([cat pspp.csv], [0], [dnl
778 xscore,timed out,5,4.400
779 ,handled the ball,4,11.500
782 yscore,handled the ball,4,11.500
787 Table: Test Statistics
789 Chi-Square,,6.406,6.406,
791 Asymp. Sig.,,.041,.041,
798 AT_SETUP([NPAR TESTS Runs])
799 AT_DATA([npar-runs.sps], [dnl
801 data list notable list /score * w *.
844 /runs (MEDIAN) = score
850 AT_CHECK([pspp -o pspp.csv npar-runs.sps])
852 AT_CHECK([cat pspp.csv], [0], [dnl
855 Test Value (median),3.0000
856 Cases < Test Value,177.0000
857 Cases >= Test Value,309.0000
861 Asymp. Sig. (2-tailed),.0000
865 Test Value (mean),3.6379
866 Cases < Test Value,259.0000
867 Cases >= Test Value,227.0000
871 Asymp. Sig. (2-tailed),.0000
875 Test Value (mode),6.0000
876 Cases < Test Value,316.0000
877 Cases >= Test Value,170.0000
881 Asymp. Sig. (2-tailed),.0000
887 AT_SETUP([NPAR TESTS Friedman])
888 AT_DATA([npar-friedman.sps], [dnl
890 data list notable list /x * y * z.
908 AT_CHECK([pspp -o pspp.csv npar-friedman.sps])
910 AT_CHECK([cat pspp.csv], [0], [dnl
917 Table: Test Statistics
928 AT_SETUP([NPAR TESTS Mann-Whitney])
929 AT_DATA([npar-mann-whitney.sps], [dnl
932 data list notable list /height * sex (f1.0).
967 /M-W = height BY sex (0,1).
970 AT_CHECK([pspp -o pspp.csv npar-mann-whitney.sps])
972 AT_CHECK([cat pspp.csv], [0], [dnl
974 ,N,,,Mean Rank,,Sum of Ranks,
976 height,15.0000,15.0000,30.0000,14.5333,16.4667,218.0000,247.0000
978 Table: Test Statistics
979 ,Mann-Whitney U,Wilcoxon W,Z,Asymp. Sig. (2-tailed)
980 height,98.0000,218.0000,-.6020,.5472
987 AT_SETUP([NPAR TESTS Cochran])
988 AT_DATA([npar-cochran.sps], [dnl
991 data list notable list /v1 * v2 * v3 * v4 * v5 * v6 * v7 *.
1005 /cochran = v1 to v7 .
1009 AT_CHECK([pspp -o pspp.csv npar-cochran.sps])
1011 AT_CHECK([cat pspp.csv], [0], [dnl
1014 ,Success (2),Failure (1)
1023 Table: Test Statistics
1034 AT_SETUP([NPAR TESTS Kendall])
1035 AT_DATA([npar-kendall.sps], [dnl
1038 data list notable list /v1 * v2 * v3
1078 AT_CHECK([pspp -o pspp.csv npar-kendall.sps])
1080 AT_CHECK([cat pspp.csv], [0], [dnl
1087 Table: Test Statistics