3 # Tests calculation of percentiles with the
4 # COMPATIBLE algorithm set.
6 TEMPDIR=/tmp/pspp-tst-$$
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
55 activity="create program $i"
56 cat > $TEMPDIR/prog.sps <<EOF
57 DATA LIST LIST notable /X * .
69 /PERCENTILES = 0 25 50 75 100
72 if [ $? -ne 0 ] ; then no_result; fi
74 activity="run program $i"
75 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
76 if [ $? -ne 0 ] ; then no_result ; fi
78 activity="compare output $i"
79 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
80 diff -b $TEMPDIR/pspp.list - <<EOF
82 +-----------+--------+---------+--------+--------+--------+
83 | | | | | Valid | Cum |
84 |Value Label| Value |Frequency| Percent| Percent| Percent|
85 #===========#========#=========#========#========#========#
86 | | 1.00| 1| 20.0| 20.0| 20.0|
87 | | 2.00| 1| 20.0| 20.0| 40.0|
88 | | 3.00| 1| 20.0| 20.0| 60.0|
89 | | 4.00| 1| 20.0| 20.0| 80.0|
90 | | 5.00| 1| 20.0| 20.0| 100.0|
91 #===========#========#=========#========#========#========#
92 | Total| 5| 100.0| 100.0| |
93 +--------------------+---------+--------+--------+--------+
94 +-------------------+-----+
101 |Percentiles 0 |1.000|
106 +-------------------+-----+
108 if [ $? -ne 0 ] ; then fail ; fi