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$EXEEXT
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
26 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
27 echo "NOT cleaning $TEMPDIR"
65 activity="create program $i"
66 cat > $TEMPDIR/prog.sps <<EOF
67 DATA LIST LIST notable /X * .
78 /PERCENTILES = 0 25 50 75 100
81 if [ $? -ne 0 ] ; then no_result; fi
83 activity="run program $i"
84 $SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/prog.sps
85 if [ $? -ne 0 ] ; then no_result ; fi
87 activity="compare output $i"
88 diff -c $TEMPDIR/pspp.csv - <<EOF
90 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
91 ,1.00,1,20.00,20.00,20.00
92 ,2.00,1,20.00,20.00,40.00
93 ,3.00,1,20.00,20.00,60.00
94 ,4.00,1,20.00,20.00,80.00
95 ,5.00,1,20.00,20.00,100.00
111 if [ $? -ne 0 ] ; then fail ; fi
117 activity="create program $i"
118 cat > $TEMPDIR/prog.sps <<EOF
119 DATA LIST LIST notable /X * F *.
134 /PERCENTILES = 0 25 50 75 100
137 if [ $? -ne 0 ] ; then no_result; fi
140 activity="run program $i"
141 $SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/prog.sps
142 if [ $? -ne 0 ] ; then no_result ; fi
144 activity="compare output $i"
145 diff -c $TEMPDIR/pspp.csv - <<EOF
147 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
148 ,1.00,2.00,20.00,20.00,20.00
149 ,2.00,2.00,20.00,20.00,40.00
150 ,3.00,2.00,20.00,20.00,60.00
151 ,4.00,2.00,20.00,20.00,80.00
152 ,5.00,2.00,20.00,20.00,100.00
153 Total,,10.00,100.0,100.0,
168 if [ $? -ne 0 ] ; then fail ; fi
174 activity="create program $i"
175 cat > $TEMPDIR/prog.sps <<EOF
176 DATA LIST LIST notable /X * F *.
189 /PERCENTILES = 0 25 50 75 100
192 if [ $? -ne 0 ] ; then no_result; fi
195 activity="run program $i"
196 $SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/prog.sps
197 if [ $? -ne 0 ] ; then no_result ; fi
199 activity="compare output $i"
200 diff -c $TEMPDIR/pspp.csv - <<EOF
202 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
203 ,1.00,1.00,16.67,16.67,16.67
204 ,3.00,2.00,33.33,33.33,50.00
205 ,4.00,1.00,16.67,16.67,66.67
206 ,5.00,2.00,33.33,33.33,100.00
207 Total,,6.00,100.0,100.0,
222 if [ $? -ne 0 ] ; then fail ; fi
226 activity="create program $i"
227 cat > $TEMPDIR/prog.sps <<EOF
228 DATA LIST LIST notable /X * F *.
238 MISSING VALUE x (99.0) .
243 /PERCENTILES = 0 25 50 75 100
246 if [ $? -ne 0 ] ; then no_result; fi
249 activity="run program $i"
250 $SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/prog.sps
251 if [ $? -ne 0 ] ; then no_result ; fi
253 activity="compare output $i"
254 diff -c $TEMPDIR/pspp.csv - <<EOF
256 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
257 ,1.00,1.00,10.00,16.67,16.67
258 ,3.00,2.00,20.00,33.33,50.00
259 ,4.00,1.00,10.00,16.67,66.67
260 ,5.00,2.00,20.00,33.33,100.00
261 ,99.00,4.00,40.00,Missing,
262 Total,,10.00,100.0,100.0,
277 if [ $? -ne 0 ] ; then fail ; fi