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
54 activity="create program $i"
55 cat > $TEMPDIR/prog.sps <<EOF
56 DATA LIST LIST notable /X * .
68 /PERCENTILES = 0 25 50 75 100
71 if [ $? -ne 0 ] ; then no_result; fi
73 activity="run program $i"
74 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
75 if [ $? -ne 0 ] ; then no_result ; fi
77 activity="compare output $i"
78 diff -B -b $TEMPDIR/pspp.list - <<EOF
80 +-----------+--------+---------+--------+--------+--------+
81 | | | | | Valid | Cum |
82 |Value Label| Value |Frequency| Percent| Percent| Percent|
83 #===========#========#=========#========#========#========#
84 | | 1.00| 1| 20.0| 20.0| 20.0|
85 | | 2.00| 1| 20.0| 20.0| 40.0|
86 | | 3.00| 1| 20.0| 20.0| 60.0|
87 | | 4.00| 1| 20.0| 20.0| 80.0|
88 | | 5.00| 1| 20.0| 20.0| 100.0|
89 #===========#========#=========#========#========#========#
90 | Total| 5| 100.0| 100.0| |
91 +--------------------+---------+--------+--------+--------+
93 +-------------------+-----+
100 |Percentiles 0 |1.000|
105 +-------------------+-----+
107 if [ $? -ne 0 ] ; then fail ; fi