+
+
+dnl The following example comes from
+dnl http://www.ats.ucla.edu/stat/spss/output/reg_spss%28long%29.htm
+AT_SETUP([LINEAR REGRESSION coefficient confidence interval])
+
+AT_DATA([conf.sps], [dnl
+set format = F22.3.
+
+data list notable list /math female socst read science *
+begin data.
+ 41.00 .00 57.00 57.00 47.00
+ 53.00 1.00 61.00 68.00 63.00
+ 54.00 .00 31.00 44.00 58.00
+ 47.00 .00 56.00 63.00 53.00
+ 57.00 .00 61.00 47.00 53.00
+ 51.00 .00 61.00 44.00 63.00
+ 42.00 .00 61.00 50.00 53.00
+ 45.00 .00 36.00 34.00 39.00
+ 54.00 .00 51.00 63.00 58.00
+ 52.00 .00 51.00 57.00 50.00
+ 51.00 .00 61.00 60.00 53.00
+ 51.00 .00 61.00 57.00 63.00
+ 71.00 .00 71.00 73.00 61.00
+ 57.00 .00 46.00 54.00 55.00
+ 50.00 .00 56.00 45.00 31.00
+ 43.00 .00 56.00 42.00 50.00
+ 51.00 .00 56.00 47.00 50.00
+ 60.00 .00 56.00 57.00 58.00
+ 62.00 .00 61.00 68.00 55.00
+ 57.00 .00 46.00 55.00 53.00
+ 35.00 .00 41.00 63.00 66.00
+ 75.00 .00 66.00 63.00 72.00
+ 45.00 .00 56.00 50.00 55.00
+ 57.00 .00 61.00 60.00 61.00
+ 45.00 .00 46.00 37.00 39.00
+ 46.00 .00 31.00 34.00 39.00
+ 66.00 .00 66.00 65.00 61.00
+ 57.00 .00 46.00 47.00 58.00
+ 49.00 .00 46.00 44.00 39.00
+ 49.00 .00 41.00 52.00 55.00
+ 57.00 .00 51.00 42.00 47.00
+ 64.00 .00 61.00 76.00 64.00
+ 63.00 .00 71.00 65.00 66.00
+ 57.00 .00 31.00 42.00 72.00
+ 50.00 .00 61.00 52.00 61.00
+ 58.00 .00 66.00 60.00 61.00
+ 75.00 .00 66.00 68.00 66.00
+ 68.00 .00 66.00 65.00 66.00
+ 44.00 .00 36.00 47.00 36.00
+ 40.00 .00 51.00 39.00 39.00
+ 41.00 .00 51.00 47.00 42.00
+ 62.00 .00 51.00 55.00 58.00
+ 57.00 .00 51.00 52.00 55.00
+ 43.00 .00 41.00 42.00 50.00
+ 48.00 .00 66.00 65.00 63.00
+ 63.00 .00 46.00 55.00 69.00
+ 39.00 .00 47.00 50.00 49.00
+ 70.00 .00 51.00 65.00 63.00
+ 63.00 .00 46.00 47.00 53.00
+ 59.00 .00 51.00 57.00 47.00
+ 61.00 .00 56.00 53.00 57.00
+ 38.00 .00 41.00 39.00 47.00
+ 61.00 .00 46.00 44.00 50.00
+ 49.00 .00 71.00 63.00 55.00
+ 73.00 .00 66.00 73.00 69.00
+ 44.00 .00 42.00 39.00 26.00
+ 42.00 .00 32.00 37.00 33.00
+ 39.00 .00 46.00 42.00 56.00
+ 55.00 .00 41.00 63.00 58.00
+ 52.00 .00 51.00 48.00 44.00
+ 45.00 .00 61.00 50.00 58.00
+ 61.00 .00 66.00 47.00 69.00
+ 39.00 .00 46.00 44.00 34.00
+ 41.00 .00 36.00 34.00 36.00
+ 50.00 .00 61.00 50.00 36.00
+ 40.00 .00 26.00 44.00 50.00
+ 60.00 .00 66.00 60.00 55.00
+ 47.00 .00 26.00 47.00 42.00
+ 59.00 .00 44.00 63.00 65.00
+ 49.00 .00 36.00 50.00 44.00
+ 46.00 .00 51.00 44.00 39.00
+ 58.00 .00 61.00 60.00 58.00
+ 71.00 .00 66.00 73.00 63.00
+ 58.00 .00 66.00 68.00 74.00
+ 46.00 .00 51.00 55.00 58.00
+ 43.00 .00 31.00 47.00 45.00
+ 54.00 .00 61.00 55.00 49.00
+ 56.00 .00 66.00 68.00 63.00
+ 46.00 .00 46.00 31.00 39.00
+ 54.00 .00 56.00 47.00 42.00
+ 57.00 .00 56.00 63.00 55.00
+ 54.00 .00 36.00 36.00 61.00
+ 71.00 .00 56.00 68.00 66.00
+ 48.00 .00 56.00 63.00 63.00
+ 40.00 .00 41.00 55.00 44.00
+ 64.00 .00 66.00 55.00 63.00
+ 51.00 .00 56.00 52.00 53.00
+ 39.00 .00 56.00 34.00 42.00
+ 40.00 .00 31.00 50.00 34.00
+ 61.00 .00 56.00 55.00 61.00
+ 66.00 .00 46.00 52.00 47.00
+ 49.00 .00 46.00 63.00 66.00
+ 65.00 1.00 61.00 68.00 69.00
+ 52.00 1.00 48.00 39.00 44.00
+ 46.00 1.00 51.00 44.00 47.00
+ 61.00 1.00 51.00 50.00 63.00
+ 72.00 1.00 56.00 71.00 66.00
+ 71.00 1.00 71.00 63.00 69.00
+ 40.00 1.00 41.00 34.00 39.00
+ 69.00 1.00 61.00 63.00 61.00
+ 64.00 1.00 66.00 68.00 69.00
+ 56.00 1.00 61.00 47.00 66.00
+ 49.00 1.00 41.00 47.00 33.00
+ 54.00 1.00 51.00 63.00 50.00
+ 53.00 1.00 51.00 52.00 61.00
+ 66.00 1.00 56.00 55.00 42.00
+ 67.00 1.00 56.00 60.00 50.00
+ 40.00 1.00 33.00 35.00 51.00
+ 46.00 1.00 56.00 47.00 50.00
+ 69.00 1.00 71.00 71.00 58.00
+ 40.00 1.00 56.00 57.00 61.00
+ 41.00 1.00 51.00 44.00 39.00
+ 57.00 1.00 66.00 65.00 46.00
+ 58.00 1.00 56.00 68.00 59.00
+ 57.00 1.00 66.00 73.00 55.00
+ 37.00 1.00 41.00 36.00 42.00
+ 55.00 1.00 46.00 43.00 55.00
+ 62.00 1.00 66.00 73.00 58.00
+ 64.00 1.00 56.00 52.00 58.00
+ 40.00 1.00 51.00 41.00 39.00
+ 50.00 1.00 51.00 60.00 50.00
+ 46.00 1.00 56.00 50.00 50.00
+ 53.00 1.00 56.00 50.00 39.00
+ 52.00 1.00 46.00 47.00 48.00
+ 45.00 1.00 46.00 47.00 34.00
+ 56.00 1.00 61.00 55.00 58.00
+ 45.00 1.00 56.00 50.00 44.00
+ 54.00 1.00 41.00 39.00 50.00
+ 56.00 1.00 46.00 50.00 47.00
+ 41.00 1.00 26.00 34.00 29.00
+ 54.00 1.00 56.00 57.00 50.00
+ 72.00 1.00 56.00 57.00 54.00
+ 56.00 1.00 51.00 68.00 50.00
+ 47.00 1.00 46.00 42.00 47.00
+ 49.00 1.00 66.00 61.00 44.00
+ 60.00 1.00 66.00 76.00 67.00
+ 54.00 1.00 46.00 47.00 58.00
+ 55.00 1.00 56.00 46.00 44.00
+ 33.00 1.00 41.00 39.00 42.00
+ 49.00 1.00 61.00 52.00 44.00
+ 43.00 1.00 51.00 28.00 44.00
+ 50.00 1.00 52.00 42.00 50.00
+ 52.00 1.00 51.00 47.00 39.00
+ 48.00 1.00 41.00 47.00 44.00
+ 58.00 1.00 66.00 52.00 53.00
+ 43.00 1.00 61.00 47.00 48.00
+ 41.00 1.00 31.00 50.00 55.00
+ 43.00 1.00 51.00 44.00 44.00
+ 46.00 1.00 41.00 47.00 40.00
+ 44.00 1.00 41.00 45.00 34.00
+ 43.00 1.00 46.00 47.00 42.00
+ 61.00 1.00 56.00 65.00 58.00
+ 40.00 1.00 51.00 43.00 50.00
+ 49.00 1.00 61.00 47.00 53.00
+ 56.00 1.00 66.00 57.00 58.00
+ 61.00 1.00 71.00 68.00 55.00
+ 50.00 1.00 61.00 52.00 54.00
+ 51.00 1.00 61.00 42.00 47.00
+ 42.00 1.00 41.00 42.00 42.00
+ 67.00 1.00 66.00 66.00 61.00
+ 53.00 1.00 61.00 47.00 53.00
+ 50.00 1.00 58.00 57.00 51.00
+ 51.00 1.00 31.00 47.00 63.00
+ 72.00 1.00 61.00 57.00 61.00
+ 48.00 1.00 61.00 52.00 55.00
+ 40.00 1.00 31.00 44.00 40.00
+ 53.00 1.00 61.00 50.00 61.00
+ 39.00 1.00 36.00 39.00 47.00
+ 63.00 1.00 41.00 57.00 55.00
+ 51.00 1.00 37.00 57.00 53.00
+ 45.00 1.00 43.00 42.00 50.00
+ 39.00 1.00 61.00 47.00 47.00
+ 42.00 1.00 39.00 42.00 31.00
+ 62.00 1.00 51.00 60.00 61.00
+ 44.00 1.00 51.00 44.00 35.00
+ 65.00 1.00 66.00 63.00 54.00
+ 63.00 1.00 71.00 65.00 55.00
+ 54.00 1.00 41.00 39.00 53.00
+ 45.00 1.00 36.00 50.00 58.00
+ 60.00 1.00 51.00 52.00 56.00
+ 49.00 1.00 51.00 60.00 50.00
+ 48.00 1.00 51.00 44.00 39.00
+ 57.00 1.00 61.00 52.00 63.00
+ 55.00 1.00 61.00 55.00 50.00
+ 66.00 1.00 56.00 50.00 66.00
+ 64.00 1.00 71.00 65.00 58.00
+ 55.00 1.00 51.00 52.00 53.00
+ 42.00 1.00 36.00 47.00 42.00
+ 56.00 1.00 61.00 63.00 55.00
+ 53.00 1.00 66.00 50.00 53.00
+ 41.00 1.00 41.00 42.00 42.00
+ 42.00 1.00 41.00 36.00 50.00
+ 53.00 1.00 56.00 50.00 55.00
+ 42.00 1.00 51.00 41.00 34.00
+ 60.00 1.00 56.00 47.00 50.00
+ 52.00 1.00 56.00 55.00 42.00
+ 38.00 1.00 46.00 42.00 36.00
+ 57.00 1.00 52.00 57.00 55.00
+ 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 (95)
+ /dependent = science
+ /method = enter
+])
+
+AT_CHECK([pspp -O format=csv conf.sps], [0], [dnl
+Table: Model Summary (science)
+R,R Square,Adjusted R Square,Std. Error of the Estimate
+.699,.489,.479,7.148
+
+Table: ANOVA (science)
+,Sum of Squares,df,Mean Square,F,Sig.
+Regression,9543.721,4,2385.930,46.695,.000
+Residual,9963.779,195,51.096,,
+Total,19507.500,199,,,
+
+Table: Coefficients (science)
+,Unstandardized Coefficients,,Standardized Coefficients,t,Sig.,95% Confidence Interval for B,
+,B,Std. Error,Beta,,,Lower Bound,Upper Bound
+(Constant),12.325,3.194,.000,3.859,.000,6.027,18.624
+math,.389,.074,.368,5.252,.000,.243,.535
+female,-2.010,1.023,-.101,-1.965,.051,-4.027,.007
+socst,.050,.062,.054,.801,.424,-.073,.173
+read,.335,.073,.347,4.607,.000,.192,.479
+])
+
+
+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,t,Sig.
+,B,Std. Error,Beta,,
+(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,t,Sig.
+,B,Std. Error,Beta,,
+(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,t,Sig.
+,B,Std. Error,Beta,,
+number,.672,.118,.802,5.699,.000
+])
+
+AT_CLEANUP
+
+dnl This is an example from doc/tutorial.texi
+dnl So if the results of this have to be changed in any way,
+dnl make sure to update that file.
+AT_SETUP([REGRESSION tutorial example])
+cp $top_srcdir/examples/repairs.sav .
+AT_DATA([regression.sps], [dnl
+GET FILE='repairs.sav'.
+REGRESSION /VARIABLES=mtbf duty_cycle /DEPENDENT=mttr.
+REGRESSION /VARIABLES=mtbf /DEPENDENT=mttr.
+])
+AT_CHECK([pspp -o pspp.csv -o pspp.txt regression.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Model Summary (Mean time to repair (hours) )
+R,R Square,Adjusted R Square,Std. Error of the Estimate
+.99,.99,.99,2.24
+
+Table: ANOVA (Mean time to repair (hours) )
+,Sum of Squares,df,Mean Square,F,Sig.
+Regression,5308.87,2,2654.44,530.75,.000
+Residual,60.02,12,5.00,,
+Total,5368.89,14,,,
+
+Table: Coefficients (Mean time to repair (hours) )
+,Unstandardized Coefficients,,Standardized Coefficients,t,Sig.
+,B,Std. Error,Beta,,
+(Constant),9.81,1.50,.00,6.54,.000
+Mean time between failures (months) ,3.10,.10,.99,32.43,.000
+Ratio of working to non-working time,1.09,1.78,.02,.61,.552
+
+Table: Model Summary (Mean time to repair (hours) )
+R,R Square,Adjusted R Square,Std. Error of the Estimate
+.99,.99,.99,2.18
+
+Table: ANOVA (Mean time to repair (hours) )
+,Sum of Squares,df,Mean Square,F,Sig.
+Regression,5307.00,1,5307.00,1114.73,.000
+Residual,61.89,13,4.76,,
+Total,5368.89,14,,,
+
+Table: Coefficients (Mean time to repair (hours) )
+,Unstandardized Coefficients,,Standardized Coefficients,t,Sig.
+,B,Std. Error,Beta,,
+(Constant),10.50,.96,.00,10.96,.000
+Mean time between failures (months) ,3.11,.09,.99,33.39,.000
+])
+AT_CLEANUP
+
+
+AT_SETUP([LINEAR REGRESSION vif])
+AT_DATA([regression-vif.sps], [dnl
+SET FORMAT=F10.3.
+
+data list notable list /competence_x1 motivation_x2 performance_y.
+begin data
+32 34 36
+35 37 39
+38 45 49
+31 41 41
+36 40 38
+32 38 36
+33 39 37
+31 40 41
+30 37 40
+35 37 43
+31 34 36
+34 32 35
+31 42 34
+25 36 40
+35 42 40
+36 41 44
+30 38 32
+34 41 41
+34 41 44
+22 27 26
+27 26 33
+30 30 35
+30 35 37
+37 39 44
+29 35 36
+31 35 29
+31 45 41
+29 30 32
+29 35 36
+31 37 37
+36 45 42
+32 44 39
+27 26 31
+33 39 35
+20 25 28
+30 36 39
+27 37 39
+25 39 36
+32 38 38
+32 38 35
+end data.
+
+regression /variables=competence_x1 motivation_x2
+ /statistics=defaults tol
+ /dependent=performance_y
+ .
+])
+
+
+AT_CHECK([pspp -O format=csv regression-vif.sps], [0], [dnl
+Table: Model Summary (performance_y)
+R,R Square,Adjusted R Square,Std. Error of the Estimate
+.785,.616,.595,2.980
+
+Table: ANOVA (performance_y)
+,Sum of Squares,df,Mean Square,F,Sig.
+Regression,526.494,2,263.247,29.641,.000
+Residual,328.606,37,8.881,,
+Total,855.100,39,,,
+
+Table: Coefficients (performance_y)
+,Unstandardized Coefficients,,Standardized Coefficients,t,Sig.,Collinearity Statistics,
+,B,Std. Error,Beta,,,Tolerance,VIF
+(Constant),7.220,4.020,.000,1.796,.080,,
+competence_x1,.432,.166,.358,2.609,.013,.552,1.812
+motivation_x2,.453,.125,.499,3.636,.001,.552,1.812
+])
+
+AT_CLEANUP