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 /save=pred resid.
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="run program"
81 $SUPERVISOR $PSPP --testing-mode $TESTFILE
82 if [ $? -ne 0 ] ; then no_result ; fi
84 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
85 diff -b $TEMPDIR/pspp.list - << EOF
86 1.1 DATA LIST. Reading free-form data from INLINE.
94 2.1 REGRESSION. Model Summary
95 #============#========#=================#==========================#
96 # R #R Square|Adjusted R Square|Std. Error of the Estimate#
97 #========#===#========#=================#==========================#
98 # |.97# .94| .93| 1.34#
99 #========#===#========#=================#==========================#
100 2.2 REGRESSION. ANOVA
101 #===================#==============#==#===========#=====#============#
102 # #Sum of Squares|df|Mean Square| F |Significance#
103 #========#==========#==============#==#===========#=====#============#
104 # |Regression# 202.75| 2| 101.38|56.75| .00#
105 # |Residual # 12.50| 7| 1.79| | #
106 # |Total # 215.26| 9| | | #
107 #========#==========#==============#==#===========#=====#============#
108 2.3 REGRESSION. Coefficients
109 #===================#=====#==========#=====#======#============#
110 # # B |Std. Error| Beta| t |Significance#
111 #========#==========#=====#==========#=====#======#============#
112 # |(Constant)# 2.19| 2.36| .00| .93| .52#
113 # | v0 # 1.81| 1.05| .17| 1.72| .12#
114 # | v1 #-3.43| .33|-1.03|-10.33| .00#
116 #========#==========#=====#==========#=====#======#============#
118 -------- -------- -------- -------- --------
119 .65 7.74 -23.98 -.84 -23.13
120 -.13 6.14 -19.64 -.54 -19.10
121 .35 7.65 -25.27 -1.87 -23.40
122 .69 6.13 -16.57 .97 -17.54
123 -.07 8.25 -25.80 .40 -26.20
124 -.34 6.03 -17.57 1.53 -19.10
125 .76 9.83 -28.36 1.77 -30.13
126 -.47 5.34 -16.80 .18 -16.97
127 -.06 8.84 -29.26 -1.05 -28.21
128 .56 6.20 -18.58 -.54 -18.04
130 if [ $? -ne 0 ] ; then fail ; fi