X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fregression.at;h=188d6a8de6c4b838f67cfbbbcdf142066989d111;hb=5cec2f151407ded00c03b00b101578e9123b91b2;hp=d194d73bfb99e69b2f7a811d89b064f227e4a3fe;hpb=e19fd7f7bb229404630b50b4c2fe4b1244d54eb0;p=pspp diff --git a/tests/language/stats/regression.at b/tests/language/stats/regression.at index d194d73bfb..188d6a8de6 100644 --- a/tests/language/stats/regression.at +++ b/tests/language/stats/regression.at @@ -4,6 +4,7 @@ AT_SETUP([LINEAR REGRESSION - basic]) AT_DATA([regression.sps], [dnl set format = F22.3. data list notable list / v0 to v2. +filter by v0. begin data 0.65377128 7.735648 -23.97588 -0.13087553 6.142625 -19.63854 @@ -21,6 +22,80 @@ list. ]) AT_CHECK([pspp -O format=csv regression.sps], [0], [dnl +regression.sps:16: warning: REGRESSION: REGRESSION with SAVE ignores FILTER. All cases will be processed. + +Table: Model Summary (v2) +,R,R Square,Adjusted R Square,Std. Error of the Estimate +,.971,.942,.925,1.337 + +Table: ANOVA (v2) +,,Sum of Squares,df,Mean Square,F,Sig. +,Regression,202.753,2,101.376,56.754,.000 +,Residual,12.504,7,1.786,, +,Total,215.256,9,,, + +Table: Coefficients (v2) +,,Unstandardized Coefficients,,Standardized Coefficients,, +,,B,Std. Error,Beta,t,Sig. +,(Constant),2.191,2.357,.000,.930,.380 +,v0,1.813,1.053,.171,1.722,.129 +,v1,-3.427,.332,-1.026,-10.334,.000 + +Table: Data List +v0,v1,v2,RES1,PRED1 +.654,7.736,-23.976,-.84,-23.13 +-.131,6.143,-19.639,-.54,-19.10 +.349,7.651,-25.266,-1.87,-23.40 +.692,6.125,-16.571,.97,-17.54 +-.074,8.246,-25.800,.40,-26.20 +-.344,6.032,-17.567,1.53,-19.10 +.760,9.832,-28.360,1.77,-30.13 +-.470,5.344,-16.795,.18,-16.97 +-.061,8.838,-29.257,-1.05,-28.21 +.562,6.200,-18.582,-.54,-18.04 +]) +AT_CLEANUP + + +AT_SETUP([LINEAR REGRESSION - one save]) +AT_DATA([regression.sps], [dnl +set format = F22.3. +data list notable list / v0 to v2. +begin data + 0.65377128 7.735648 -23.97588 +-0.13087553 6.142625 -19.63854 + 0.34880368 7.651430 -25.26557 + 0.69249021 6.125125 -16.57090 +-0.07368178 8.245789 -25.80001 +-0.34404919 6.031540 -17.56743 + 0.75981559 9.832291 -28.35977 +-0.46958313 5.343832 -16.79548 +-0.06108490 8.838262 -29.25689 + 0.56154863 6.200189 -18.58219 +end data +regression /variables=v0 v1 v2 /statistics defaults /dependent=v2 /method=enter /save=resid. +regression /variables=v0 v1 v2 /statistics defaults /dependent=v2 /method=enter /save=pred. +list. +]) + +AT_CHECK([pspp -O format=csv regression.sps], [0], [dnl +Table: Model Summary (v2) +,R,R Square,Adjusted R Square,Std. Error of the Estimate +,.971,.942,.925,1.337 + +Table: ANOVA (v2) +,,Sum of Squares,df,Mean Square,F,Sig. +,Regression,202.753,2,101.376,56.754,.000 +,Residual,12.504,7,1.786,, +,Total,215.256,9,,, + +Table: Coefficients (v2) +,,Unstandardized Coefficients,,Standardized Coefficients,, +,,B,Std. Error,Beta,t,Sig. +,(Constant),2.191,2.357,.000,.930,.380 +,v0,1.813,1.053,.171,1.722,.129 +,v1,-3.427,.332,-1.026,-10.334,.000 + Table: Model Summary (v2) ,R,R Square,Adjusted R Square,Std. Error of the Estimate ,.971,.942,.925,1.337 @@ -2055,3 +2130,53 @@ 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