X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fnpar.at;h=f4cec2edb9ea2eeed120835c4742e365c23adbb1;hb=0b52efcb1226c05b87c4ff9add5c91c70c42c862;hp=a8888ab9bc2095a942d4465affb8161ccc48d09e;hpb=7ebdbb57cdb7f8e9413cccc0426d6cd6af3d98b9;p=pspp-builds.git diff --git a/tests/language/stats/npar.at b/tests/language/stats/npar.at index a8888ab9..f4cec2ed 100644 --- a/tests/language/stats/npar.at +++ b/tests/language/stats/npar.at @@ -526,13 +526,13 @@ AT_CHECK([pspp -o pspp.csv npar.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Ranks ,,N,Mean Rank,Sum of Ranks -second - first,Negative Ranks,5,8.60,43.00 -,Positive Ranks,8,6.00,48.00 +first - second,Negative Ranks,8,6.00,48.00 +,Positive Ranks,5,8.60,43.00 ,Ties,2,, ,Total,15,, Table: Test Statistics -,second - first +,first - second Z,-.18 Asymp. Sig. (2-tailed),.86 Exact Sig. (2-tailed),.89 @@ -575,13 +575,13 @@ dnl This is the same output as the previous test. AT_CHECK([cat pspp.csv], [0], [dnl Table: Ranks ,,N,Mean Rank,Sum of Ranks -second - first,Negative Ranks,5,8.60,43.00 -,Positive Ranks,8,6.00,48.00 +first - second,Negative Ranks,8,6.00,48.00 +,Positive Ranks,5,8.60,43.00 ,Ties,2,, ,Total,15,, Table: Test Statistics -,second - first +,first - second Z,-.18 Asymp. Sig. (2-tailed),.86 Exact Sig. (2-tailed),.89 @@ -610,20 +610,22 @@ npar tests . ]) AT_CHECK([pspp -o pspp.csv npar.sps]) -AT_CHECK([cat pspp.csv], [0], [dnl +dnl Some machines return .313 instead of .312 for the Point Probability +dnl (see bug #31611). +AT_CHECK([sed 's/\.313$/.312/' pspp.csv], [0], [dnl Table: Frequencies ,,N -height - age,Negative Differences,1 -,Positive Differences,3 +age - height,Negative Differences,3 +,Positive Differences,1 ,Ties,2 ,Total,6 -rank - height,Negative Differences,3 -,Positive Differences,2 +height - rank,Negative Differences,2 +,Positive Differences,3 ,Ties,1 ,Total,6 Table: Test Statistics -,height - age,rank - height +,age - height,height - rank Exact Sig. (2-tailed),.625,1.000 Exact Sig. (1-tailed),.312,.500 Point Probability,.250,.312 @@ -852,7 +854,7 @@ Table: Runs Test ,score Test Value (median),3.0000 Cases < Test Value,177.0000 -Cases >= Test Value,309.0000 +Cases ≥ Test Value,309.0000 Total Cases,486.0000 Number of Runs,12 Z,-20.9931 @@ -862,7 +864,7 @@ Table: Runs Test ,score Test Value (mean),3.6379 Cases < Test Value,259.0000 -Cases >= Test Value,227.0000 +Cases ≥ Test Value,227.0000 Total Cases,486.0000 Number of Runs,12 Z,-21.0650 @@ -872,7 +874,7 @@ Table: Runs Test ,score Test Value (mode),6.0000 Cases < Test Value,316.0000 -Cases >= Test Value,170.0000 +Cases ≥ Test Value,170.0000 Total Cases,486.0000 Number of Runs,11 Z,-21.0742 @@ -880,3 +882,704 @@ Asymp. Sig. (2-tailed),.0000 ]) AT_CLEANUP + + +AT_SETUP([NPAR TESTS Friedman]) +AT_DATA([npar-friedman.sps], [dnl +set format F15.4. +data list notable list /x * y * z. +begin data +9.5 6.5 8.1 +8.0 6.0 6.0 +7.0 6.5 4.2 +9.5 5.0 7.3 +9.0 7.0 6.2 +8.5 6.9 6.5 +7.5 8.0 6.5 +6.0 8.0 3.1 +5.0 6.0 4.9 +7.5 7.5 6.2 +end data. + +npar tests + /friedman = x y z. +]) + +AT_CHECK([pspp -o pspp.csv npar-friedman.sps]) + +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Ranks +,Mean Rank +x,2.6500 +y,2.1000 +z,1.2500 + +Table: Test Statistics +N,10 +Chi-Square,10.4737 +df,2 +Asymp. Sig.,.0053 +]) + +AT_CLEANUP + + + +AT_SETUP([NPAR TESTS Mann-Whitney]) +AT_DATA([npar-mann-whitney.sps], [dnl +SET FORMAT = F11.4 + +data list notable list /height * sex (f1.0). +begin data. +201 1 +84 1 +83 1 +94 1 +88 0 +99 0 +55 0 +69 0 +86 1 +79 1 +91 0 +201 0 +88 1 +85 1 +82 1 +88 0 +75 0 +99 0 +81 0 +72 1 +89 1 +92 1 +80 0 +82 0 +76 0 +65 0 +85 0 +76 1 +145 1 +24 1 +end data. + +NPAR TESTS + /M-W = height BY sex (0,1). +]) + +AT_CHECK([pspp -o pspp.csv npar-mann-whitney.sps]) + +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Ranks +,N,,,Mean Rank,,Sum of Ranks, +,0,1,Total,0,1,0,1 +height,15.0000,15.0000,30.0000,14.5333,16.4667,218.0000,247.0000 + +Table: Test Statistics +,Mann-Whitney U,Wilcoxon W,Z,Asymp. Sig. (2-tailed) +height,98.0000,218.0000,-.6020,.5472 +]) + + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Cochran]) +AT_DATA([npar-cochran.sps], [dnl +set format f11.3. + +data list notable list /v1 * v2 * v3 * v4 * v5 * v6 * v7 *. +begin data. +2 1 1 2 1 1 2 +2 2 2 2 1 1 1 +1 1 2 2 1 1 2 +2 2 2 2 1 1 2 +2 1 2 1 1 2 1 +1 2 2 1 1 1 1 +1 2 2 2 2 2 2 +2 2 1 2 1 1 1 +1 2 1 2 1 1 2 +end data. + +npar tests + /cochran = v1 to v7 . + +]) + +AT_CHECK([pspp -o pspp.csv npar-cochran.sps]) + +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Frequencies +,Value, +,Success (2),Failure (1) +v1,5,4 +v2,6,3 +v3,6,3 +v4,7,2 +v5,1,8 +v6,2,7 +v7,5,4 + +Table: Test Statistics +N,9 +Cochran's Q,12.735 +df,6 +Asymp. Sig.,.047 +]) + +AT_CLEANUP + + + +AT_SETUP([NPAR TESTS Kendall]) +AT_DATA([npar-kendall.sps], [dnl +SET FORMAT F14.3. + +data list notable list /v1 * v2 * v3 +begin data. + 7 7 2 + 5 6 5 + 8 6 4 + 5 7 4 + 5 4 4 + 8 6 5 + 6 3 5 + 7 6 5 + 8 5 5 + . 2 2 + 5 4 5 + 3 4 4 + 5 1 2 + 5 2 1 + 7 6 5 + 6 3 4 + 6 6 6 + 5 4 5 + 4 3 4 + 9 1 1 + 6 2 1 + 3 7 8 + 6 3 4 + 4 4 4 + 5 4 3 + 6 5 2 + 4 4 8 + 4 6 4 + 6 5 5 + 7 8 6 + 5 3 5 +end data. + +npar tests + /kendall = all + . +]) + +AT_CHECK([pspp -o pspp.csv npar-kendall.sps]) + +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Ranks +,Mean Rank +v1,2.500 +v2,1.817 +v3,1.683 + +Table: Test Statistics +N,30 +Kendall's W,.233 +Chi-Square,13.960 +df,2 +Asymp. Sig.,.001 +]) + +AT_CLEANUP + + + +AT_SETUP([NPAR TESTS McNemar]) + +AT_DATA([mcnemar.sps], [dnl +set format = F12.3. +data list notable list /v1 * v2 * junk *. +begin data. +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 1 1 +0 1 1 +0 1 1 +0 1 1 +0 1 1 +1 0 1 +1 0 1 +1 1 1 +1 1 1 +1 1 0 +1 1 0 +1 1 1 +end data. + +npar tests + /mcnemar = v1 WITH v2 junk. +]) + +AT_CHECK([pspp -O format=csv mcnemar.sps], [0], [dnl +Table: v1 & v2 +v1,v2, +,.000,1.000 +.000,4,9 +1.000,2,5 + +Table: v1 & junk +v1,junk, +,.000,1.000 +.000,8,5 +1.000,2,5 + +Table: Test Statistics +,N,Exact Sig. (2-tailed),Exact Sig. (1-tailed),Point Probability +v1 & v2,20,.065,.033,.027 +v1 & junk,20,.453,.227,.164 +]) + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Kolmogorov-Smirnov Uniform parameters given]) + +AT_DATA([ks-uniform.sps], [dnl +set format F12.3. +data list notable list /x *. +begin data +.554 +.382 +.329 +.480 +.711 +.503 +.203 +.477 +.621 +.581 +end data. + +npar tests k-s (uniform 0 1) = x. +]) + +AT_CHECK([pspp -O format=csv ks-uniform.sps], [0], [dnl +Table: One-Sample Kolmogorov-Smirnov Test +,,x +N,,10 +Uniform Parameters,Minimum,.000 +,Maximum,1.000 +Most Extreme Differences,Absolute,.289 +,Positive,.289 +,Negative,-.229 +Kolmogorov-Smirnov Z,,.914 +Asymp. Sig. (2-tailed),,.374 +]) + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Kolmogorov-Smirnov Normal parameters imputed]) + +AT_DATA([ks-normal.sps], [dnl +set format = F12.3. + +data list notable list /foo * bar *. +begin data. +65 12.5 +59 14.2 +43 12.6 +57 +68 +79 +51 +62 +57 +73 +58 +58 +68 +75 +47 +70 +59 +71 +52 +48 13.0 +58 14.1 +37 15.0 +39 13.1 +58 13.2 +43 14.5 +58 13.5 +86 14.0 +63 12.5 +80 12.8 +70 +63 +53 +53 +48 +49 +51 +47 +81 +66 +78 +65 +69 +70 12.1 +63 12.5 +64 12.4 +39 13.8 +51 13.2 +68 14.0 +76 12.6 +53 12.1 +71 13.5 +47 13.8 +87 14.1 +72 12.9 +48 12.1 +75 12.8 +51 13.4 +63 13.9 +61 12.5 +61 12.4 +66 12.8 +82 12.9 +81 13.6 +46 +52 +71 +73 +58 +57 +46 +58 +52 13.5 +71 13.2 +57 12.8 +78 14.1 +73 12.1 +50 12.6 +71 +51 +51 +68 +84 +64 +66 +65 +52 +56 +70 +68 +66 +78 +65 +71 +53 +81 +53 +57 +64 +61 +43 +56 +37 +74 +66 +81 +67 +80 +68 +76 +70 +80 +42 +74 +80 +70 +60 +39 +72 +69 +63 +72 +63 +49 +53 13.2 +43 13.8 +51 12.5 +63 12.6 +64 12.9 +65 13.0 +64 12.5 +66 12.0 +55 +62 +58 +48 +67 +46 +36 +61 +55 +77 +74 +60 +70 +69 +57 +49 +63 +69 +63 +76 +53 +54 +42 +64 +66 +61 +62 +73 +73 +60 +79 +40 +48 +76 +60 +76 +54 +69 +65 +69 +51 +54 +82 +end data. + +npar tests + /k-s (normal) = foo bar. +]) + +AT_CHECK([pspp -O format=csv ks-normal.sps], [0], [dnl +Table: One-Sample Kolmogorov-Smirnov Test +,,foo,bar +N,,174,48 +Normal Parameters,Mean,62.109,13.108 +,Std. Deviation,11.548,.718 +Most Extreme Differences,Absolute,.059,.115 +,Positive,.055,.115 +,Negative,-.059,-.082 +Kolmogorov-Smirnov Z,,.785,.795 +Asymp. Sig. (2-tailed),,.569,.552 +]) + + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Median Test (median imputed)]) + +AT_DATA([median1.sps], [dnl +set format F12.3. +data list notable list /ignore * animal * years * w *. +begin data +99 1 10 1 +99 4 1 1 +99 5 11 1 +99 5 10 1 +99 3 7 1 +99 6 10 1 +99 0 7 1 +99 3 14 1 +99 2 3 1 +99 1 1 1 +99 4 7 1 +99 5 12 1 +99 3 6 1 +99 4 1 1 +99 3 5 1 +99 5 7 1 +99 4 6 1 +99 3 14 1 +99 4 8 1 +99 5 13 1 +99 2 0 1 +99 4 7 1 +99 4 7 1 +99 1 0 1 +99 2 8 1 +99 4 10 1 +99 2 3 1 +99 2 0 1 +99 4 8 1 +99 1 8 1 +end data. + + +variable label years 'Years expected'. +variable label animal 'Animal Genus'. + +add value labels animal 1 'Animal 1' 2 'Animal 2' 3 'Animal 3' 4 'Animal 4' 5 'Animal 5'. + +npar tests + /median = years by animal (1, 5) + . +]) + + +AT_CHECK([pspp -O format=csv median1.sps], [0], [dnl +Table: Frequencies +,,Animal Genus,,,, +,,Animal 1,Animal 2,Animal 3,Animal 4,Animal 5 +Years expected,> Median,2,1,2,3,4 +,≤ Median,2,4,3,6,1 + +Table: Test Statistics +,N,Median,Chi-Square,df,Asymp. Sig. +Years expected,28,7.000,4.317,4,.365 +]) + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Median Test (median given)]) + +AT_DATA([median2.sps], [dnl +set format F12.3. +data list notable list /ignore * animal * years * w *. +begin data +99 1 10 1 +99 4 1 1 +99 5 11 1 +99 5 10 1 +99 3 7 1 +99 3 14 1 +99 2 3 1 +99 1 1 1 +99 4 7 1 +99 5 12 1 +99 3 6 1 +99 4 1 1 +99 3 5 1 +99 5 7 1 +99 4 6 1 +99 3 14 1 +99 4 8 1 +99 5 13 1 +99 2 0 1 +99 4 7 1 +99 4 7 1 +99 1 0 1 +99 2 8 1 +99 4 10 1 +99 2 3 1 +99 2 0 1 +99 4 8 1 +99 1 8 1 +end data. + + +variable label years 'Years expected'. +variable label animal 'Animal Genus'. + +add value labels animal 1 'Animal 1' 2 'Animal 2' 3 'Animal 3' 4 'Animal 4' 5 'Animal 5'. + +npar tests + /median (7) = years by animal (1, 5) + . +]) + + +AT_CHECK([pspp -O format=csv median2.sps], [0], [dnl +Table: Frequencies +,,Animal Genus,,,, +,,Animal 1,Animal 2,Animal 3,Animal 4,Animal 5 +Years expected,> Median,2,1,2,3,4 +,≤ Median,2,4,3,6,1 + +Table: Test Statistics +,N,Median,Chi-Square,df,Asymp. Sig. +Years expected,28,7.000,4.317,4,.365 +]) + +AT_CLEANUP + + +AT_SETUP([NPAR TESTS Median Test (two sample)]) + +AT_DATA([median3.sps], [dnl +set format F12.3. +data list notable list /xx * animal * years * w *. +begin data +99 1 10 1 +99 4 1 1 +99 5 11 1 +99 5 10 1 +99 3 7 1 +99 3 14 1 +99 2 3 1 +99 1 1 1 +99 4 7 1 +99 5 12 1 +99 3 6 1 +99 4 1 1 +99 3 5 1 +99 5 7 1 +99 4 6 1 +99 3 14 1 +99 4 8 1 +99 5 13 1 +99 2 0 1 +99 4 7 1 +99 4 7 1 +99 1 0 1 +99 2 8 1 +99 4 10 1 +99 2 3 1 +99 2 0 1 +99 4 8 1 +99 1 8 1 +end data. + + +variable label years 'Years expected'. +variable label animal 'Animal Genus'. + +add value labels animal 1 'Animal 1' 2 'Animal 2' 3 'Animal 3' 4 'Animal 4' 5 'Animal 5'. + +npar tests + /median (7) = xx years by animal (5, 1) + . +]) + + +AT_CHECK([pspp -O format=csv median3.sps], [0], [dnl +Table: Frequencies +,,Animal Genus, +,,Animal 1,Animal 5 +xx,> Median,4,5 +,≤ Median,0,0 +Years expected,> Median,2,4 +,≤ Median,2,1 + +Table: Test Statistics +,N,Median,Chi-Square,df,Asymp. Sig. +xx,9,7.000,NaN,1,NaN +Years expected,9,7.000,.900,1,.343 +]) + +AT_CLEANUP \ No newline at end of file