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
55 activity="create program"
57 data list list /ID * A * B *.
66 t-test /PAIRS a with b (PAIRED).
68 if [ $? -ne 0 ] ; then no_result ; fi
71 activity="run program"
72 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="compare output"
76 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
77 diff -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading free-form data from INLINE.
86 2.1 T-TEST. Paired Sample Statistics
87 #========#====#=#==============#========#
88 # #Mean|N|Std. Deviation|SE. Mean#
89 #========#====#=#==============#========#
90 #Pair 0 A#2.00|5| .707| .316#
91 # B#4.00|5| 1.541| .689#
92 #========#====#=#==============#========#
93 2.2 T-TEST. Paired Samples Correlations
94 #======#=====#=#===========#====#
95 # | #N|Correlation|Sig.#
96 #======#=====#=#===========#====#
97 #Pair 0|A & B#5| .918|.028#
98 #======#=====#=#===========#====#
99 2.3 T-TEST. Paired Samples Test
100 #===========#=====================================================#======#==#===============#
101 # # Paired Differences | | | #
102 # #-------+--------------+---------------+--------------+ | | #
103 # # | | |95% Confidence| | | #
104 # # | | +-------+------+ | | #
105 # # Mean |Std. Deviation|Std. Error Mean| Lower | Upper| t |df|Sig. (2-tailed)#
106 #===========#=======#==============#===============#=======#======#======#==#===============#
107 #Pair 0A - B#-2.0000| .93541| .41833|-3.1615|-.8385|-4.781| 4| .009#
108 #===========#=======#==============#===============#=======#======#======#==#===============#
110 if [ $? -ne 0 ] ; then fail ; fi