Point Probability,.250,.312
])
AT_CLEANUP
+
+
+AT_SETUP([NPAR Kruskal-Wallis test])
+
+dnl Simple case
+AT_DATA([kw-simple.sps], [dnl
+set format = F9.3.
+
+data list notable list /gv * xscore *.
+begin data
+1 96
+1 128
+1 83
+2 132
+2 135
+2 109
+3 115
+1 61
+1 101
+2 82
+2 124
+3 149
+3 166
+3 147
+end data.
+
+value label /gv
+ 1 "timed out"
+ 2 "hit wicket"
+ 3 "handled the ball".
+
+npar tests
+ /kruskal-wallis xscore by gv (1, 3)
+ .
+])
+
+AT_CHECK([pspp -o pspp.csv kw-simple.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Ranks
+,gv,N,Mean Rank
+xscore,timed out,5,4.400
+,handled the ball,4,11.500
+,hit wicket,5,7.400
+,Total,14,
+
+Table: Test Statistics
+,,xscore
+Chi-Square,,6.406
+df,,2
+Asymp. Sig.,,.041
+])
+
+
+dnl Now try a missing value in the group variable
+AT_DATA([kw-missing-group.sps], [dnl
+set format = F9.3.
+
+data list notable list /gv * xscore *.
+begin data
+1 96
+1 128
+1 83
+1 61
+1 101
+2 82
+2 124
+2 132
+2 135
+2 109
+3 115
+3 149
+3 166
+3 147
+2.5 344
+end data.
+
+missing values gv (2.5).
+
+value label /gv
+ 1 "timed out"
+ 2 "hit wicket"
+ 3 "handled the ball".
+
+npar tests
+ /kruskal-wallis xscore by gv (1, 3)
+ /missing=exclude
+ .
+])
+
+AT_CHECK([pspp -o pspp2.csv kw-missing-group.sps])
+
+dnl The result should be the same as before
+AT_CHECK([diff pspp.csv pspp2.csv], [0])
+
+AT_CLEANUP
+
+
+AT_SETUP([NPAR Kruskal-Wallis multiple-variables])
+
+AT_DATA([kw-multi.sps], [dnl
+set format = F9.3.
+
+data list notable list /gv * xscore * yscore.
+begin data
+1 96 .
+1 128 .
+1 83 .
+2 132 132
+2 135 135
+2 109 109
+3 115 115
+1 61 .
+1 101 .
+2 82 82
+2 124 124
+3 149 149
+3 166 166
+3 147 147
+4 . 96
+4 . 128
+4 . 83
+4 . 61
+4 . 101
+end data.
+
+value label /gv
+ 1 "timed out"
+ 2 "hit wicket"
+ 3 "handled the ball"
+ 4 "bowled"
+ 5 "lbw"
+ .
+
+npar tests
+ /k-w xscore yscore by gv (1, 5)
+ .
+
+])
+
+
+AT_CHECK([pspp -o pspp.csv kw-multi.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Ranks
+,gv,N,Mean Rank
+xscore,timed out,5,4.400
+,handled the ball,4,11.500
+,hit wicket,5,7.400
+,Total,14,
+yscore,handled the ball,4,11.500
+,bowled,5,4.400
+,hit wicket,5,7.400
+,Total,14,
+
+Table: Test Statistics
+,,xscore,yscore,
+Chi-Square,,6.406,6.406,
+df,,2,2,
+Asymp. Sig.,,.041,.041,
+])
+
+AT_CLEANUP
\ No newline at end of file