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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
81 diff -b $TEMPDIR/pspp.list - <<EOF
82 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#2.00|5| .707| .316#
95 # B#4.00|5| 1.541| .689#
96 #========#====#=#==============#========#
97 2.2 T-TEST. Paired Samples Correlations
98 #======#=====#=#===========#====#
99 # | #N|Correlation|Sig.#
100 #======#=====#=#===========#====#
101 #Pair 0|A & B#5| .918|.028#
102 #======#=====#=#===========#====#
103 2.3 T-TEST. Paired Samples Test
104 #===========#=====================================================#======#==#===============#
105 # # Paired Differences | | | #
106 # #-------+--------------+---------------+--------------+ | | #
107 # # | | |95% Confidence| | | #
108 # # | | +-------+------+ | | #
109 # # Mean |Std. Deviation|Std. Error Mean| Lower | Upper| t |df|Sig. (2-tailed)#
110 #===========#=======#==============#===============#=======#======#======#==#===============#
111 #Pair 0A - B#-2.0000| .93541| .41833|-3.1615|-.8385|-4.781| 4| .009#
112 #===========#=======#==============#===============#=======#======#======#==#===============#
114 if [ $? -ne 0 ] ; then fail ; fi