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
12 # ensure that top_srcdir is absolute
13 cd $top_srcdir; top_srcdir=`pwd`
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
53 activity="create program"
63 /PERCENTILES=HAVERAGE.
66 /PERCENTILES=WAVERAGE.
72 /PERCENTILES=EMPIRICAL.
75 /PERCENTILES=AEMPIRICAL.
77 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="run program"
80 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
81 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare results"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
86 diff -b $TEMPDIR/pspp.list - << EOF
87 1.1 DATA LIST. Reading free-form data from INLINE.
93 2.1 EXAMINE. Case Processing Summary
94 #=#=============================#
96 # #---------+---------+---------#
97 # # Valid | Missing | Total #
98 # #-+-------+-+-------+-+-------#
99 # #N|Percent|N|Percent|N|Percent#
100 #=#=#=======#=#=======#=#=======#
101 #X#3| 100%|0| 0%|3| 100%#
102 #=#=#=======#=#=======#=#=======#
103 2.2 EXAMINE. Percentiles
104 #================#================================#
106 # #---+---+----+----+----+----+----#
107 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
108 #=#==============#===#===#====#====#====#====#====#
109 #X|HAverage #.40|.80|2.00|5.00|8.00|8.00|8.00#
110 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
111 #=#==============#===#===#====#====#====#====#====#
112 3.1 EXAMINE. Case Processing Summary
113 #=#=============================#
115 # #---------+---------+---------#
116 # # Valid | Missing | Total #
117 # #-+-------+-+-------+-+-------#
118 # #N|Percent|N|Percent|N|Percent#
119 #=#=#=======#=#=======#=#=======#
120 #X#3| 100%|0| 0%|3| 100%#
121 #=#=#=======#=#=======#=#=======#
122 3.2 EXAMINE. Percentiles
123 #==================#================================#
125 # #---+---+----+----+----+----+----#
126 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
127 #=#================#===#===#====#====#====#====#====#
128 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
129 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
130 #=#================#===#===#====#====#====#====#====#
131 4.1 EXAMINE. Case Processing Summary
132 #=#=============================#
134 # #---------+---------+---------#
135 # # Valid | Missing | Total #
136 # #-+-------+-+-------+-+-------#
137 # #N|Percent|N|Percent|N|Percent#
138 #=#=#=======#=#=======#=#=======#
139 #X#3| 100%|0| 0%|3| 100%#
140 #=#=#=======#=#=======#=#=======#
141 4.2 EXAMINE. Percentiles
142 #================#================================#
144 # #---+---+----+----+----+----+----#
145 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
146 #=#==============#===#===#====#====#====#====#====#
147 #X|Rounded #.00|.00|2.00|5.00|5.00|8.00|8.00#
148 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
149 #=#==============#===#===#====#====#====#====#====#
150 5.1 EXAMINE. Case Processing Summary
151 #=#=============================#
153 # #---------+---------+---------#
154 # # Valid | Missing | Total #
155 # #-+-------+-+-------+-+-------#
156 # #N|Percent|N|Percent|N|Percent#
157 #=#=#=======#=#=======#=#=======#
158 #X#3| 100%|0| 0%|3| 100%#
159 #=#=#=======#=#=======#=#=======#
160 5.2 EXAMINE. Percentiles
161 #================#==================================#
163 # #----+----+----+----+----+----+----#
164 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
165 #=#==============#====#====#====#====#====#====#====#
166 #X|Empirical #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
167 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
168 #=#==============#====#====#====#====#====#====#====#
169 6.1 EXAMINE. Case Processing Summary
170 #=#=============================#
172 # #---------+---------+---------#
173 # # Valid | Missing | Total #
174 # #-+-------+-+-------+-+-------#
175 # #N|Percent|N|Percent|N|Percent#
176 #=#=#=======#=#=======#=#=======#
177 #X#3| 100%|0| 0%|3| 100%#
178 #=#=#=======#=#=======#=#=======#
179 6.2 EXAMINE. Percentiles
180 #==========================#==================================#
182 # #----+----+----+----+----+----+----#
183 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
184 #=#========================#====#====#====#====#====#====#====#
185 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
186 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
187 #=#========================#====#====#====#====#====#====#====#
189 if [ $? -ne 0 ] ; then fail ; fi