+++ /dev/null
-#!/bin/sh
-
-# This program tests the BINOMIAL subcommand of the NPAR TESTS command.
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_srcdir and top_builddir are absolute
-if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
-if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
-top_srcdir=`cd $top_srcdir; pwd`
-top_builddir=`cd $top_builddir; pwd`
-
-PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
-
-STAT_CONFIG_PATH=$top_srcdir/config
-export STAT_CONFIG_PATH
-
-LANG=C
-export LANG
-
-
-cleanup()
-{
- if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
- echo "NOT cleaning $TEMPDIR"
- return ;
- fi
- cd /
- rm -rf $TEMPDIR
-}
-
-
-fail()
-{
- echo $activity
- echo FAILED
- cleanup;
- exit 1;
-}
-
-
-no_result()
-{
- echo $activity
- echo NO RESULT;
- cleanup;
- exit 2;
-}
-
-pass()
-{
- cleanup;
- exit 0;
-}
-
-mkdir -p $TEMPDIR
-
-cd $TEMPDIR
-
-
-# Tests for exact calculations
-activity="create file 1"
-cat <<EOF > $TESTFILE
-ECHO 'P < 0.5; N1/N2 < 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x * w *.
-BEGIN DATA.
-1 6
-2 15
-END DATA.
-
-WEIGHT BY w.
-
-SET FORMAT F8.3.
-
-NPAR TESTS
- /BINOMIAL(0.3) = x
- .
-
-
-ECHO 'P < 0.5; N1/N2 > 1' .
-
-NEW FILE.
-
-
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 7
-2 6
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.4) = x
- .
-
-
-
-ECHO 'P < 0.5; N1/N2 = 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 8
-2 8
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.4) = x
- .
-
-ECHO 'P > 0.5; N1/N2 < 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 11
-2 12
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.6) = x
- .
-
-
-ECHO 'P > 0.5; N1/N2 > 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 11
-2 9
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.6) = x
-
-ECHO 'P > 0.5; N1/N2 == 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 11
-2 11
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.6) = x
- .
-
-ECHO 'P == 0.5; N1/N2 < 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 8
-2 15
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL = x
- .
-
-
-ECHO 'P == 0.5; N1/N2 > 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 12
-2 6
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.5) = x
-
-ECHO 'P == 0.5; N1/N2 == 1' .
-
-NEW FILE.
-
-DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
-BEGIN DATA.
-1 10
-2 10
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.5) = x
- .
-
-ECHO 'P == 0.5; N1/N2 == 1 Cutpoint' .
-
-DATA LIST LIST NOTABLE /x * w *.
-BEGIN DATA.
-9 3
-10 7
-11 16
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.5) = x (10)
- .
-
-ECHO 'P == 0.5; N1/N2 == 1 Named values' .
-
-DATA LIST LIST NOTABLE /x * w *.
-BEGIN DATA.
-10 10
-15 45
-20 13
-END DATA.
-
-WEIGHT BY w.
-
-NPAR TESTS
- /BINOMIAL(0.5) = x (10, 20)
- .
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="run program 1"
-$SUPERVISOR $PSPP -o pspp.csv $TESTFILE
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="compare output 1"
-diff -c $TEMPDIR/pspp.csv - << EOF
-P < 0.5; N1/N2 < 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1.00,6.00,.286,.300,.551
-,Group2,2.00,15.00,.714,,
-,Total,,21.00,1.000,,
-
-P < 0.5; N1/N2 > 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1,7,.538,.400,.229
-,Group2,2,6,.462,,
-,Total,,13,1.000,,
-
-P < 0.5; N1/N2 = 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1,8,.500,.400,.284
-,Group2,2,8,.500,,
-,Total,,16,1.000,,
-
-P > 0.5; N1/N2 < 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1,11,.478,.600,.164
-,Group2,2,12,.522,,
-,Total,,23,1.000,,
-
-P > 0.5; N1/N2 > 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1,11,.550,.600,.404
-,Group2,2,9,.450,,
-,Total,,20,1.000,,
-
-P > 0.5; N1/N2 == 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
-x,Group1,1,11,.500,.600,.228
-,Group2,2,11,.500,,
-,Total,,22,1.000,,
-
-P == 0.5; N1/N2 < 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
-x,Group1,1,8,.348,.500,.210
-,Group2,2,15,.652,,
-,Total,,23,1.000,,
-
-P == 0.5; N1/N2 > 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
-x,Group1,1,12,.667,.500,.238
-,Group2,2,6,.333,,
-,Total,,18,1.000,,
-
-P == 0.5; N1/N2 == 1
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
-x,Group1,1,10,.500,.500,1.000
-,Group2,2,10,.500,,
-,Total,,20,1.000,,
-
-P == 0.5; N1/N2 == 1 Cutpoint
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
-x,Group1,<= 10,10.000,.385,.500,.327
-,Group2,,16.000,.615,,
-,Total,,26.000,1.000,,
-
-P == 0.5; N1/N2 == 1 Named values
-
-Table: Binomial Test
-,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
-x,Group1,10.000,10.000,.435,.500,.678
-,Group2,20.000,13.000,.565,,
-,Total,,23.000,1.000,,
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
--- /dev/null
+AT_BANNER([NPAR TESTS])
+
+AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 < 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x * w *.
+BEGIN DATA.
+1 6
+2 15
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.3) = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1.000,6.000,.286,.300,.551
+,Group2,2.000,15.000,.714,,
+,Total,,21.000,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 > 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 7
+2 6
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.4) = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1,7,.538,.400,.229
+,Group2,2,6,.462,,
+,Total,,13,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P < 0.5; N1/N2 = 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 8
+2 8
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.4) = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1,8,.500,.400,.284
+,Group2,2,8,.500,,
+,Total,,16,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 < 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 11
+2 12
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.6) = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1,11,.478,.600,.164
+,Group2,2,12,.522,,
+,Total,,23,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 > 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 11
+2 9
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.6) = x.
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1,11,.550,.600,.404
+,Group2,2,9,.450,,
+,Total,,20,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P > 0.5; N1/N2 = 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 11
+2 11
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.6) = x.
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (1-tailed)
+x,Group1,1,11,.500,.600,.228
+,Group2,2,11,.500,,
+,Total,,22,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 < 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 8
+2 15
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
+x,Group1,1,8,.348,.500,.210
+,Group2,2,15,.652,,
+,Total,,23,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 > 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 12
+2 6
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.5) = x.
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
+x,Group1,1,12,.667,.500,.238
+,Group2,2,6,.333,,
+,Total,,18,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
+BEGIN DATA.
+1 10
+2 10
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.5) = x
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
+x,Group1,1,10,.500,.500,1.000
+,Group2,2,10,.500,,
+,Total,,20,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1 Cutpoint])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x * w *.
+BEGIN DATA.
+9 3
+10 7
+11 16
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.5) = x (10)
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
+x,Group1,<= 10,10.000,.385,.500,.327
+,Group2,,16.000,.615,,
+,Total,,26.000,1.000,,
+])
+AT_CLEANUP
+
+AT_SETUP([NPAR TESTS BINOMIAL, P = 0.5; N1/N2 = 1 Named values])
+AT_DATA([npar.sps], [dnl
+SET FORMAT F8.3.
+
+DATA LIST LIST NOTABLE /x * w *.
+BEGIN DATA.
+10 10
+15 45
+20 13
+END DATA.
+
+WEIGHT BY w.
+
+NPAR TESTS
+ /BINOMIAL(0.5) = x (10, 20)
+ .
+])
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Binomial Test
+,,Category,N,Observed Prop.,Test Prop.,Exact Sig. (2-tailed)
+x,Group1,10.000,10.000,.435,.500,.678
+,Group2,20.000,13.000,.565,,
+,Total,,23.000,1.000,,
+])
+AT_CLEANUP
+