3 # Tests calculation of percentiles with the
4 # ENHANCED algorithm set.
6 TEMPDIR=/tmp/pspp-tst-$$
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
58 activity="create program $i"
59 cat > $TEMPDIR/prog.sps <<EOF
60 DATA LIST LIST notable /X * .
71 /PERCENTILES = 0 25 50 75 100
74 if [ $? -ne 0 ] ; then no_result; fi
76 activity="run program $i"
77 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TEMPDIR/prog.sps
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare output $i"
81 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
82 diff -b $TEMPDIR/pspp.list - <<EOF
84 +-----------+--------+---------+--------+--------+--------+
85 | | | | | Valid | Cum |
86 |Value Label| Value |Frequency| Percent| Percent| Percent|
87 #===========#========#=========#========#========#========#
88 | | 1.00| 1| 20.0| 20.0| 20.0|
89 | | 2.00| 1| 20.0| 20.0| 40.0|
90 | | 3.00| 1| 20.0| 20.0| 60.0|
91 | | 4.00| 1| 20.0| 20.0| 80.0|
92 | | 5.00| 1| 20.0| 20.0| 100.0|
93 #===========#========#=========#========#========#========#
94 | Total| 5| 100.0| 100.0| |
95 +--------------------+---------+--------+--------+--------+
96 +-------------------+-----+
103 |Percentiles 0 |1.000|
108 +-------------------+-----+
110 if [ $? -ne 0 ] ; then fail ; fi
116 activity="create program $i"
117 cat > $TEMPDIR/prog.sps <<EOF
118 DATA LIST LIST notable /X * F *.
133 /PERCENTILES = 0 25 50 75 100
136 if [ $? -ne 0 ] ; then no_result; fi
139 activity="run program $i"
140 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TEMPDIR/prog.sps
141 if [ $? -ne 0 ] ; then no_result ; fi
143 activity="compare output $i"
144 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
145 diff -b $TEMPDIR/pspp.list - <<EOF
147 +-----------+--------+---------+--------+--------+--------+
148 | | | | | Valid | Cum |
149 |Value Label| Value |Frequency| Percent| Percent| Percent|
150 #===========#========#=========#========#========#========#
151 | | 1.00| 2| 20.0| 20.0| 20.0|
152 | | 2.00| 2| 20.0| 20.0| 40.0|
153 | | 3.00| 2| 20.0| 20.0| 60.0|
154 | | 4.00| 2| 20.0| 20.0| 80.0|
155 | | 5.00| 2| 20.0| 20.0| 100.0|
156 #===========#========#=========#========#========#========#
157 | Total| 10| 100.0| 100.0| |
158 +--------------------+---------+--------+--------+--------+
159 +-------------------+-----+
166 |Percentiles 0 |1.000|
171 +-------------------+-----+
173 if [ $? -ne 0 ] ; then fail ; fi
179 activity="create program $i"
180 cat > $TEMPDIR/prog.sps <<EOF
181 DATA LIST LIST notable /X * F *.
194 /PERCENTILES = 0 25 50 75 100
197 if [ $? -ne 0 ] ; then no_result; fi
200 activity="run program $i"
201 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TEMPDIR/prog.sps
202 if [ $? -ne 0 ] ; then no_result ; fi
204 activity="compare output $i"
205 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
206 diff -b $TEMPDIR/pspp.list - <<EOF
208 +-----------+--------+---------+--------+--------+--------+
209 | | | | | Valid | Cum |
210 |Value Label| Value |Frequency| Percent| Percent| Percent|
211 #===========#========#=========#========#========#========#
212 | | 1.00| 1| 16.7| 16.7| 16.7|
213 | | 3.00| 2| 33.3| 33.3| 50.0|
214 | | 4.00| 1| 16.7| 16.7| 66.7|
215 | | 5.00| 2| 33.3| 33.3| 100.0|
216 #===========#========#=========#========#========#========#
217 | Total| 6| 100.0| 100.0| |
218 +--------------------+---------+--------+--------+--------+
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 $top_builddir/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
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 +--------------------+---------+--------+--------+--------+
280 +-------------------+-----+
287 |Percentiles 0 |1.000|
292 +-------------------+-----+
294 if [ $? -ne 0 ] ; then fail ; fi