X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fcorrelations.at;h=12819835d33dc72e7e207e7f4518f381f284b7b5;hb=f790dbda9d498eef9c9c0a49078adbeecf768d56;hp=4316bd77c3aacf583ddd53f614d2933f7c5c5518;hpb=501dedaf37c6d636c8ae2f03fd59d42be2a53a7c;p=pspp diff --git a/tests/language/stats/correlations.at b/tests/language/stats/correlations.at index 4316bd77c3..12819835d3 100644 --- a/tests/language/stats/correlations.at +++ b/tests/language/stats/correlations.at @@ -1,3 +1,19 @@ +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl AT_BANNER([CORRELATIONS]) AT_SETUP([CORRELATIONS -- unweighted]) @@ -140,7 +156,7 @@ AT_CHECK([pspp -O format=csv corr-ns.sps], [0], [dnl Table: Correlations ,,bar,wiz foo,Pearson Correlation,1.000,-1.000 -,Sig. (2-tailed),,.000 +,Sig. (2-tailed),.000,.000 ,N,6,6 ]) @@ -199,3 +215,190 @@ b,Pearson Correlation,... ,N,... ]) AT_CLEANUP + + + +dnl Checks for bug #40661 +AT_SETUP([CORRELATIONS -- incorrect subtable selection]) +AT_DATA([correlations.sps], [dnl +set format = F12.4. +set decimal = dot. +data list notable list /var1 var2 var3 var4 var5 *. +begin data. +7,6,9,2,3 +9,12,8,5,8 +8,9,7,8,6 +8,8,9,10,8 +7,6,4,5,3 +7,9,8,2,1 +9,8,11,,10 +8,7,6,,5 +6,7,6,,8 +6,,3,,4 +6,,7,3,3 +5,4,2,7,8 +9,8,6,11,10 +5,6,2,2,4 +8,7,6,8,7 +10,13,8,12,10 +7,8,7,11,2 +8,7,7,9,6 +10,11,11,8,1 +5,8,6,9,9 +8,7,5,5,6 +5,7,2,1,8 +9,8,8,13,6 +5,8,5,6,4 +,7,5,4,5 +,8,4,4,3 +,6,4,9,5 +8,11,9,12,3 +9,11,8,10,6 +10,10,7,8,1 +6,6,3,8,9 +10,9,7,12,2 +6,8,,7,4 +6,8,3,2,9 +7,8,8,2,9 +5,6,5,5,5 +9,9,7,7,5 +9,10,11,7,8 +8,11,9,3,3 +5,4,4,0,5 +9,9,11,14,2 +5,6,2,4,4 +8,8,7,4,1 +9,9,8,14, +6,8,7,2, +10,9,9,6, +8,8,10,9, +7,8,4,12, +6,6,6,7,1 +5,7,7,4,10 +9,10,10,13,4 +9,11,9,8,7 +10,13,12,6,8 +8,11,6,8,5 +7,8,7,12,2 +6,7,4,1,10 +5,4,5,6,10 +7,8,6,12,10 +6,5,3,9,2 +7,8,8,7,2 +5,4,4,9,8 +5,7,6,3,9 +10,10,9,13,1 +8,10,9,5,4 +8,9,8,8,7 +7,9,9,6,7 +10,9,7,12,6 +10,13,12,12,4 +7,10,9,7,2 +6,8,7,11,6 +8,11,5,13,2 +7,10,6,12,8 +10,10,9,7,9 +9,12,6,7,10 +6,6,8,2,9 +10,9,12,13,10 +8,9,8,3,6 +8,7,6,4,10 +8,7,10,12,2 +7,6,8,2,7 +8,11,6,9,4 +6,6,7,8,2 +6,7,3,11,4 +5,6,3,0,5 +10,10,11,15,6 +5,4,7,6,8 +5,4,4,1,3 +6,9,8,1,6 +10,11,10,15,8 +7,10,4,11,7 +9,12,8,6,3 +10,10,11,15,2 +10,9,9,15,3 +6,6,8,5,1 +5,7,7,0,3 +9,8,10,6,8 +9,8,11,11,4 +8,10,7,3,4 +7,8,7,3,3 +8,9,10,13,8 +end data. + +CORRELATION + /VARIABLES = var1 var2 var3 WITH var4 var5 + /PRINT = TWOTAIL NOSIG. + +CORRELATION + /VARIABLES = var3 var4 var5 WITH var1 var2 + /PRINT = TWOTAIL NOSIG. + +]) + +AT_CHECK([pspp -O format=csv correlations.sps], [0], +[Table: Correlations +,,var4,var5 +var1,Pearson Correlation,.5693,-.0519 +,Sig. (2-tailed),.000,.623 +,N,93,92 +var2,Pearson Correlation,.3792,-.0407 +,Sig. (2-tailed),.000,.698 +,N,95,93 +var3,Pearson Correlation,.3699,-.0543 +,Sig. (2-tailed),.000,.603 +,N,95,94 + +Table: Correlations +,,var1,var2 +var3,Pearson Correlation,.6964,.5615 +,Sig. (2-tailed),.000,.000 +,N,96,97 +var4,Pearson Correlation,.5693,.3792 +,Sig. (2-tailed),.000,.000 +,N,93,95 +var5,Pearson Correlation,-.0519,-.0407 +,Sig. (2-tailed),.623,.698 +,N,92,93 +]) + +AT_CLEANUP + + +dnl Crash found by zzuf +AT_SETUP([CORRELATIONS -- empty dataset]) + +AT_DATA([correlations.sps], [dnl +data list list /a b c q g *. +CORRELATIONS 'VARIABLES = a b.] +) + +AT_CHECK([pspp -o pspp.csv correlations.sps], [1], [ignore]) + +AT_CLEANUP + +dnl Another Crash found by zzuf +AT_SETUP([CORRELATIONS -- empty dataset 2]) + +AT_DATA([correlations.sps], [dnl +data list notable list /foo * bar * wiz bang *. +begin data. + 1 00 3 . + 3 9 -50 . +98 78 104 . + . 4 4 . + 5 3 0 . +end data. + +correlations + variables = foo bar wiz bang + /missing = listwise + . +]) + +AT_CHECK([pspp -O format=csv correlations.sps], [1], [dnl +correlations.sps:13: error: CORRELATIONS: The data for the chosen variables are all missing or empty. +]) + +AT_CLEANUP