3 # This program tests the wilcoxon subcommand of npar tests
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_srcdir and top_builddir are absolute
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
11 top_srcdir=`cd $top_srcdir; pwd`
12 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
60 activity="create program 1"
61 cat > $TESTFILE << EOF
62 data list notable list /foo * bar * w (f8.0).
80 variable labels foo "first" bar "second".
85 /wilcoxon=foo with bar (paired)
90 if [ $? -ne 0 ] ; then no_result ; fi
93 activity="run program 1"
94 $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
95 if [ $? -ne 0 ] ; then no_result ; fi
97 activity="generate results"
98 cat > $TEMPDIR/results.txt <<EOF
100 #============================#==#=========#============#
101 # # N|Mean Rank|Sum of Ranks#
102 #============================#==#=========#============#
103 #second - firstNegative Ranks# 5| 8.60| 43.00#
104 # Positive Ranks# 8| 6.00| 48.00#
107 #============================#==#=========#============#
109 1.2 NPAR TESTS. Test Statistics
110 #=====================#==============#
112 #=====================#==============#
114 #Asymp. Sig (2-tailed)# .86#
115 #Exact Sig (2-tailed) # .89#
116 #Exact Sig (1-tailed) # .45#
117 #=====================#==============#
120 if [ $? -ne 0 ] ; then no_result ; fi
123 activity="compare output 1"
124 diff pspp.list $TEMPDIR/results.txt
125 if [ $? -ne 0 ] ; then fail ; fi
129 # No weights this time. But some missing values
130 activity="create program 2"
131 cat > $TESTFILE << EOF
132 data list notable list /foo * bar * dummy *.
152 variable labels foo "first" bar "second".
155 /wilcoxon=foo with bar (paired)
160 if [ $? -ne 0 ] ; then no_result ; fi
163 activity="run program 2"
164 $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
165 if [ $? -ne 0 ] ; then no_result ; fi
167 activity="compare output 2"
168 diff pspp.list $TEMPDIR/results.txt
169 if [ $? -ne 0 ] ; then fail ; fi