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 export STAT_CONFIG_PATH=$top_srcdir/config
53 activity="create program $i"
54 cat > $TEMPDIR/prog.sps <<EOF
55 DATA LIST LIST notable /X * .
66 /PERCENTILES = 0 25 50 75 100
69 if [ $? -ne 0 ] ; then no_result; fi
71 activity="run program $i"
72 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="compare output $i"
76 diff -B -b $TEMPDIR/pspp.list - <<EOF
78 +-----------+--------+---------+--------+--------+--------+
79 | | | | | Valid | Cum |
80 |Value Label| Value |Frequency| Percent| Percent| Percent|
81 #===========#========#=========#========#========#========#
82 | | 1.00| 1| 20.0| 20.0| 20.0|
83 | | 2.00| 1| 20.0| 20.0| 40.0|
84 | | 3.00| 1| 20.0| 20.0| 60.0|
85 | | 4.00| 1| 20.0| 20.0| 80.0|
86 | | 5.00| 1| 20.0| 20.0| 100.0|
87 #===========#========#=========#========#========#========#
88 | Total| 5| 100.0| 100.0| |
89 +--------------------+---------+--------+--------+--------+
91 +-------------------+-----+
98 |Percentiles 0 |1.000|
103 +-------------------+-----+
105 if [ $? -ne 0 ] ; then fail ; fi
111 activity="create program $i"
112 cat > $TEMPDIR/prog.sps <<EOF
113 DATA LIST LIST notable /X * F *.
128 /PERCENTILES = 0 25 50 75 100
131 if [ $? -ne 0 ] ; then no_result; fi
134 activity="run program $i"
135 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
136 if [ $? -ne 0 ] ; then no_result ; fi
138 activity="compare output $i"
139 diff -B -b $TEMPDIR/pspp.list - <<EOF
141 +-----------+--------+---------+--------+--------+--------+
142 | | | | | Valid | Cum |
143 |Value Label| Value |Frequency| Percent| Percent| Percent|
144 #===========#========#=========#========#========#========#
145 | | 1.00| 2| 20.0| 20.0| 20.0|
146 | | 2.00| 2| 20.0| 20.0| 40.0|
147 | | 3.00| 2| 20.0| 20.0| 60.0|
148 | | 4.00| 2| 20.0| 20.0| 80.0|
149 | | 5.00| 2| 20.0| 20.0| 100.0|
150 #===========#========#=========#========#========#========#
151 | Total| 10| 100.0| 100.0| |
152 +--------------------+---------+--------+--------+--------+
154 +-------------------+-----+
161 |Percentiles 0 |1.000|
166 +-------------------+-----+
168 if [ $? -ne 0 ] ; then fail ; fi
174 activity="create program $i"
175 cat > $TEMPDIR/prog.sps <<EOF
176 DATA LIST LIST notable /X * F *.
189 /PERCENTILES = 0 25 50 75 100
192 if [ $? -ne 0 ] ; then no_result; fi
195 activity="run program $i"
196 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
197 if [ $? -ne 0 ] ; then no_result ; fi
199 activity="compare output $i"
200 diff -B -b $TEMPDIR/pspp.list - <<EOF
202 +-----------+--------+---------+--------+--------+--------+
203 | | | | | Valid | Cum |
204 |Value Label| Value |Frequency| Percent| Percent| Percent|
205 #===========#========#=========#========#========#========#
206 | | 1.00| 1| 16.7| 16.7| 16.7|
207 | | 3.00| 2| 33.3| 33.3| 50.0|
208 | | 4.00| 1| 16.7| 16.7| 66.7|
209 | | 5.00| 2| 33.3| 33.3| 100.0|
210 #===========#========#=========#========#========#========#
211 | Total| 6| 100.0| 100.0| |
212 +--------------------+---------+--------+--------+--------+
214 +-------------------+-----+
221 |Percentiles 0 |1.000|
226 +-------------------+-----+
228 if [ $? -ne 0 ] ; then fail ; fi
232 activity="create program $i"
233 cat > $TEMPDIR/prog.sps <<EOF
234 DATA LIST LIST notable /X * F *.
244 MISSING VALUE x (99.0) .
249 /PERCENTILES = 0 25 50 75 100
252 if [ $? -ne 0 ] ; then no_result; fi
255 activity="run program $i"
256 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
257 if [ $? -ne 0 ] ; then no_result ; fi
259 activity="compare output $i"
260 diff -B -b $TEMPDIR/pspp.list - <<EOF
262 +-----------+--------+---------+--------+--------+--------+
263 | | | | | Valid | Cum |
264 |Value Label| Value |Frequency| Percent| Percent| Percent|
265 #===========#========#=========#========#========#========#
266 | | 1.00| 1| 10.0| 16.7| 16.7|
267 | | 3.00| 2| 20.0| 33.3| 50.0|
268 | | 4.00| 1| 10.0| 16.7| 66.7|
269 | | 5.00| 2| 20.0| 33.3| 100.0|
270 | | 99.00| 4| 40.0| Missing| |
271 #===========#========#=========#========#========#========#
272 | Total| 10| 100.0| 100.0| |
273 +--------------------+---------+--------+--------+--------+
275 +-------------------+-----+
282 |Percentiles 0 |1.000|
287 +-------------------+-----+
289 if [ $? -ne 0 ] ; then fail ; fi