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 -o pspp.csv $TESTFILE
95 if [ $? -ne 0 ] ; then no_result ; fi
97 activity="generate results"
98 cat > $TEMPDIR/results.csv <<EOF
100 ,,N,Mean Rank,Sum of Ranks
101 second - first,Negative Ranks,5,8.60,43.00
102 ,Positive Ranks,8,6.00,48.00
106 Table: Test Statistics
109 Asymp. Sig. (2-tailed),.86
110 Exact Sig. (2-tailed),.89
111 Exact Sig. (1-tailed),.45
113 if [ $? -ne 0 ] ; then no_result ; fi
116 activity="compare output 1"
117 diff -c pspp.csv $TEMPDIR/results.csv
118 if [ $? -ne 0 ] ; then fail ; fi
122 # No weights this time. But some missing values
123 activity="create program 2"
124 cat > $TESTFILE << EOF
125 data list notable list /foo * bar * dummy *.
145 variable labels foo "first" bar "second".
148 /wilcoxon=foo with bar (paired)
153 if [ $? -ne 0 ] ; then no_result ; fi
156 activity="run program 2"
157 $SUPERVISOR $PSPP -o pspp.csv $TESTFILE
158 if [ $? -ne 0 ] ; then no_result ; fi
160 activity="compare output 2"
161 diff pspp.csv $TEMPDIR/results.csv
162 if [ $? -ne 0 ] ; then fail ; fi