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
55 activity="create program $i"
56 cat > $TEMPDIR/prog.sps <<EOF
57 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 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
79 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
81 +-----------+--------+---------+--------+--------+--------+
82 | | | | | Valid | Cum |
83 |Value Label| Value |Frequency| Percent| Percent| Percent|
84 #===========#========#=========#========#========#========#
85 | | 1.00| 1| 20.0| 20.0| 20.0|
86 | | 2.00| 1| 20.0| 20.0| 40.0|
87 | | 3.00| 1| 20.0| 20.0| 60.0|
88 | | 4.00| 1| 20.0| 20.0| 80.0|
89 | | 5.00| 1| 20.0| 20.0| 100.0|
90 #===========#========#=========#========#========#========#
91 | Total| 5| 100.0| 100.0| |
92 +--------------------+---------+--------+--------+--------+
94 +-------------------+-----+
101 |Percentiles 0 |1.000|
106 +-------------------+-----+
108 if [ $? -ne 0 ] ; then fail ; fi
114 activity="create program $i"
115 cat > $TEMPDIR/prog.sps <<EOF
116 DATA LIST LIST notable /X * F *.
131 /PERCENTILES = 0 25 50 75 100
134 if [ $? -ne 0 ] ; then no_result; fi
137 activity="run program $i"
138 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
139 if [ $? -ne 0 ] ; then no_result ; fi
141 activity="compare output $i"
142 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
143 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
145 +-----------+--------+---------+--------+--------+--------+
146 | | | | | Valid | Cum |
147 |Value Label| Value |Frequency| Percent| Percent| Percent|
148 #===========#========#=========#========#========#========#
149 | | 1.00| 2| 20.0| 20.0| 20.0|
150 | | 2.00| 2| 20.0| 20.0| 40.0|
151 | | 3.00| 2| 20.0| 20.0| 60.0|
152 | | 4.00| 2| 20.0| 20.0| 80.0|
153 | | 5.00| 2| 20.0| 20.0| 100.0|
154 #===========#========#=========#========#========#========#
155 | Total| 10| 100.0| 100.0| |
156 +--------------------+---------+--------+--------+--------+
158 +-------------------+-----+
165 |Percentiles 0 |1.000|
170 +-------------------+-----+
172 if [ $? -ne 0 ] ; then fail ; fi
178 activity="create program $i"
179 cat > $TEMPDIR/prog.sps <<EOF
180 DATA LIST LIST notable /X * F *.
193 /PERCENTILES = 0 25 50 75 100
196 if [ $? -ne 0 ] ; then no_result; fi
199 activity="run program $i"
200 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
201 if [ $? -ne 0 ] ; then no_result ; fi
203 activity="compare output $i"
204 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
205 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
207 +-----------+--------+---------+--------+--------+--------+
208 | | | | | Valid | Cum |
209 |Value Label| Value |Frequency| Percent| Percent| Percent|
210 #===========#========#=========#========#========#========#
211 | | 1.00| 1| 16.7| 16.7| 16.7|
212 | | 3.00| 2| 33.3| 33.3| 50.0|
213 | | 4.00| 1| 16.7| 16.7| 66.7|
214 | | 5.00| 2| 33.3| 33.3| 100.0|
215 #===========#========#=========#========#========#========#
216 | Total| 6| 100.0| 100.0| |
217 +--------------------+---------+--------+--------+--------+
219 +-------------------+-----+
226 |Percentiles 0 |1.000|
231 +-------------------+-----+
233 if [ $? -ne 0 ] ; then fail ; fi
237 activity="create program $i"
238 cat > $TEMPDIR/prog.sps <<EOF
239 DATA LIST LIST notable /X * F *.
249 MISSING VALUE x (99.0) .
254 /PERCENTILES = 0 25 50 75 100
257 if [ $? -ne 0 ] ; then no_result; fi
260 activity="run program $i"
261 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
262 if [ $? -ne 0 ] ; then no_result ; fi
264 activity="compare output $i"
265 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
266 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
268 +-----------+--------+---------+--------+--------+--------+
269 | | | | | Valid | Cum |
270 |Value Label| Value |Frequency| Percent| Percent| Percent|
271 #===========#========#=========#========#========#========#
272 | | 1.00| 1| 10.0| 16.7| 16.7|
273 | | 3.00| 2| 20.0| 33.3| 50.0|
274 | | 4.00| 1| 10.0| 16.7| 66.7|
275 | | 5.00| 2| 20.0| 33.3| 100.0|
276 | | 99.00| 4| 40.0| Missing| |
277 #===========#========#=========#========#========#========#
278 | Total| 10| 100.0| 100.0| |
279 +--------------------+---------+--------+--------+--------+
281 +-------------------+-----+
288 |Percentiles 0 |1.000|
293 +-------------------+-----+
295 if [ $? -ne 0 ] ; then fail ; fi