3 # This program tests that the REGRESSION command works.
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
23 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
24 echo Not cleaning $TEMPDIR;
59 activity="create program"
61 data list list / v0 to v2.
63 0.65377128 7.735648 -23.97588
64 -0.13087553 6.142625 -19.63854
65 0.34880368 7.651430 -25.26557
66 0.69249021 6.125125 -16.57090
67 -0.07368178 8.245789 -25.80001
68 -0.34404919 6.031540 -17.56743
69 0.75981559 9.832291 -28.35977
70 -0.46958313 5.343832 -16.79548
71 -0.06108490 8.838262 -29.25689
72 0.56154863 6.200189 -18.58219
74 regression /variables=v0 v1 v2 /statistics defaults /dependent=v2 /method=enter /save=pred resid.
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="run program"
81 $SUPERVISOR $PSPP -o pspp.csv $TESTFILE
82 if [ $? -ne 0 ] ; then no_result ; fi
84 diff -c $TEMPDIR/pspp.csv - << EOF
85 Table: Reading free-form data from INLINE.
92 ,R,R Square,Adjusted R Square,Std. Error of the Estimate
96 ,,Sum of Squares,df,Mean Square,F,Significance
97 ,Regression,202.75,2,101.38,56.75,.00
98 ,Residual,12.50,7,1.79,,
102 ,,B,Std. Error,Beta,t,Significance
103 ,(Constant),2.19,2.36,.00,.93,.52
104 ,v0,1.81,1.05,.17,1.72,.12
105 ,v1,-3.43,.33,-1.03,-10.33,.00
110 .65,7.74,-23.98,-.84,-23.13
111 -.13,6.14,-19.64,-.54,-19.10
112 .35,7.65,-25.27,-1.87,-23.40
113 .69,6.13,-16.57,.97,-17.54
114 -.07,8.25,-25.80,.40,-26.20
115 -.34,6.03,-17.57,1.53,-19.10
116 .76,9.83,-28.36,1.77,-30.13
117 -.47,5.34,-16.80,.18,-16.97
118 -.06,8.84,-29.26,-1.05,-28.21
119 .56,6.20,-18.58,-.54,-18.04
121 if [ $? -ne 0 ] ; then fail ; fi