])
AT_CLEANUP
+
+
+dnl Test for a bug which caused binomial to crash.
+AT_SETUP([NPAR TESTS BINOMIAL - crash])
+AT_DATA([nparX.sps], [dnl
+data list list /range *.
+begin data.
+0
+1
+end data.
+
+* This is invalid syntax
+NPAR TEST
+ /BINOMIAL(0.5) = Range().
+
+])
+AT_CHECK([pspp -O format=csv nparX.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
AT_SETUP([NPAR TESTS CHISQUARE])
AT_DATA([npar.sps], [dnl
DATA LIST NOTABLE LIST /x * y * w *.
/EXPECTED = 6 10 3
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: x
,Observed N,Expected N,Residual
,x,y
Chi-Square,3.14,6.00
df,5,3
-Asymp. Sig.,.68,.11
+Asymp. Sig.,.678,.112
Table: y
,Observed N,Expected N,Residual
,y
Chi-Square,10.61
df,3
-Asymp. Sig.,.01
+Asymp. Sig.,.014
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,.13,4.13
df,2,2
-Asymp. Sig.,.94,.13
+Asymp. Sig.,.936,.127
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS CHISQUARE expected values missing])
/EXPECTED = 3 4 5 4 3 1
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [1], [dnl
"error: CHISQUARE test specified 6 expected values, but 4 distinct values were encountered in variable y."
,y
Chi-Square,.00
df,0
-Asymp. Sig.,1.00
+Asymp. Sig.,1.000
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS CHISQUARE with DESCRIPTIVES])
/STATISTICS=DESCRIPTIVES
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,17.33,22.87
df,7,7
-Asymp. Sig.,.02,.00
+Asymp. Sig.,.015,.002
Table: Descriptive Statistics
,N,Mean,Std. Deviation,Minimum,Maximum
/STATISTICS=DESCRIPTIVES
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,13.43,26.00
df,7,7
-Asymp. Sig.,.06,.00
+Asymp. Sig.,.062,.001
Table: Descriptive Statistics
,N,Mean,Std. Deviation,Minimum,Maximum
/missing analysis
/method=exact.
])
-AT_CHECK([pspp -o pspp.csv npar.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Ranks
,,N,Mean Rank,Sum of Ranks
first - second,Negative Ranks,8,6.00,48.00
Table: Test Statistics
,first - second
Z,-.18
-Asymp. Sig. (2-tailed),.86
-Exact Sig. (2-tailed),.89
-Exact Sig. (1-tailed),.45
+Asymp. Sig. (2-tailed),.861
+Exact Sig. (2-tailed),.893
+Exact Sig. (1-tailed),.446
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS WILCOXON with missing values])
/wilcoxon=foo with bar (paired)
/missing analysis
/method=exact.
-
])
-AT_CHECK([pspp -o pspp.csv npar.sps])
+
dnl This is the same output as the previous test.
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Ranks
,,N,Mean Rank,Sum of Ranks
first - second,Negative Ranks,8,6.00,48.00
Table: Test Statistics
,first - second
Z,-.18
-Asymp. Sig. (2-tailed),.86
-Exact Sig. (2-tailed),.89
-Exact Sig. (1-tailed),.45
+Asymp. Sig. (2-tailed),.861
+Exact Sig. (2-tailed),.893
+Exact Sig. (1-tailed),.446
])
AT_CLEANUP
.
])
-AT_CHECK([pspp -o pspp.csv npar-runs.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
-Table: Runs Test
+AT_CHECK([pspp -O format=csv npar-runs.sps], [0],
+[Table: Runs Test
,score
Test Value (median),3.0000
Cases < Test Value,177.0000
Total Cases,486.0000
Number of Runs,12
Z,-20.9931
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
Table: Runs Test
,score
Total Cases,486.0000
Number of Runs,12
Z,-21.0650
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
Table: Runs Test
,score
Total Cases,486.0000
Number of Runs,11
Z,-21.0742
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
])
AT_CLEANUP
/friedman = x y z.
])
-AT_CHECK([pspp -o pspp.csv npar-friedman.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar-friedman.sps], [0], [dnl
Table: Ranks
,Mean Rank
x,2.6500
N,10
Chi-Square,10.4737
df,2
-Asymp. Sig.,.0053
+Asymp. Sig.,.005
])
AT_CLEANUP
/M-W = height BY sex (0,1).
])
-AT_CHECK([pspp -o pspp.csv npar-mann-whitney.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar-mann-whitney.sps], [0], [dnl
Table: Ranks
,N,,,Mean Rank,,Sum of Ranks,
,0,1,Total,0,1,0,1
Table: Test Statistics
,Mann-Whitney U,Wilcoxon W,Z,Asymp. Sig. (2-tailed)
-height,98.0000,218.0000,-.6020,.5472
+height,98.0000,218.0000,-.6020,.547
])
])
AT_CLEANUP
+
+dnl Checks that (PAIRED) can have lists where the same
+dnl variable appears more than once.
+AT_SETUP([NPAR TESTS (PAIRED)])
+AT_DATA([npar.sps], [dnl
+set format = F12.3.
+data list notable list /a * b * c *.
+begin data.
+1 2 4
+4 5 3
+1 2 2
+4 5 1
+end data.
+
+npar tests /wilcoxon a b with c c (paired).
+])
+
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Ranks
+,,N,Mean Rank,Sum of Ranks
+a - c,Negative Ranks,2,2.500,5.000
+,Positive Ranks,2,2.500,5.000
+,Ties,0,,
+,Total,4,,
+b - c,Negative Ranks,1,1.500,1.500
+,Positive Ranks,2,2.250,4.500
+,Ties,1,,
+,Total,4,,
+
+Table: Test Statistics
+,a - c,b - c
+Z,.000,-.816
+Asymp. Sig. (2-tailed),1.000,.414
+])
+
+
+AT_CLEANUP
+
+
+
+AT_SETUP([NPAR TESTS CHISQUARE crash])
+dnl This syntax had been observed to crash pspp
+
+AT_DATA([npar.sps], [dnl
+data list list /x *.
+begin data.
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+end data.
+
+* This happens to be invalid syntax. But should not crash.
+NPAR TEST
+ /CHISQUARE= x(0.098, 99.098)
+ /EXPECTED = 1.2.
+])
+
+AT_CHECK([pspp -O format=csv npar.sps], [1], [ignore])
+
+AT_CLEANUP