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
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 +--------------------+---------+--------+--------+--------+
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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
142 diff -b $TEMPDIR/pspp.list - <<EOF
144 +-----------+--------+---------+--------+--------+--------+
145 | | | | | Valid | Cum |
146 |Value Label| Value |Frequency| Percent| Percent| Percent|
147 #===========#========#=========#========#========#========#
148 | | 1.00| 2| 20.0| 20.0| 20.0|
149 | | 2.00| 2| 20.0| 20.0| 40.0|
150 | | 3.00| 2| 20.0| 20.0| 60.0|
151 | | 4.00| 2| 20.0| 20.0| 80.0|
152 | | 5.00| 2| 20.0| 20.0| 100.0|
153 #===========#========#=========#========#========#========#
154 | Total| 10| 100.0| 100.0| |
155 +--------------------+---------+--------+--------+--------+
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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
203 diff -b $TEMPDIR/pspp.list - <<EOF
205 +-----------+--------+---------+--------+--------+--------+
206 | | | | | Valid | Cum |
207 |Value Label| Value |Frequency| Percent| Percent| Percent|
208 #===========#========#=========#========#========#========#
209 | | 1.00| 1| 16.7| 16.7| 16.7|
210 | | 3.00| 2| 33.3| 33.3| 50.0|
211 | | 4.00| 1| 16.7| 16.7| 66.7|
212 | | 5.00| 2| 33.3| 33.3| 100.0|
213 #===========#========#=========#========#========#========#
214 | Total| 6| 100.0| 100.0| |
215 +--------------------+---------+--------+--------+--------+
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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
263 diff -b $TEMPDIR/pspp.list - <<EOF
265 +-----------+--------+---------+--------+--------+--------+
266 | | | | | Valid | Cum |
267 |Value Label| Value |Frequency| Percent| Percent| Percent|
268 #===========#========#=========#========#========#========#
269 | | 1.00| 1| 10.0| 16.7| 16.7|
270 | | 3.00| 2| 20.0| 33.3| 50.0|
271 | | 4.00| 1| 10.0| 16.7| 66.7|
272 | | 5.00| 2| 20.0| 33.3| 100.0|
273 | | 99.00| 4| 40.0| Missing| |
274 #===========#========#=========#========#========#========#
275 | Total| 10| 100.0| 100.0| |
276 +--------------------+---------+--------+--------+--------+
277 +-------------------+-----+
284 |Percentiles 0 |1.000|
289 +-------------------+-----+
291 if [ $? -ne 0 ] ; then fail ; fi