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`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
62 activity="create program $i"
63 cat > $TEMPDIR/prog.sps <<EOF
64 DATA LIST LIST notable /X * .
75 /PERCENTILES = 0 25 50 75 100
78 if [ $? -ne 0 ] ; then no_result; fi
80 activity="run program $i"
81 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
82 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare output $i"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
86 diff -b $TEMPDIR/pspp.list - <<EOF
88 +-----------+--------+---------+--------+--------+--------+
89 | | | | | Valid | Cum |
90 |Value Label| Value |Frequency| Percent| Percent| Percent|
91 #===========#========#=========#========#========#========#
92 | | 1.00| 1| 20.0| 20.0| 20.0|
93 | | 2.00| 1| 20.0| 20.0| 40.0|
94 | | 3.00| 1| 20.0| 20.0| 60.0|
95 | | 4.00| 1| 20.0| 20.0| 80.0|
96 | | 5.00| 1| 20.0| 20.0| 100.0|
97 #===========#========#=========#========#========#========#
98 | Total| 5| 100.0| 100.0| |
99 +--------------------+---------+--------+--------+--------+
100 +-----------------------+-----+
107 |Percentiles 0 |1.000|
112 +-----------------------+-----+
114 if [ $? -ne 0 ] ; then fail ; fi
120 activity="create program $i"
121 cat > $TEMPDIR/prog.sps <<EOF
122 DATA LIST LIST notable /X * F *.
137 /PERCENTILES = 0 25 50 75 100
140 if [ $? -ne 0 ] ; then no_result; fi
143 activity="run program $i"
144 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
145 if [ $? -ne 0 ] ; then no_result ; fi
147 activity="compare output $i"
148 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
149 diff -b $TEMPDIR/pspp.list - <<EOF
151 +-----------+--------+---------+--------+--------+--------+
152 | | | | | Valid | Cum |
153 |Value Label| Value |Frequency| Percent| Percent| Percent|
154 #===========#========#=========#========#========#========#
155 | | 1.00| 2| 20.0| 20.0| 20.0|
156 | | 2.00| 2| 20.0| 20.0| 40.0|
157 | | 3.00| 2| 20.0| 20.0| 60.0|
158 | | 4.00| 2| 20.0| 20.0| 80.0|
159 | | 5.00| 2| 20.0| 20.0| 100.0|
160 #===========#========#=========#========#========#========#
161 | Total| 10| 100.0| 100.0| |
162 +--------------------+---------+--------+--------+--------+
163 +-----------------------+-----+
170 |Percentiles 0 |1.000|
175 +-----------------------+-----+
177 if [ $? -ne 0 ] ; then fail ; fi
183 activity="create program $i"
184 cat > $TEMPDIR/prog.sps <<EOF
185 DATA LIST LIST notable /X * F *.
198 /PERCENTILES = 0 25 50 75 100
201 if [ $? -ne 0 ] ; then no_result; fi
204 activity="run program $i"
205 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
206 if [ $? -ne 0 ] ; then no_result ; fi
208 activity="compare output $i"
209 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
210 diff -b $TEMPDIR/pspp.list - <<EOF
212 +-----------+--------+---------+--------+--------+--------+
213 | | | | | Valid | Cum |
214 |Value Label| Value |Frequency| Percent| Percent| Percent|
215 #===========#========#=========#========#========#========#
216 | | 1.00| 1| 16.7| 16.7| 16.7|
217 | | 3.00| 2| 33.3| 33.3| 50.0|
218 | | 4.00| 1| 16.7| 16.7| 66.7|
219 | | 5.00| 2| 33.3| 33.3| 100.0|
220 #===========#========#=========#========#========#========#
221 | Total| 6| 100.0| 100.0| |
222 +--------------------+---------+--------+--------+--------+
223 +-----------------------+-----+
230 |Percentiles 0 |1.000|
235 +-----------------------+-----+
237 if [ $? -ne 0 ] ; then fail ; fi
241 activity="create program $i"
242 cat > $TEMPDIR/prog.sps <<EOF
243 DATA LIST LIST notable /X * F *.
253 MISSING VALUE x (99.0) .
258 /PERCENTILES = 0 25 50 75 100
261 if [ $? -ne 0 ] ; then no_result; fi
264 activity="run program $i"
265 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
266 if [ $? -ne 0 ] ; then no_result ; fi
268 activity="compare output $i"
269 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
270 diff -b $TEMPDIR/pspp.list - <<EOF
272 +-----------+--------+---------+--------+--------+--------+
273 | | | | | Valid | Cum |
274 |Value Label| Value |Frequency| Percent| Percent| Percent|
275 #===========#========#=========#========#========#========#
276 | | 1.00| 1| 10.0| 16.7| 16.7|
277 | | 3.00| 2| 20.0| 33.3| 50.0|
278 | | 4.00| 1| 10.0| 16.7| 66.7|
279 | | 5.00| 2| 20.0| 33.3| 100.0|
280 | | 99.00| 4| 40.0| Missing| |
281 #===========#========#=========#========#========#========#
282 | Total| 10| 100.0| 100.0| |
283 +--------------------+---------+--------+--------+--------+
284 +-----------------------+-----+
291 |Percentiles 0 |1.000|
296 +-----------------------+-----+
298 if [ $? -ne 0 ] ; then fail ; fi