Fix bug #37984 - EXAMINE extremes vs. fractional weights.
[pspp] / tests / language / stats / examine.at
1 AT_BANNER([EXAMINE])
2
3 AT_SETUP([EXAMINE])
4 AT_DATA([examine.sps], [
5 DATA LIST LIST /QUALITY * W * BRAND * .
6 BEGIN DATA
7 3  1  1
8 2  2  1
9 1  2  1
10 1  1  1
11 4  1  1
12 4  1  1
13 5  1  2
14 2  1  2
15 4  4  2
16 2  1  2
17 3  1  2
18 7  1  3
19 4  2  3
20 5  3  3
21 3  1  3
22 6  1  3
23 END DATA
24
25 WEIGHT BY w.
26
27 VARIABLE LABELS brand   'Manufacturer'.
28 VARIABLE LABELS quality 'Breaking Strain'.
29
30 VALUE LABELS /brand 1 'Aspeger' 2 'Bloggs' 3 'Charlies'.
31
32 LIST /FORMAT=NUMBERED.
33
34 EXAMINE
35         quality BY brand
36         /STATISTICS descriptives extreme(3)
37         .
38 ])
39 AT_CHECK([pspp -o pspp.csv examine.sps])
40 dnl In the following data, only the extreme values have been checked.
41 dnl The descriptives have been blindly pasted.
42 AT_CHECK([cat pspp.csv], [0], [dnl
43 Table: Reading free-form data from INLINE.
44 Variable,Format
45 QUALITY,F8.0
46 W,F8.0
47 BRAND,F8.0
48
49 Table: Data List
50 Case Number,QUALITY,W,BRAND
51 1,3.00,1.00,1.00
52 2,2.00,2.00,1.00
53 3,1.00,2.00,1.00
54 4,1.00,1.00,1.00
55 5,4.00,1.00,1.00
56 6,4.00,1.00,1.00
57 7,5.00,1.00,2.00
58 8,2.00,1.00,2.00
59 9,4.00,4.00,2.00
60 10,2.00,1.00,2.00
61 11,3.00,1.00,2.00
62 12,7.00,1.00,3.00
63 13,4.00,2.00,3.00
64 14,5.00,3.00,3.00
65 15,3.00,1.00,3.00
66 16,6.00,1.00,3.00
67
68 Table: Case Processing Summary
69 ,Cases,,,,,
70 ,Valid,,Missing,,Total,
71 ,N,Percent,N,Percent,N,Percent
72 Breaking Strain,24.00,100%,.00,0%,24.00,100%
73
74 Table: Extreme Values
75 ,,,Case Number,Value
76 Breaking Strain,Highest,1,12,7.00
77 ,,2,16,6.00
78 ,,3,14,5.00
79 ,Lowest,1,3,1.00
80 ,,2,3,1.00
81 ,,3,4,1.00
82
83 Table: Descriptives
84 ,,,Statistic,Std. Error
85 Breaking Strain,Mean,,3.54,.32
86 ,95% Confidence Interval for Mean,Lower Bound,2.87,
87 ,,Upper Bound,4.21,
88 ,5% Trimmed Mean,,3.50,
89 ,Median,,4.00,
90 ,Variance,,2.52,
91 ,Std. Deviation,,1.59,
92 ,Minimum,,1.00,
93 ,Maximum,,7.00,
94 ,Range,,6.00,
95 ,Interquartile Range,,2.75,
96 ,Skewness,,.06,.47
97 ,Kurtosis,,-.36,.92
98
99 Table: Case Processing Summary
100 ,,Cases,,,,,
101 ,,Valid,,Missing,,Total,
102 ,Manufacturer,N,Percent,N,Percent,N,Percent
103 Breaking Strain,Aspeger,8.00,100%,.00,0%,8.00,100%
104 ,Bloggs,8.00,100%,.00,0%,8.00,100%
105 ,Charlies,8.00,100%,.00,0%,8.00,100%
106
107 Table: Extreme Values
108 ,Manufacturer,,,Case Number,Value
109 Breaking Strain,Aspeger,Highest,1,6,4.00
110 ,,,2,5,4.00
111 ,,,3,1,3.00
112 ,,Lowest,1,3,1.00
113 ,,,2,3,1.00
114 ,,,3,4,1.00
115 ,Bloggs,Highest,1,7,5.00
116 ,,,2,9,4.00
117 ,,,3,9,4.00
118 ,,Lowest,1,8,2.00
119 ,,,2,10,2.00
120 ,,,3,11,3.00
121 ,Charlies,Highest,1,12,7.00
122 ,,,2,16,6.00
123 ,,,3,14,5.00
124 ,,Lowest,1,15,3.00
125 ,,,2,13,4.00
126 ,,,3,13,4.00
127
128 Table: Descriptives
129 ,Manufacturer,,,Statistic,Std. Error
130 Breaking Strain,Aspeger,Mean,,2.25,.45
131 ,,95% Confidence Interval for Mean,Lower Bound,1.18,
132 ,,,Upper Bound,3.32,
133 ,,5% Trimmed Mean,,2.22,
134 ,,Median,,2.00,
135 ,,Variance,,1.64,
136 ,,Std. Deviation,,1.28,
137 ,,Minimum,,1.00,
138 ,,Maximum,,4.00,
139 ,,Range,,3.00,
140 ,,Interquartile Range,,2.75,
141 ,,Skewness,,.47,.75
142 ,,Kurtosis,,-1.55,1.48
143 ,Bloggs,Mean,,3.50,.38
144 ,,95% Confidence Interval for Mean,Lower Bound,2.61,
145 ,,,Upper Bound,4.39,
146 ,,5% Trimmed Mean,,3.50,
147 ,,Median,,4.00,
148 ,,Variance,,1.14,
149 ,,Std. Deviation,,1.07,
150 ,,Minimum,,2.00,
151 ,,Maximum,,5.00,
152 ,,Range,,3.00,
153 ,,Interquartile Range,,1.75,
154 ,,Skewness,,-.47,.75
155 ,,Kurtosis,,-.83,1.48
156 ,Charlies,Mean,,4.88,.44
157 ,,95% Confidence Interval for Mean,Lower Bound,3.83,
158 ,,,Upper Bound,5.92,
159 ,,5% Trimmed Mean,,4.86,
160 ,,Median,,5.00,
161 ,,Variance,,1.55,
162 ,,Std. Deviation,,1.25,
163 ,,Minimum,,3.00,
164 ,,Maximum,,7.00,
165 ,,Range,,4.00,
166 ,,Interquartile Range,,1.75,
167 ,,Skewness,,.30,.75
168 ,,Kurtosis,,.15,1.48
169 ])
170 AT_CLEANUP
171
172 AT_SETUP([EXAMINE -- extremes])
173 AT_DATA([examine.sps], [dnl
174 data list free /V1 W
175 begin data.
176 1  1
177 2  1
178 3  2
179 3  1
180 4  1
181 5  1
182 6  1
183 7  1
184 8  1
185 9  1
186 10 1
187 11 1
188 12 1
189 13 1
190 14 1
191 15 1
192 16 1
193 17 1
194 18 2
195 19 1
196 20 1
197 end data.
198
199 weight by w.
200
201 examine v1 
202  /statistics=extreme(6)
203  .
204 ])
205 AT_CHECK([pspp -o pspp.csv examine.sps])
206 AT_CHECK([cat pspp.csv], [0], [dnl
207 Table: Case Processing Summary
208 ,Cases,,,,,
209 ,Valid,,Missing,,Total,
210 ,N,Percent,N,Percent,N,Percent
211 V1,23.00,100%,.00,0%,23.00,100%
212
213 Table: Extreme Values
214 ,,,Case Number,Value
215 V1,Highest,1,21,20.00
216 ,,2,20,19.00
217 ,,3,19,18.00
218 ,,4,19,18.00
219 ,,5,18,17.00
220 ,,6,17,16.00
221 ,Lowest,1,1,1.00
222 ,,2,2,2.00
223 ,,3,3,3.00
224 ,,4,3,3.00
225 ,,5,4,3.00
226 ,,6,5,4.00
227 ])
228 AT_CLEANUP
229
230
231
232 AT_SETUP([EXAMINE -- extremes with fractional weights])
233 AT_DATA([extreme.sps], [dnl
234 set format=F20.3.
235 data list notable list /w * x *.
236 begin data.
237  0.88  300000
238  0.86  320000
239  0.98  480000
240  0.93  960000
241  1.35  960000
242  1.31  960000
243  0.88  960000
244  0.88  1080000
245  0.88  1080000
246  0.95  1200000
247  1.47  1200000
248  0.93  1200000
249  0.98  1320000
250  1.31  1380000
251  0.93  1440000
252  0.88  1560000
253  1.56  1560000
254  1.47  1560000
255 end data.
256
257 weight by w.
258
259
260 EXAMINE
261         x
262         /STATISTICS = DESCRIPTIVES EXTREME (5)
263         .
264 ])
265
266 AT_CHECK([pspp -O format=csv  extreme.sps], [0], [dnl
267 Table: Case Processing Summary
268 ,Cases,,,,,
269 ,Valid,,Missing,,Total,
270 ,N,Percent,N,Percent,N,Percent
271 x,19.430,100%,.000,0%,19.430,100%
272
273 Table: Extreme Values
274 ,,,Case Number,Value
275 x,Highest,1,18,1560000.000
276 ,,2,17,1560000.000
277 ,,3,16,1560000.000
278 ,,4,15,1440000.000
279 ,,5,14,1380000.000
280 ,Lowest,1,1,300000.000
281 ,,2,2,320000.000
282 ,,3,3,480000.000
283 ,,4,4,960000.000
284 ,,5,5,960000.000
285
286 Table: Descriptives
287 ,,,Statistic,Std. Error
288 x,Mean,,1120010.293,86222.178
289 ,95% Confidence Interval for Mean,Lower Bound,939166.693,
290 ,,Upper Bound,1300853.894,
291 ,5% Trimmed Mean,,1141017.899,
292 ,Median,,1200000.000,
293 ,Variance,,144447748124.869,
294 ,Std. Deviation,,380062.821,
295 ,Minimum,,300000.000,
296 ,Maximum,,1560000.000,
297 ,Range,,1260000.000,
298 ,Interquartile Range,,467258.065,
299 ,Skewness,,-.887,.519
300 ,Kurtosis,,.340,1.005
301 ])
302
303 AT_CLEANUP
304
305 dnl Test the PERCENTILES subcommand of the EXAMINE command.
306 dnl In particular test that it behaves properly when there are only 
307 dnl a few cases.
308 AT_SETUP([EXAMINE -- percentiles])
309 AT_DATA([examine.sps], [dnl
310 DATA LIST LIST /X *.
311 BEGIN DATA.
312 2.00 
313 8.00 
314 5.00 
315 END DATA.
316
317 EXAMINE /x
318         /PERCENTILES=HAVERAGE.
319
320 EXAMINE /x
321         /PERCENTILES=WAVERAGE.
322
323 EXAMINE /x
324         /PERCENTILES=ROUND.
325
326 EXAMINE /x
327         /PERCENTILES=EMPIRICAL.
328
329 EXAMINE /x
330         /PERCENTILES=AEMPIRICAL.
331 ])
332 AT_CHECK([pspp -o pspp.csv examine.sps])
333 AT_CHECK([cat pspp.csv], [0], [dnl
334 Table: Reading free-form data from INLINE.
335 Variable,Format
336 X,F8.0
337
338 Table: Case Processing Summary
339 ,Cases,,,,,
340 ,Valid,,Missing,,Total,
341 ,N,Percent,N,Percent,N,Percent
342 X,3,100%,0,0%,3,100%
343
344 Table: Percentiles
345 ,,Percentiles,,,,,,
346 ,,5,10,25,50,75,90,95
347 X,HAverage,.40,.80,2.00,5.00,8.00,8.00,8.00
348 ,Tukey's Hinges,,,3.50,5.00,6.50,,
349
350 Table: Case Processing Summary
351 ,Cases,,,,,
352 ,Valid,,Missing,,Total,
353 ,N,Percent,N,Percent,N,Percent
354 X,3,100%,0,0%,3,100%
355
356 Table: Percentiles
357 ,,Percentiles,,,,,,
358 ,,5,10,25,50,75,90,95
359 X,Weighted Average,.30,.60,1.50,3.50,5.75,7.10,7.55
360 ,Tukey's Hinges,,,3.50,5.00,6.50,,
361
362 Table: Case Processing Summary
363 ,Cases,,,,,
364 ,Valid,,Missing,,Total,
365 ,N,Percent,N,Percent,N,Percent
366 X,3,100%,0,0%,3,100%
367
368 Table: Percentiles
369 ,,Percentiles,,,,,,
370 ,,5,10,25,50,75,90,95
371 X,Rounded,.00,.00,2.00,5.00,5.00,8.00,8.00
372 ,Tukey's Hinges,,,3.50,5.00,6.50,,
373
374 Table: Case Processing Summary
375 ,Cases,,,,,
376 ,Valid,,Missing,,Total,
377 ,N,Percent,N,Percent,N,Percent
378 X,3,100%,0,0%,3,100%
379
380 Table: Percentiles
381 ,,Percentiles,,,,,,
382 ,,5,10,25,50,75,90,95
383 X,Empirical,2.00,2.00,2.00,5.00,8.00,8.00,8.00
384 ,Tukey's Hinges,,,3.50,5.00,6.50,,
385
386 Table: Case Processing Summary
387 ,Cases,,,,,
388 ,Valid,,Missing,,Total,
389 ,N,Percent,N,Percent,N,Percent
390 X,3,100%,0,0%,3,100%
391
392 Table: Percentiles
393 ,,Percentiles,,,,,,
394 ,,5,10,25,50,75,90,95
395 X,Empirical with averaging,2.00,2.00,2.00,5.00,8.00,8.00,8.00
396 ,Tukey's Hinges,,,3.50,5.00,6.50,,
397 ])
398 AT_CLEANUP
399
400 AT_SETUP([EXAMINE -- missing values])
401 AT_DATA([examine.sps], [dnl
402 DATA LIST LIST /x * y *.
403 BEGIN DATA.
404 1   1 
405 2   1
406 3   1
407 4   1
408 5   2
409 6   2
410 .   2
411 END DATA
412
413 EXAMINE /x by y
414         /MISSING = PAIRWISE
415         .
416 ])
417 AT_CHECK([pspp -o pspp.csv examine.sps])
418 AT_CHECK([cat pspp.csv], [0], [dnl
419 Table: Reading free-form data from INLINE.
420 Variable,Format
421 x,F8.0
422 y,F8.0
423
424 Table: Case Processing Summary
425 ,Cases,,,,,
426 ,Valid,,Missing,,Total,
427 ,N,Percent,N,Percent,N,Percent
428 x,6,85.7143%,1,14.2857%,7,100%
429
430 Table: Case Processing Summary
431 ,,Cases,,,,,
432 ,,Valid,,Missing,,Total,
433 ,y,N,Percent,N,Percent,N,Percent
434 x,1.00,4,100%,0,0%,4,100%
435 ,2.00,2,66.6667%,1,33.3333%,3,100%
436 ])
437 AT_CLEANUP
438
439
440 AT_SETUP([EXAMINE -- user missing values])
441 AT_DATA([examine-m.sps], [dnl
442 DATA LIST notable LIST /x * y *.
443 BEGIN DATA.
444 1                   2
445 9999999999          2
446 9999999999          99
447 END DATA.
448
449 MISSING VALUES x (9999999999).
450 MISSING VALUES y (99).
451
452 EXAMINE
453         /VARIABLES= x y
454         /MISSING=PAIRWISE.
455 ])
456 AT_CHECK([pspp -O format=csv examine-m.sps], [0], [dnl
457 Table: Case Processing Summary
458 ,Cases,,,,,
459 ,Valid,,Missing,,Total,
460 ,N,Percent,N,Percent,N,Percent
461 x,1,33.3333%,2,66.6667%,3,100%
462 y,2,66.6667%,1,33.3333%,3,100%
463 ])
464 AT_CLEANUP
465
466 AT_SETUP([EXAMINE -- missing values and percentiles])
467 AT_DATA([examine.sps], [dnl
468 DATA LIST LIST /X *.
469 BEGIN DATA.
470 99
471 99
472 5.00
473 END DATA.
474
475 MISSING VALUE X (99).
476
477 EXAMINE /x
478         /PERCENTILES=HAVERAGE.
479 ])
480 AT_CHECK([pspp -o pspp.csv examine.sps])
481 dnl Ignore output -- this is just a no-crash check.
482 AT_CLEANUP
483
484 dnl Tests the trimmed mean calculation in the case
485 dnl where the data is weighted towards the centre.
486 AT_SETUP([EXAMINE -- trimmed mean])
487 AT_DATA([examine.sps], [dnl
488 DATA LIST LIST /X * C *.
489 BEGIN DATA.
490 1 1
491 2 49
492 3 2
493 END DATA.
494
495 WEIGHT BY c.
496
497 EXAMINE
498         x
499         /STATISTICS=DESCRIPTIVES
500         .
501 ])
502 AT_CHECK([pspp -o pspp.csv examine.sps])
503 AT_CHECK([cat pspp.csv], [0], [dnl
504 Table: Reading free-form data from INLINE.
505 Variable,Format
506 X,F8.0
507 C,F8.0
508
509 Table: Case Processing Summary
510 ,Cases,,,,,
511 ,Valid,,Missing,,Total,
512 ,N,Percent,N,Percent,N,Percent
513 X,52.00,100%,.00,0%,52.00,100%
514
515 Table: Descriptives
516 ,,,Statistic,Std. Error
517 X,Mean,,2.02,.03
518 ,95% Confidence Interval for Mean,Lower Bound,1.95,
519 ,,Upper Bound,2.09,
520 ,5% Trimmed Mean,,2.00,
521 ,Median,,2.00,
522 ,Variance,,.06,
523 ,Std. Deviation,,.24,
524 ,Minimum,,1.00,
525 ,Maximum,,3.00,
526 ,Range,,2.00,
527 ,Interquartile Range,,.00,
528 ,Skewness,,1.19,.33
529 ,Kurtosis,,15.73,.65
530 ])
531 AT_CLEANUP
532
533 AT_SETUP([EXAMINE -- crash bug])
534 AT_DATA([examine.sps], [dnl
535 data list list /a * x * y *.
536 begin data.
537 3 1 3
538 5 1 4
539 7 2 3
540 end data.
541
542 examine a by x by y
543         /statistics=DESCRIPTIVES
544         . 
545 ])
546 AT_CHECK([pspp -o pspp.csv examine.sps])
547 dnl Ignore output -- this is just a no-crash check.
548 AT_CLEANUP
549
550 dnl Test that two consecutive EXAMINE commands don't crash PSPP.
551 AT_SETUP([EXAMINE -- consecutive runs don't crash])
552 AT_DATA([examine.sps], [dnl
553 data list list /y * z *.
554 begin data.
555 6 4
556 5 3
557 7 6
558 end data.
559
560 EXAMINE /VARIABLES= z BY y.
561
562 EXAMINE /VARIABLES= z. 
563 ])
564 AT_CHECK([pspp -o pspp.csv examine.sps])
565 dnl Ignore output -- this is just a no-crash check.
566 AT_CLEANUP
567
568 dnl Test that /DESCRIPTIVES does not crash in presence of missing values.
569 AT_SETUP([EXAMINE -- missing values don't crash])
570 AT_DATA([examine.sps], [dnl
571 data list list /x * y *.
572 begin data.
573 1 0
574 2 0
575 . 0
576 3 1
577 4 1
578 end data.
579 examine x by y /statistics=descriptives. 
580 ])
581 AT_CHECK([pspp -o pspp.csv examine.sps])
582 dnl Ignore output -- this is just a no-crash check.
583 AT_CLEANUP
584
585 dnl Test that having only a single case doesn't crash.
586 AT_SETUP([EXAMINE -- single case doesn't crash])
587 AT_DATA([examine.sps], [dnl
588 DATA LIST LIST /quality * .
589 BEGIN DATA
590 3  
591 END DATA
592
593
594 EXAMINE
595         quality 
596         /STATISTICS descriptives 
597         /PLOT = histogram
598         .
599 ])
600 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
601 dnl Ignore output -- this is just a no-crash check.
602 AT_CLEANUP
603
604 dnl Test that all-missing data doesn't crash.
605 AT_SETUP([EXAMINE -- all-missing data doesn't crash])
606 AT_DATA([examine.sps], [dnl
607 DATA LIST LIST /x *.
608 BEGIN DATA.
609 .
610 .
611 .
612 .
613 END DATA.
614
615 EXAMINE /x PLOT=HISTOGRAM.
616 ])
617 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
618 dnl Ignore output -- this is just a no-crash check.
619 AT_CLEANUP
620
621 dnl Test that big input doesn't crash (bug 11307).
622 AT_SETUP([EXAMINE -- big input doesn't crash])
623 AT_DATA([examine.sps], [dnl
624 INPUT PROGRAM.
625         LOOP #I=1 TO 50000.
626                 COMPUTE X=NORMAL(10).
627                 END CASE.
628         END LOOP.
629         END FILE.
630 END INPUT PROGRAM.
631
632
633 EXAMINE /x
634         /STATISTICS=DESCRIPTIVES.
635 ])
636 AT_CHECK([pspp -o pspp.csv examine.sps])
637 dnl Ignore output -- this is just a no-crash check.
638 AT_CLEANUP
639
640 dnl Another test that big input doesn't crash.
641 dnl The actual bug that this checks for has been lost.
642 AT_SETUP([EXAMINE -- big input doesn't crash 2])
643 AT_DATA([make-big-input.pl], 
644   [for ($i=0; $i<100000; $i++) { print "AB12\n" };
645    for ($i=0; $i<100000; $i++) { print "AB04\n" };
646 ])
647 AT_CHECK([$PERL make-big-input.pl > large.txt])
648 AT_DATA([examine.sps], [dnl
649 DATA LIST FILE='large.txt' /S 1-2 (A) X 3 .
650
651
652 AGGREGATE OUTFILE=* /BREAK=X /A=N.
653
654
655 EXAMINE /A BY X.
656 ])
657 AT_CHECK([pspp -o pspp.csv examine.sps])
658 dnl Ignore output -- this is just a no-crash check.
659 AT_DATA([more-big-input.pl], 
660   [for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" };
661 ])
662 AT_CHECK([$PERL more-big-input.pl >> large.txt])
663 AT_CHECK([pspp -o pspp.csv examine.sps])
664 dnl Ignore output -- this is just a no-crash check.
665 AT_CLEANUP
666
667
668 dnl Test that the ID command works with non-numberic variables
669 AT_SETUP([EXAMINE -- non-numeric ID])
670
671 AT_DATA([examine-id.sps], [dnl
672 data list notable list /x * y (a12).
673 begin data.
674 1  one
675 2  two
676 3  three
677 4  four
678 5  five
679 6  six
680 7  seven
681 8  eight
682 9  nine
683 10 ten
684 11 eleven
685 12 twelve
686 30 thirty
687 300 threehundred
688 end data.
689
690 examine x
691         /statistics = extreme
692         /id = y
693         /plot = boxplot
694         .
695 ])
696
697 AT_CHECK([pspp -O format=csv examine-id.sps], [0], 
698 [Table: Case Processing Summary
699 ,Cases,,,,,
700 ,Valid,,Missing,,Total,
701 ,N,Percent,N,Percent,N,Percent
702 x,14,100%,0,0%,14,100%
703
704 Table: Extreme Values
705 ,,,y,Value
706 x,Highest,1,threehundred,300.00
707 ,,2,thirty      ,30.00
708 ,,3,twelve      ,12.00
709 ,,4,eleven      ,11.00
710 ,,5,ten         ,10.00
711 ,Lowest,1,one         ,1.00
712 ,,2,two         ,2.00
713 ,,3,three       ,3.00
714 ,,4,four        ,4.00
715 ,,5,five        ,5.00
716 ])
717
718 AT_CLEANUP 
719
720 dnl Test for a crash which happened on cleanup from a bad input syntax
721 AT_SETUP([EXAMINE -- Bad Input])
722
723 AT_DATA([examine-bad.sps], [dnl
724 data list list /h * g *.
725 begin data.
726 1 1
727 2 1
728 3 1
729 4 1
730 5 2
731 6 2
732 7 2
733 8 2
734 9 2
735 end data.
736
737 EXAMINE 
738         /VARIABLES= h
739         BY  g
740         /STATISTICS = DESCRIPTIVES EXTREME
741         /PLOT = lkajsdas
742         .
743 ])
744
745 AT_CHECK([pspp -o pspp.csv examine-bad.sps], [1], [ignore])
746
747 AT_CLEANUP 
748
749
750 dnl Check the MISSING=REPORT option
751 AT_SETUP([EXAMINE -- MISSING=REPORT])
752
753
754 AT_DATA([examine-report.sps], [dnl
755 set format = F22.0.
756 data list list /x * g *.
757 begin data.
758 1   1
759 2   1
760 3   1
761 4   1
762 5   1
763 6   1
764 7   1
765 8   1
766 9   1
767 10   2
768 20   2
769 30   2
770 40   2
771 50   2
772 60   2
773 70   2
774 80   2
775 90   2
776 101   9
777 201   9
778 301   9
779 401   9
780 501   99
781 601   99
782 701   99
783 801   99
784 901   99
785 1001  .
786 2002  .
787 3003  .
788 4004  .
789 end data.
790
791 MISSING VALUES g (9, 99, 999).
792
793 EXAMINE
794         /VARIABLES = x
795         BY  g
796         /STATISTICS = EXTREME
797         /NOTOTAL
798         /MISSING = REPORT.
799 ])
800
801
802 AT_CHECK([pspp -O format=csv examine-report.sps], [0], [dnl
803 Table: Reading free-form data from INLINE.
804 Variable,Format
805 x,F8.0
806 g,F8.0
807
808 Table: Case Processing Summary
809 ,,Cases,,,,,
810 ,,Valid,,Missing,,Total,
811 ,g,N,Percent,N,Percent,N,Percent
812 x,. (missing),4,100%,0,0%,4,100%
813 ,1,9,100%,0,0%,9,100%
814 ,2,9,100%,0,0%,9,100%
815 ,9 (missing),4,100%,0,0%,4,100%
816 ,99 (missing),5,100%,0,0%,5,100%
817
818 Table: Extreme Values
819 ,g,,,Case Number,Value
820 x,. (missing),Highest,1,31,4004
821 ,,,2,30,3003
822 ,,,3,29,2002
823 ,,,4,28,1001
824 ,,,5,0,0
825 ,,Lowest,1,28,1001
826 ,,,2,29,2002
827 ,,,3,30,3003
828 ,,,4,31,4004
829 ,,,5,31,4004
830 ,1,Highest,1,9,9
831 ,,,2,8,8
832 ,,,3,7,7
833 ,,,4,6,6
834 ,,,5,5,5
835 ,,Lowest,1,1,1
836 ,,,2,2,2
837 ,,,3,3,3
838 ,,,4,4,4
839 ,,,5,5,5
840 ,2,Highest,1,18,90
841 ,,,2,17,80
842 ,,,3,16,70
843 ,,,4,15,60
844 ,,,5,14,50
845 ,,Lowest,1,10,10
846 ,,,2,11,20
847 ,,,3,12,30
848 ,,,4,13,40
849 ,,,5,14,50
850 ,9 (missing),Highest,1,22,401
851 ,,,2,21,301
852 ,,,3,20,201
853 ,,,4,19,101
854 ,,,5,0,0
855 ,,Lowest,1,19,101
856 ,,,2,20,201
857 ,,,3,21,301
858 ,,,4,22,401
859 ,,,5,22,401
860 ,99 (missing),Highest,1,27,901
861 ,,,2,26,801
862 ,,,3,25,701
863 ,,,4,24,601
864 ,,,5,23,501
865 ,,Lowest,1,23,501
866 ,,,2,24,601
867 ,,,3,25,701
868 ,,,4,26,801
869 ,,,5,27,901
870 ])
871
872
873 AT_CLEANUP