3 # This program tests for a bug in the paired samples T test.
4 # Thanks to Mike Griffiths for reporting this problem.
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
9 # ensure that top_srcdir and top_builddir are absolute
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 top_srcdir=`cd $top_srcdir; pwd`
13 top_builddir=`cd $top_builddir; pwd`
15 PSPP=$top_builddir/src/ui/terminal/pspp
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
26 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
27 echo "NOT cleaning $TEMPDIR"
61 cat >> $TESTFILE <<EOF
63 data list list /A * B *.
70 t-test pairs = a with b (paired).
72 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="run program"
76 $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare output"
81 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
82 diff -b $TEMPDIR/pspp.list - << EOF
83 1.1 DATA LIST. Reading free-form data from INLINE.
90 2.1 T-TEST. Paired Sample Statistics
91 #========#=====#=#==============#========#
92 # # Mean|N|Std. Deviation|SE. Mean#
93 #========#=====#=#==============#========#
94 #Pair 0 A#4.333|3| 5.774| 3.333#
95 # B#1.333|3| .577| .333#
96 #========#=====#=#==============#========#
97 2.2 T-TEST. Paired Samples Correlations
98 #======#=====#=#===========#====#
99 # | #N|Correlation|Sig.#
100 #======#=====#=#===========#====#
101 #Pair 0|A & B#3| 1.000|.000#
102 #======#=====#=#===========#====#
103 2.3 T-TEST. Paired Samples Test
104 #===========#==================================================#=====#==#===============#
105 # # Paired Differences | | | #
106 # #-----+--------------+---------------+-------------+ | | #
107 # # | | | 95% | | | #
108 # # | | +------+------+ | | #
109 # # Mean|Std. Deviation|Std. Error Mean| Lower| Upper| t |df|Sig. (2-tailed)#
110 #===========#=====#==============#===============#======#======#=====#==#===============#
111 #Pair 0A - B#3.000| 5.196| 3.000|-9.908|15.908|1.000| 2| .423#
112 #===========#=====#==============#===============#======#======#=====#==#===============#
114 if [ $? -ne 0 ] ; then fail ; fi