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
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.
76 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="run program"
80 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
81 if [ $? -ne 0 ] ; then no_result ; fi
83 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
84 diff -b $TEMPDIR/pspp.list - << EOF
85 1.1 DATA LIST. Reading free-form data from INLINE.
93 2.1 REGRESSION. Model Summary
94 #============#========#=================#==========================#
95 # R #R Square|Adjusted R Square|Std. Error of the Estimate#
96 #========#===#========#=================#==========================#
97 # |.97# .94| .93| .33#
98 #========#===#========#=================#==========================#
100 #===================#==============#==#===========#======#============#
101 # #Sum of Squares|df|Mean Square| F |Significance#
102 #========#==========#==============#==#===========#======#============#
103 # |Regression# 202.75| 2| 101.376|56.754| .000#
104 # |Residual # 12.50| 7| 1.786| | #
105 # |Total # 215.26| 9| | | #
106 #========#==========#==============#==#===========#======#============#
107 2.3 REGRESSION. Coefficients
108 #===================#=====#==========#====#======#============#
109 # # B |Std. Error|Beta| t |Significance#
110 #========#==========#=====#==========#====#======#============#
111 # |(Constant)# 2.19| 2.36| .45| .93| .52#
112 # | v0 # 1.81| 1.05| .54| 1.72| .13#
113 # | v1 #-3.43| .33| .00|-10.33| .00#
115 #========#==========#=====#==========#====#======#============#
117 if [ $? -ne 0 ] ; then fail ; fi