3 # This program tests that the T-TEST /PAIRS command works OK
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 /ID * 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 $TESTFILE
77 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="compare output"
80 diff -c $TEMPDIR/pspp.csv - <<EOF
81 Table: Reading free-form data from INLINE.
87 Table: Paired Sample Statistics
88 ,,Mean,N,Std. Deviation,S.E. Mean
89 Pair 0,A,2.00,5,.71,.32
92 Table: Paired Samples Correlations
94 Pair 0,A & B,5,.92,.03
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,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
102 if [ $? -ne 0 ] ; then fail ; fi