1 AT_BANNER([FREQUENCIES procedure])
3 AT_SETUP([FREQUENCIES string variable crash])
4 AT_DATA([frequencies.sps],
6 name (A8) value * quantity .
12 FREQUENCIES /VAR = name.
14 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
16 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
17 ,Cables ,1,100.00,100.00,100.00
22 # Tests for a bug where pspp would crash if two FREQUENCIES commands
23 # existed in a input file.
24 AT_SETUP([FREQUENCIES two runs crash])
25 AT_DATA([frequencies.sps],
26 [data list free /v1 v2.
34 frequencies v1 v2/statistics=none.
35 frequencies v1 v2/statistics=none.
37 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
39 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
40 ,.00,1,25.00,25.00,25.00
41 ,2.00,1,25.00,25.00,50.00
42 ,3.00,1,25.00,25.00,75.00
43 ,4.00,1,25.00,25.00,100.00
47 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
48 ,1.00,1,25.00,25.00,25.00
49 ,3.00,1,25.00,25.00,50.00
50 ,4.00,1,25.00,25.00,75.00
51 ,5.00,1,25.00,25.00,100.00
55 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
56 ,.00,1,25.00,25.00,25.00
57 ,2.00,1,25.00,25.00,50.00
58 ,3.00,1,25.00,25.00,75.00
59 ,4.00,1,25.00,25.00,100.00
63 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
64 ,1.00,1,25.00,25.00,25.00
65 ,3.00,1,25.00,25.00,50.00
66 ,4.00,1,25.00,25.00,75.00
67 ,5.00,1,25.00,25.00,100.00
72 # Tests for a bug where PSPP would crash when a FREQUENCIES command
73 # was used with the HTML output driver.
74 AT_SETUP([FREQUENCIES HTML output crash])
75 AT_DATA([frequencies.sps],
76 [data list free /v1 v2.
86 frequencies v1/statistics=none.
88 AT_CHECK([pspp -o - -O format=csv -o pspp.html frequencies.sps], [0],
97 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
98 ,.00,1,25.00,25.00,25.00
99 ,2.00,1,25.00,25.00,50.00
100 ,3.00,1,25.00,25.00,75.00
101 ,4.00,1,25.00,25.00,100.00
102 Total,,4,100.0,100.0,
104 AT_CHECK([test -s pspp.html])
107 # Tests for a bug which crashed PSPP when a piechart with too many
108 # segments was requested.
109 AT_SETUP([FREQUENCIES pie chart crash])
110 AT_DATA([frequencies.sps],
111 [data list list /x * w *.
128 frequencies /x /format=notable /statistics=none
131 # Cannot use the CSV driver for this because it does not output charts
133 AT_CHECK([pspp frequencies.sps], [0], [dnl
134 Reading free-form data from INLINE.
144 # Tests for a bug which crashed PSPP when the median and a histogram
145 # were both requested.
146 AT_SETUP([FREQUENCIES median with histogram crash])
147 AT_DATA([frequencies.sps], [dnl
148 data list list notable /x.
153 frequencies /x /histogram /STATISTICS=median.
155 AT_CHECK([pspp -O format=csv frequencies.sps], [0], [dnl
157 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
158 ,1.00,1,100.00,100.00,100.00
159 Total,,1,100.0,100.0,
169 # Tests for a bug which caused FREQUENCIES following TEMPORARY to
170 # crash (bug #11492).
171 AT_SETUP([FREQUENCIES crash after TEMPORARY])
172 AT_DATA([frequencies.sps],
173 [DATA LIST LIST /SEX (A1) X *.
192 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
193 [Table: Reading free-form data from INLINE.
199 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
200 ,12.00,1,25.00,25.00,25.00
201 ,13.00,1,25.00,25.00,50.00
202 ,21.00,1,25.00,25.00,75.00
203 ,31.00,1,25.00,25.00,100.00
204 Total,,4,100.0,100.0,
216 m4_define([FREQUENCIES_NTILES_OUTPUT],
232 AT_SETUP([FREQUENCIES basic percentiles])
233 AT_DATA([frequencies.sps],
234 [DATA LIST LIST notable /x * .
246 /PERCENTILES = 0 25 33.333 50 66.666 75 100.
248 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
249 [FREQUENCIES_NTILES_OUTPUT])
252 AT_SETUP([FREQUENCIES basic n-tiles])
253 AT_DATA([frequencies.sps],
254 [DATA LIST LIST notable /x * .
269 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
270 [FREQUENCIES_NTILES_OUTPUT])
273 AT_SETUP([FREQUENCIES compatibility percentiles])
274 AT_DATA([frequencies.sps],
275 [DATA LIST LIST notable /X * .
286 /ALGORITHM=COMPATIBLE
287 /PERCENTILES = 0 25 50 75 100.
289 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
291 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
292 ,1.00,1,20.00,20.00,20.00
293 ,2.00,1,20.00,20.00,40.00
294 ,3.00,1,20.00,20.00,60.00
295 ,4.00,1,20.00,20.00,80.00
296 ,5.00,1,20.00,20.00,100.00
297 Total,,5,100.0,100.0,
314 AT_SETUP([FREQUENCIES enhanced percentiles])
315 AT_DATA([frequencies.sps],
316 [DATA LIST LIST notable /X * .
327 /PERCENTILES = 0 25 50 75 100.
329 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
331 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
332 ,1.00,1,20.00,20.00,20.00
333 ,2.00,1,20.00,20.00,40.00
334 ,3.00,1,20.00,20.00,60.00
335 ,4.00,1,20.00,20.00,80.00
336 ,5.00,1,20.00,20.00,100.00
337 Total,,5,100.0,100.0,
354 AT_SETUP([FREQUENCIES enhanced percentiles, weighted])
355 AT_DATA([frequencies.sps],
356 [DATA LIST LIST notable /X * F *.
371 /PERCENTILES = 0 25 50 75 100.
373 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
375 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
376 ,1.00,2.00,20.00,20.00,20.00
377 ,2.00,2.00,20.00,20.00,40.00
378 ,3.00,2.00,20.00,20.00,60.00
379 ,4.00,2.00,20.00,20.00,80.00
380 ,5.00,2.00,20.00,20.00,100.00
381 Total,,10.00,100.0,100.0,
398 AT_SETUP([FREQUENCIES enhanced percentiles, weighted (2)])
399 AT_DATA([frequencies.sps],
400 [DATA LIST LIST notable /X * F *.
413 /PERCENTILES = 0 25 50 75 100.
415 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
417 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
418 ,1.00,1.00,16.67,16.67,16.67
419 ,3.00,2.00,33.33,33.33,50.00
420 ,4.00,1.00,16.67,16.67,66.67
421 ,5.00,2.00,33.33,33.33,100.00
422 Total,,6.00,100.0,100.0,
439 dnl Data for this test case from Fabio Bordignon <bordignon@demos.it>.
440 AT_SETUP([FREQUENCIES enhanced percentiles, weighted (3)])
441 AT_DATA([frequencies.sps],
442 [DATA LIST LIST notable /X * F *.
454 /PERCENTILES = 0 25 50 75 100.
456 AT_CHECK([pspp -O format=csv frequencies.sps], [0], [dnl
458 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
459 ,1.00,7.00,17.50,17.50,17.50
460 ,2.00,16.00,40.00,40.00,57.50
461 ,3.00,12.00,30.00,30.00,87.50
462 ,4.00,5.00,12.50,12.50,100.00
463 Total,,40.00,100.0,100.0,
480 AT_SETUP([FREQUENCIES enhanced percentiles, weighted, missing values])
481 AT_DATA([frequencies.sps],
482 [DATA LIST LIST notable /X * F *.
492 MISSING VALUE x (99.0) .
497 /PERCENTILES = 0 25 50 75 100.
499 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
501 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
502 ,1.00,1.00,10.00,16.67,16.67
503 ,3.00,2.00,20.00,33.33,50.00
504 ,4.00,1.00,10.00,16.67,66.67
505 ,5.00,2.00,20.00,33.33,100.00
506 ,99.00,4.00,40.00,Missing,
507 Total,,10.00,100.0,100.0,