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