3 # This program tests the PERCENTILES subcommand of the EXAMINE command.
4 # In particular it tests that it behaves properly when there are only
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
15 # ensure that top_srcdir is absolute
16 top_srcdir=`cd $top_srcdir; pwd`
18 STAT_CONFIG_PATH=$top_srcdir/config
19 export STAT_CONFIG_PATH
56 activity="create program"
66 /PERCENTILES=HAVERAGE.
69 /PERCENTILES=WAVERAGE.
75 /PERCENTILES=EMPIRICAL.
78 /PERCENTILES=AEMPIRICAL.
80 if [ $? -ne 0 ] ; then no_result ; fi
82 activity="run program"
83 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
84 if [ $? -ne 0 ] ; then no_result ; fi
87 activity="compare results"
88 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
89 diff -b $TEMPDIR/pspp.list - << EOF
90 1.1 DATA LIST. Reading free-form data from INLINE.
96 2.1 EXAMINE. Case Processing Summary
97 #=#=============================#
99 # #---------+---------+---------#
100 # # Valid | Missing | Total #
101 # #-+-------+-+-------+-+-------#
102 # #N|Percent|N|Percent|N|Percent#
103 #=#=#=======#=#=======#=#=======#
104 #X#3| 100%|0| 0%|3| 100%#
105 #=#=#=======#=#=======#=#=======#
106 2.2 EXAMINE. Percentiles
107 #================#================================#
109 # #---+---+----+----+----+----+----#
110 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
111 #=#==============#===#===#====#====#====#====#====#
112 #X|HAverage #.40|.80|2.00|5.00|8.00|8.00|8.00#
113 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
114 #=#==============#===#===#====#====#====#====#====#
115 3.1 EXAMINE. Case Processing Summary
116 #=#=============================#
118 # #---------+---------+---------#
119 # # Valid | Missing | Total #
120 # #-+-------+-+-------+-+-------#
121 # #N|Percent|N|Percent|N|Percent#
122 #=#=#=======#=#=======#=#=======#
123 #X#3| 100%|0| 0%|3| 100%#
124 #=#=#=======#=#=======#=#=======#
125 3.2 EXAMINE. Percentiles
126 #==================#================================#
128 # #---+---+----+----+----+----+----#
129 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
130 #=#================#===#===#====#====#====#====#====#
131 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
132 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
133 #=#================#===#===#====#====#====#====#====#
134 4.1 EXAMINE. Case Processing Summary
135 #=#=============================#
137 # #---------+---------+---------#
138 # # Valid | Missing | Total #
139 # #-+-------+-+-------+-+-------#
140 # #N|Percent|N|Percent|N|Percent#
141 #=#=#=======#=#=======#=#=======#
142 #X#3| 100%|0| 0%|3| 100%#
143 #=#=#=======#=#=======#=#=======#
144 4.2 EXAMINE. Percentiles
145 #================#================================#
147 # #---+---+----+----+----+----+----#
148 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
149 #=#==============#===#===#====#====#====#====#====#
150 #X|Rounded #.00|.00|2.00|5.00|5.00|8.00|8.00#
151 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
152 #=#==============#===#===#====#====#====#====#====#
153 5.1 EXAMINE. Case Processing Summary
154 #=#=============================#
156 # #---------+---------+---------#
157 # # Valid | Missing | Total #
158 # #-+-------+-+-------+-+-------#
159 # #N|Percent|N|Percent|N|Percent#
160 #=#=#=======#=#=======#=#=======#
161 #X#3| 100%|0| 0%|3| 100%#
162 #=#=#=======#=#=======#=#=======#
163 5.2 EXAMINE. Percentiles
164 #================#==================================#
166 # #----+----+----+----+----+----+----#
167 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
168 #=#==============#====#====#====#====#====#====#====#
169 #X|Empirical #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
170 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
171 #=#==============#====#====#====#====#====#====#====#
172 6.1 EXAMINE. Case Processing Summary
173 #=#=============================#
175 # #---------+---------+---------#
176 # # Valid | Missing | Total #
177 # #-+-------+-+-------+-+-------#
178 # #N|Percent|N|Percent|N|Percent#
179 #=#=#=======#=#=======#=#=======#
180 #X#3| 100%|0| 0%|3| 100%#
181 #=#=#=======#=#=======#=#=======#
182 6.2 EXAMINE. Percentiles
183 #==========================#==================================#
185 # #----+----+----+----+----+----+----#
186 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
187 #=#========================#====#====#====#====#====#====#====#
188 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
189 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
190 #=#========================#====#====#====#====#====#====#====#
192 if [ $? -ne 0 ] ; then fail ; fi