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 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
113 activity="create program $i"
114 cat > $TEMPDIR/prog.sps <<EOF
115 DATA LIST LIST notable /X * F *.
130 /PERCENTILES = 0 25 50 75 100
133 if [ $? -ne 0 ] ; then no_result; fi
136 activity="run program $i"
137 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
138 if [ $? -ne 0 ] ; then no_result ; fi
140 activity="compare output $i"
141 diff -B -b $TEMPDIR/pspp.list - <<EOF
143 +-----------+--------+---------+--------+--------+--------+
144 | | | | | Valid | Cum |
145 |Value Label| Value |Frequency| Percent| Percent| Percent|
146 #===========#========#=========#========#========#========#
147 | | 1.00| 2| 20.0| 20.0| 20.0|
148 | | 2.00| 2| 20.0| 20.0| 40.0|
149 | | 3.00| 2| 20.0| 20.0| 60.0|
150 | | 4.00| 2| 20.0| 20.0| 80.0|
151 | | 5.00| 2| 20.0| 20.0| 100.0|
152 #===========#========#=========#========#========#========#
153 | Total| 10| 100.0| 100.0| |
154 +--------------------+---------+--------+--------+--------+
156 +-------------------+-----+
163 |Percentiles 0 |1.000|
168 +-------------------+-----+
170 if [ $? -ne 0 ] ; then fail ; fi
176 activity="create program $i"
177 cat > $TEMPDIR/prog.sps <<EOF
178 DATA LIST LIST notable /X * F *.
191 /PERCENTILES = 0 25 50 75 100
194 if [ $? -ne 0 ] ; then no_result; fi
197 activity="run program $i"
198 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
199 if [ $? -ne 0 ] ; then no_result ; fi
201 activity="compare output $i"
202 diff -B -b $TEMPDIR/pspp.list - <<EOF
204 +-----------+--------+---------+--------+--------+--------+
205 | | | | | Valid | Cum |
206 |Value Label| Value |Frequency| Percent| Percent| Percent|
207 #===========#========#=========#========#========#========#
208 | | 1.00| 1| 16.7| 16.7| 16.7|
209 | | 3.00| 2| 33.3| 33.3| 50.0|
210 | | 4.00| 1| 16.7| 16.7| 66.7|
211 | | 5.00| 2| 33.3| 33.3| 100.0|
212 #===========#========#=========#========#========#========#
213 | Total| 6| 100.0| 100.0| |
214 +--------------------+---------+--------+--------+--------+
216 +-------------------+-----+
223 |Percentiles 0 |1.000|
228 +-------------------+-----+
230 if [ $? -ne 0 ] ; then fail ; fi
234 activity="create program $i"
235 cat > $TEMPDIR/prog.sps <<EOF
236 DATA LIST LIST notable /X * F *.
246 MISSING VALUE x (99.0) .
251 /PERCENTILES = 0 25 50 75 100
254 if [ $? -ne 0 ] ; then no_result; fi
257 activity="run program $i"
258 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
259 if [ $? -ne 0 ] ; then no_result ; fi
261 activity="compare output $i"
262 diff -B -b $TEMPDIR/pspp.list - <<EOF
264 +-----------+--------+---------+--------+--------+--------+
265 | | | | | Valid | Cum |
266 |Value Label| Value |Frequency| Percent| Percent| Percent|
267 #===========#========#=========#========#========#========#
268 | | 1.00| 1| 10.0| 16.7| 16.7|
269 | | 3.00| 2| 20.0| 33.3| 50.0|
270 | | 4.00| 1| 10.0| 16.7| 66.7|
271 | | 5.00| 2| 20.0| 33.3| 100.0|
272 | | 99.00| 4| 40.0| Missing| |
273 #===========#========#=========#========#========#========#
274 | Total| 10| 100.0| 100.0| |
275 +--------------------+---------+--------+--------+--------+
277 +-------------------+-----+
284 |Percentiles 0 |1.000|
289 +-------------------+-----+
291 if [ $? -ne 0 ] ; then fail ; fi