X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fregression.at;h=7461a45a033739431b5f6c77c7491a0836f6a27a;hb=5dbf5abcbed01f04422d4dead1c0ae0bb7efde4f;hp=c48dfaf7847dbed1ddd5de2ea76094ec6db22b23;hpb=a016af53bdf60d1ab95e680e6b31311b21518b75;p=pspp diff --git a/tests/language/stats/regression.at b/tests/language/stats/regression.at index c48dfaf784..7461a45a03 100644 --- a/tests/language/stats/regression.at +++ b/tests/language/stats/regression.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([LINEAR REGRESSION]) AT_SETUP([LINEAR REGRESSION - basic]) @@ -2130,3 +2146,191 @@ Table: Coefficients (science) AT_CLEANUP + + +dnl Checks for regression against bug #44877. +AT_SETUP([LINEAR REGRESSION crash with long string variables]) +AT_DATA([regression.sps], [dnl +SET DECIMAL=DOT. + +DATA LIST notable LIST /text (A24) Y * X1 * +BEGIN DATA. +V00276601 0.00 90.00 +V00292909 10.00 30.00 +V00291204 20.00 20.00 +V00300070 0.00 90.00 +END DATA. + +REGRESSION +/VARIABLES= Y +/DEPENDENT= X1 +/METHOD=ENTER +/STATISTICS=COEFF R ANOVA +/SAVE= RESID. + +LIST. +]) +AT_CHECK([pspp -o pspp.csv regression.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Model Summary (X1) +,R,R Square,Adjusted R Square,Std. Error of the Estimate +,.95,.89,.84,15.08 + +Table: ANOVA (X1) +,,Sum of Squares,df,Mean Square,F,Sig. +,Regression,3820.45,1,3820.45,16.81,.055 +,Residual,454.55,2,227.27,, +,Total,4275.00,3,,, + +Table: Coefficients (X1) +,,Unstandardized Coefficients,,Standardized Coefficients,, +,,B,Std. Error,Beta,t,Sig. +,(Constant),85.45,10.16,.00,8.41,.004 +,Y,-3.73,.91,-.95,-4.10,.055 + +Table: Data List +text,Y,X1,RES1 +V00276601 ,.00,90.00,4.55 +V00292909 ,10.00,30.00,-18.18 +V00291204 ,20.00,20.00,9.09 +V00300070 ,.00,90.00,4.55 +]) +AT_CLEANUP + + +dnl Test for a crash which happened on bad input syntax +AT_SETUP([LINEAR REGRESSION -- Empty Parentheses]) + +AT_DATA([empty-parens.sps], [dnl +set format = F22.3. + +data list notable list /math female socst read science * +begin data. + 58.00 1.00 61.00 55.00 58.00 + 65.00 1.00 61.00 63.00 53.00 +end data. + +regression + /variables = math female socst read + /statistics = coeff r anova ci () + /dependent = science + /method = enter +]) + +AT_CHECK([pspp -o pspp.csv empty-parens.sps], [1], [ignore]) + +AT_CLEANUP + + + + +AT_SETUP([LINEAR REGRESSION varibles on ENTER subcommand]) +AT_DATA([regression.sps], [dnl +SET FORMAT=F10.3. + +DATA LIST notable LIST /number * value *. +BEGIN DATA + 16 7.25 + 0 .00 + 1 .10 + 9 27.9 + 0 .00 + 7 3.65 + 14 16.8 + 24 9.15 + 0 .00 + 24 19.0 + 7 4.05 + 12 7.90 + 6 .75 + 11 1.40 + 0 .00 + 3 2.30 + 12 7.60 + 11 6.80 + 16 8.65 +END DATA. + +REGRESSION + /STATISTICS COEFF R ANOVA + /DEPENDENT value + /METHOD=ENTER number. +]) + + +AT_CHECK([pspp -O format=csv regression.sps], [0], [dnl +Table: Model Summary (value) +,R,R Square,Adjusted R Square,Std. Error of the Estimate +,.612,.374,.338,6.176 + +Table: ANOVA (value) +,,Sum of Squares,df,Mean Square,F,Sig. +,Regression,388.065,1,388.065,10.173,.005 +,Residual,648.498,17,38.147,, +,Total,1036.563,18,,, + +Table: Coefficients (value) +,,Unstandardized Coefficients,,Standardized Coefficients,, +,,B,Std. Error,Beta,t,Sig. +,(Constant),.927,2.247,.000,.413,.685 +,number,.611,.192,.612,3.189,.005 +]) + +AT_CLEANUP + + + +AT_SETUP([LINEAR REGRESSION /ORIGIN]) +AT_DATA([regression-origin.sps], [dnl +SET FORMAT=F10.3. + +DATA LIST notable LIST /number * value *. +BEGIN DATA + 16 7.25 + 0 .00 + 1 .10 + 9 27.9 + 0 .00 + 7 3.65 + 14 16.8 + 24 9.15 + 0 .00 + 24 19.0 + 7 4.05 + 12 7.90 + 6 .75 + 11 1.40 + 0 .00 + 3 2.30 + 12 7.60 + 11 6.80 + 16 8.65 +END DATA. + +REGRESSION + /STATISTICS COEFF R ANOVA + /DEPENDENT value + /ORIGIN + /METHOD=ENTER number. +]) + + +AT_CHECK([pspp -O format=csv regression-origin.sps], [0], [dnl +Table: Model Summary (value) +,R,R Square,Adjusted R Square,Std. Error of the Estimate +,.802,.643,.622,6.032 + +Table: ANOVA (value) +,,Sum of Squares,df,Mean Square,F,Sig. +,Regression,1181.726,1,1181.726,32.475,.000 +,Residual,654.989,18,36.388,, +,Total,1836.715,19,,, + +Table: Coefficients (value) +,,Unstandardized Coefficients,,Standardized Coefficients,, +,,B,Std. Error,Beta,t,Sig. +,number,.672,.118,.802,5.699,.000 +,,,,,, +]) + +AT_CLEANUP