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],
136 Reading free-form data from INLINE.
152 # Tests for a bug which crashed PSPP when the median and a histogram
153 # were both requested.
154 AT_SETUP([FREQUENCIES median with histogram crash])
155 AT_DATA([frequencies.sps], [dnl
156 data list list notable /x.
161 frequencies /x /histogram /STATISTICS=median.
163 AT_CHECK([pspp -O format=csv frequencies.sps], [0], [dnl
165 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
166 ,1.00,1,100.00,100.00,100.00
167 Total,,1,100.0,100.0,
177 # Tests for a bug which caused FREQUENCIES following TEMPORARY to
178 # crash (bug #11492).
179 AT_SETUP([FREQUENCIES crash after TEMPORARY])
180 AT_DATA([frequencies.sps],
181 [DATA LIST LIST /SEX (A1) X *.
200 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
201 [Table: Reading free-form data from INLINE.
207 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
208 ,12.00,1,25.00,25.00,25.00
209 ,13.00,1,25.00,25.00,50.00
210 ,21.00,1,25.00,25.00,75.00
211 ,31.00,1,25.00,25.00,100.00
212 Total,,4,100.0,100.0,
224 m4_define([FREQUENCIES_NTILES_OUTPUT],
240 AT_SETUP([FREQUENCIES basic percentiles])
241 AT_DATA([frequencies.sps],
242 [DATA LIST LIST notable /x * .
254 /PERCENTILES = 0 25 33.333 50 66.666 75 100.
256 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
257 [FREQUENCIES_NTILES_OUTPUT])
260 AT_SETUP([FREQUENCIES basic n-tiles])
261 AT_DATA([frequencies.sps],
262 [DATA LIST LIST notable /x * .
277 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
278 [FREQUENCIES_NTILES_OUTPUT])
281 AT_SETUP([FREQUENCIES compatibility percentiles])
282 AT_DATA([frequencies.sps],
283 [DATA LIST LIST notable /X * .
294 /ALGORITHM=COMPATIBLE
295 /PERCENTILES = 0 25 50 75 100.
297 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
299 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
300 ,1.00,1,20.00,20.00,20.00
301 ,2.00,1,20.00,20.00,40.00
302 ,3.00,1,20.00,20.00,60.00
303 ,4.00,1,20.00,20.00,80.00
304 ,5.00,1,20.00,20.00,100.00
305 Total,,5,100.0,100.0,
322 AT_SETUP([FREQUENCIES enhanced percentiles])
323 AT_DATA([frequencies.sps],
324 [DATA LIST LIST notable /X * .
335 /PERCENTILES = 0 25 50 75 100.
337 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
339 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
340 ,1.00,1,20.00,20.00,20.00
341 ,2.00,1,20.00,20.00,40.00
342 ,3.00,1,20.00,20.00,60.00
343 ,4.00,1,20.00,20.00,80.00
344 ,5.00,1,20.00,20.00,100.00
345 Total,,5,100.0,100.0,
362 AT_SETUP([FREQUENCIES enhanced percentiles, weighted])
363 AT_DATA([frequencies.sps],
364 [DATA LIST LIST notable /X * F *.
379 /PERCENTILES = 0 25 50 75 100.
381 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
383 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
384 ,1.00,2.00,20.00,20.00,20.00
385 ,2.00,2.00,20.00,20.00,40.00
386 ,3.00,2.00,20.00,20.00,60.00
387 ,4.00,2.00,20.00,20.00,80.00
388 ,5.00,2.00,20.00,20.00,100.00
389 Total,,10.00,100.0,100.0,
406 AT_SETUP([FREQUENCIES enhanced percentiles, weighted (2)])
407 AT_DATA([frequencies.sps],
408 [DATA LIST LIST notable /X * F *.
421 /PERCENTILES = 0 25 50 75 100.
423 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
425 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
426 ,1.00,1.00,16.67,16.67,16.67
427 ,3.00,2.00,33.33,33.33,50.00
428 ,4.00,1.00,16.67,16.67,66.67
429 ,5.00,2.00,33.33,33.33,100.00
430 Total,,6.00,100.0,100.0,
447 dnl Data for this test case from Fabio Bordignon <bordignon@demos.it>.
448 AT_SETUP([FREQUENCIES enhanced percentiles, weighted (3)])
449 AT_DATA([frequencies.sps],
450 [DATA LIST LIST notable /X * F *.
462 /PERCENTILES = 0 25 50 75 100.
464 AT_CHECK([pspp -O format=csv frequencies.sps], [0], [dnl
466 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
467 ,1.00,7.00,17.50,17.50,17.50
468 ,2.00,16.00,40.00,40.00,57.50
469 ,3.00,12.00,30.00,30.00,87.50
470 ,4.00,5.00,12.50,12.50,100.00
471 Total,,40.00,100.0,100.0,
488 AT_SETUP([FREQUENCIES enhanced percentiles, weighted, missing values])
489 AT_DATA([frequencies.sps],
490 [DATA LIST LIST notable /X * F *.
500 MISSING VALUE x (99.0) .
505 /PERCENTILES = 0 25 50 75 100.
507 AT_CHECK([pspp -O format=csv frequencies.sps], [0],
509 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
510 ,1.00,1.00,10.00,16.67,16.67
511 ,3.00,2.00,20.00,33.33,50.00
512 ,4.00,1.00,10.00,16.67,66.67
513 ,5.00,2.00,20.00,33.33,100.00
514 ,99.00,4.00,40.00,Missing,
515 Total,,10.00,100.0,100.0,