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
57 activity="create program"
67 /PERCENTILES=HAVERAGE.
70 /PERCENTILES=WAVERAGE.
76 /PERCENTILES=EMPIRICAL.
79 /PERCENTILES=AEMPIRICAL.
81 if [ $? -ne 0 ] ; then no_result ; fi
83 activity="run program"
84 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
85 if [ $? -ne 0 ] ; then no_result ; fi
88 activity="compare results"
89 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
90 diff -b $TEMPDIR/pspp.list - << EOF
91 1.1 DATA LIST. Reading free-form data from INLINE.
97 2.1 EXAMINE. Case Processing Summary
98 #=#=============================#
100 # #---------+---------+---------#
101 # # Valid | Missing | Total #
102 # #-+-------+-+-------+-+-------#
103 # #N|Percent|N|Percent|N|Percent#
104 #=#=#=======#=#=======#=#=======#
105 #X#3| 100%|0| 0%|3| 100%#
106 #=#=#=======#=#=======#=#=======#
107 2.2 EXAMINE. Percentiles
108 #================#================================#
110 # #---+---+----+----+----+----+----#
111 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
112 #=#==============#===#===#====#====#====#====#====#
113 #X|HAverage #.40|.80|2.00|5.00|8.00|8.00|8.00#
114 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
115 #=#==============#===#===#====#====#====#====#====#
116 3.1 EXAMINE. Case Processing Summary
117 #=#=============================#
119 # #---------+---------+---------#
120 # # Valid | Missing | Total #
121 # #-+-------+-+-------+-+-------#
122 # #N|Percent|N|Percent|N|Percent#
123 #=#=#=======#=#=======#=#=======#
124 #X#3| 100%|0| 0%|3| 100%#
125 #=#=#=======#=#=======#=#=======#
126 3.2 EXAMINE. Percentiles
127 #==================#================================#
129 # #---+---+----+----+----+----+----#
130 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
131 #=#================#===#===#====#====#====#====#====#
132 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
133 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
134 #=#================#===#===#====#====#====#====#====#
135 4.1 EXAMINE. Case Processing Summary
136 #=#=============================#
138 # #---------+---------+---------#
139 # # Valid | Missing | Total #
140 # #-+-------+-+-------+-+-------#
141 # #N|Percent|N|Percent|N|Percent#
142 #=#=#=======#=#=======#=#=======#
143 #X#3| 100%|0| 0%|3| 100%#
144 #=#=#=======#=#=======#=#=======#
145 4.2 EXAMINE. Percentiles
146 #================#================================#
148 # #---+---+----+----+----+----+----#
149 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
150 #=#==============#===#===#====#====#====#====#====#
151 #X|Rounded #.00|.00|2.00|5.00|5.00|8.00|8.00#
152 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
153 #=#==============#===#===#====#====#====#====#====#
154 5.1 EXAMINE. Case Processing Summary
155 #=#=============================#
157 # #---------+---------+---------#
158 # # Valid | Missing | Total #
159 # #-+-------+-+-------+-+-------#
160 # #N|Percent|N|Percent|N|Percent#
161 #=#=#=======#=#=======#=#=======#
162 #X#3| 100%|0| 0%|3| 100%#
163 #=#=#=======#=#=======#=#=======#
164 5.2 EXAMINE. Percentiles
165 #================#==================================#
167 # #----+----+----+----+----+----+----#
168 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
169 #=#==============#====#====#====#====#====#====#====#
170 #X|Empirical #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
171 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
172 #=#==============#====#====#====#====#====#====#====#
173 6.1 EXAMINE. Case Processing Summary
174 #=#=============================#
176 # #---------+---------+---------#
177 # # Valid | Missing | Total #
178 # #-+-------+-+-------+-+-------#
179 # #N|Percent|N|Percent|N|Percent#
180 #=#=#=======#=#=======#=#=======#
181 #X#3| 100%|0| 0%|3| 100%#
182 #=#=#=======#=#=======#=#=======#
183 6.2 EXAMINE. Percentiles
184 #==========================#==================================#
186 # #----+----+----+----+----+----+----#
187 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
188 #=#========================#====#====#====#====#====#====#====#
189 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
190 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
191 #=#========================#====#====#====#====#====#====#====#
193 if [ $? -ne 0 ] ; then fail ; fi