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`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
60 activity="create program"
70 /PERCENTILES=HAVERAGE.
73 /PERCENTILES=WAVERAGE.
79 /PERCENTILES=EMPIRICAL.
82 /PERCENTILES=AEMPIRICAL.
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="run program"
87 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
88 if [ $? -ne 0 ] ; then no_result ; fi
91 activity="compare results"
92 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
93 diff -b $TEMPDIR/pspp.list - << EOF
94 1.1 DATA LIST. Reading free-form data from INLINE.
100 2.1 EXAMINE. Case Processing Summary
101 #=#=============================#
103 # #---------+---------+---------#
104 # # Valid | Missing | Total #
105 # #-+-------+-+-------+-+-------#
106 # #N|Percent|N|Percent|N|Percent#
107 #=#=#=======#=#=======#=#=======#
108 #X#3| 100%|0| 0%|3| 100%#
109 #=#=#=======#=#=======#=#=======#
110 2.2 EXAMINE. Percentiles
111 #================#================================#
113 # #---+---+----+----+----+----+----#
114 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
115 #=#==============#===#===#====#====#====#====#====#
116 #X|HAverage #.40|.80|2.00|5.00|8.00|8.00|8.00#
117 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
118 #=#==============#===#===#====#====#====#====#====#
119 3.1 EXAMINE. Case Processing Summary
120 #=#=============================#
122 # #---------+---------+---------#
123 # # Valid | Missing | Total #
124 # #-+-------+-+-------+-+-------#
125 # #N|Percent|N|Percent|N|Percent#
126 #=#=#=======#=#=======#=#=======#
127 #X#3| 100%|0| 0%|3| 100%#
128 #=#=#=======#=#=======#=#=======#
129 3.2 EXAMINE. Percentiles
130 #==================#================================#
132 # #---+---+----+----+----+----+----#
133 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
134 #=#================#===#===#====#====#====#====#====#
135 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
136 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
137 #=#================#===#===#====#====#====#====#====#
138 4.1 EXAMINE. Case Processing Summary
139 #=#=============================#
141 # #---------+---------+---------#
142 # # Valid | Missing | Total #
143 # #-+-------+-+-------+-+-------#
144 # #N|Percent|N|Percent|N|Percent#
145 #=#=#=======#=#=======#=#=======#
146 #X#3| 100%|0| 0%|3| 100%#
147 #=#=#=======#=#=======#=#=======#
148 4.2 EXAMINE. Percentiles
149 #================#================================#
151 # #---+---+----+----+----+----+----#
152 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
153 #=#==============#===#===#====#====#====#====#====#
154 #X|Rounded #.00|.00|2.00|5.00|5.00|8.00|8.00#
155 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
156 #=#==============#===#===#====#====#====#====#====#
157 5.1 EXAMINE. Case Processing Summary
158 #=#=============================#
160 # #---------+---------+---------#
161 # # Valid | Missing | Total #
162 # #-+-------+-+-------+-+-------#
163 # #N|Percent|N|Percent|N|Percent#
164 #=#=#=======#=#=======#=#=======#
165 #X#3| 100%|0| 0%|3| 100%#
166 #=#=#=======#=#=======#=#=======#
167 5.2 EXAMINE. Percentiles
168 #================#==================================#
170 # #----+----+----+----+----+----+----#
171 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
172 #=#==============#====#====#====#====#====#====#====#
173 #X|Empirical #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
174 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
175 #=#==============#====#====#====#====#====#====#====#
176 6.1 EXAMINE. Case Processing Summary
177 #=#=============================#
179 # #---------+---------+---------#
180 # # Valid | Missing | Total #
181 # #-+-------+-+-------+-+-------#
182 # #N|Percent|N|Percent|N|Percent#
183 #=#=#=======#=#=======#=#=======#
184 #X#3| 100%|0| 0%|3| 100%#
185 #=#=#=======#=#=======#=#=======#
186 6.2 EXAMINE. Percentiles
187 #==========================#==================================#
189 # #----+----+----+----+----+----+----#
190 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
191 #=#========================#====#====#====#====#====#====#====#
192 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
193 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
194 #=#========================#====#====#====#====#====#====#====#
196 if [ $? -ne 0 ] ; then fail ; fi