3 # Tests calculation of percentiles with the
4 # ENHANCED 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 * .
67 /PERCENTILES = 0 25 50 75 100
70 if [ $? -ne 0 ] ; then no_result; fi
72 activity="run program $i"
73 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
74 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="compare output $i"
77 diff -B -b $TEMPDIR/pspp.list - <<EOF
79 +-----------+--------+---------+--------+--------+--------+
80 | | | | | Valid | Cum |
81 |Value Label| Value |Frequency| Percent| Percent| Percent|
82 #===========#========#=========#========#========#========#
83 | | 1.00| 1| 20.0| 20.0| 20.0|
84 | | 2.00| 1| 20.0| 20.0| 40.0|
85 | | 3.00| 1| 20.0| 20.0| 60.0|
86 | | 4.00| 1| 20.0| 20.0| 80.0|
87 | | 5.00| 1| 20.0| 20.0| 100.0|
88 #===========#========#=========#========#========#========#
89 | Total| 5| 100.0| 100.0| |
90 +--------------------+---------+--------+--------+--------+
92 +-------------------+-----+
99 |Percentiles 0 |1.000|
104 +-------------------+-----+
106 if [ $? -ne 0 ] ; then fail ; fi
112 activity="create program $i"
113 cat > $TEMPDIR/prog.sps <<EOF
114 DATA LIST LIST notable /X * F *.
129 /PERCENTILES = 0 25 50 75 100
132 if [ $? -ne 0 ] ; then no_result; fi
135 activity="run program $i"
136 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
137 if [ $? -ne 0 ] ; then no_result ; fi
139 activity="compare output $i"
140 diff -B -b $TEMPDIR/pspp.list - <<EOF
142 +-----------+--------+---------+--------+--------+--------+
143 | | | | | Valid | Cum |
144 |Value Label| Value |Frequency| Percent| Percent| Percent|
145 #===========#========#=========#========#========#========#
146 | | 1.00| 2| 20.0| 20.0| 20.0|
147 | | 2.00| 2| 20.0| 20.0| 40.0|
148 | | 3.00| 2| 20.0| 20.0| 60.0|
149 | | 4.00| 2| 20.0| 20.0| 80.0|
150 | | 5.00| 2| 20.0| 20.0| 100.0|
151 #===========#========#=========#========#========#========#
152 | Total| 10| 100.0| 100.0| |
153 +--------------------+---------+--------+--------+--------+
155 +-------------------+-----+
162 |Percentiles 0 |1.000|
167 +-------------------+-----+
169 if [ $? -ne 0 ] ; then fail ; fi
175 activity="create program $i"
176 cat > $TEMPDIR/prog.sps <<EOF
177 DATA LIST LIST notable /X * F *.
190 /PERCENTILES = 0 25 50 75 100
193 if [ $? -ne 0 ] ; then no_result; fi
196 activity="run program $i"
197 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
198 if [ $? -ne 0 ] ; then no_result ; fi
200 activity="compare output $i"
201 diff -B -b $TEMPDIR/pspp.list - <<EOF
203 +-----------+--------+---------+--------+--------+--------+
204 | | | | | Valid | Cum |
205 |Value Label| Value |Frequency| Percent| Percent| Percent|
206 #===========#========#=========#========#========#========#
207 | | 1.00| 1| 16.7| 16.7| 16.7|
208 | | 3.00| 2| 33.3| 33.3| 50.0|
209 | | 4.00| 1| 16.7| 16.7| 66.7|
210 | | 5.00| 2| 33.3| 33.3| 100.0|
211 #===========#========#=========#========#========#========#
212 | Total| 6| 100.0| 100.0| |
213 +--------------------+---------+--------+--------+--------+
215 +-------------------+-----+
222 |Percentiles 0 |1.000|
227 +-------------------+-----+
229 if [ $? -ne 0 ] ; then fail ; fi
233 activity="create program $i"
234 cat > $TEMPDIR/prog.sps <<EOF
235 DATA LIST LIST notable /X * F *.
245 MISSING VALUE x (99.0) .
250 /PERCENTILES = 0 25 50 75 100
253 if [ $? -ne 0 ] ; then no_result; fi
256 activity="run program $i"
257 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
258 if [ $? -ne 0 ] ; then no_result ; fi
260 activity="compare output $i"
261 diff -B -b $TEMPDIR/pspp.list - <<EOF
263 +-----------+--------+---------+--------+--------+--------+
264 | | | | | Valid | Cum |
265 |Value Label| Value |Frequency| Percent| Percent| Percent|
266 #===========#========#=========#========#========#========#
267 | | 1.00| 1| 10.0| 16.7| 16.7|
268 | | 3.00| 2| 20.0| 33.3| 50.0|
269 | | 4.00| 1| 10.0| 16.7| 66.7|
270 | | 5.00| 2| 20.0| 33.3| 100.0|
271 | | 99.00| 4| 40.0| Missing| |
272 #===========#========#=========#========#========#========#
273 | Total| 10| 100.0| 100.0| |
274 +--------------------+---------+--------+--------+--------+
276 +-------------------+-----+
283 |Percentiles 0 |1.000|
288 +-------------------+-----+
290 if [ $? -ne 0 ] ; then fail ; fi