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$EXEEXT
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 -o pspp.csv $TESTFILE
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare output"
81 diff -c $TEMPDIR/pspp.csv - << EOF
82 Table: Reading free-form data from INLINE.
87 Table: Paired Sample Statistics
88 ,,Mean,N,Std. Deviation,S.E. Mean
89 Pair 0,A,4.333,3,5.774,3.333
92 Table: Paired Samples Correlations
94 Pair 0,A & B,3,1.000,.000
96 Table: Paired Samples Test
97 ,,Paired Differences,,,,,,,
98 ,,,,,95% Confidence Interval of the Difference,,,,
99 ,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
100 Pair 0,A - B,3.000,5.196,3.000,-9.908,15.908,1.000,2,.423
102 if [ $? -ne 0 ] ; then fail ; fi