4 AT_DATA([examine.sps], [
5 DATA LIST LIST /QUALITY * W * BRAND * .
27 VARIABLE LABELS brand 'Manufacturer'.
28 VARIABLE LABELS quality 'Breaking Strain'.
30 VALUE LABELS /brand 1 'Aspeger' 2 'Bloggs' 3 'Charlies'.
32 LIST /FORMAT=NUMBERED.
36 /STATISTICS descriptives extreme(3)
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.
50 Case Number,QUALITY,W,BRAND
68 Table: Case Processing Summary
70 ,Valid,,Missing,,Total,
71 ,N,Percent,N,Percent,N,Percent
72 Breaking Strain,24.00,100%,.00,0%,24.00,100%
76 Breaking Strain,Highest,1,12,7.00
84 ,,,Statistic,Std. Error
85 Breaking Strain,Mean,,3.54,.32
86 ,95% Confidence Interval for Mean,Lower Bound,2.87,
88 ,5% Trimmed Mean,,3.50,
91 ,Std. Deviation,,1.59,
95 ,Interquartile Range,,2.75,
99 Table: Case Processing Summary
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%
107 Table: Extreme Values
108 ,Manufacturer,,,Case Number,Value
109 Breaking Strain,Aspeger,Highest,1,6,4.00
115 ,Bloggs,Highest,1,7,5.00
121 ,Charlies,Highest,1,12,7.00
129 ,Manufacturer,,,Statistic,Std. Error
130 Breaking Strain,Aspeger,Mean,,2.25,.45
131 ,,95% Confidence Interval for Mean,Lower Bound,1.18,
133 ,,5% Trimmed Mean,,2.22,
136 ,,Std. Deviation,,1.28,
140 ,,Interquartile Range,,2.75,
142 ,,Kurtosis,,-1.55,1.48
143 ,Bloggs,Mean,,3.50,.38
144 ,,95% Confidence Interval for Mean,Lower Bound,2.61,
146 ,,5% Trimmed Mean,,3.50,
149 ,,Std. Deviation,,1.07,
153 ,,Interquartile Range,,1.75,
155 ,,Kurtosis,,-.83,1.48
156 ,Charlies,Mean,,4.88,.44
157 ,,95% Confidence Interval for Mean,Lower Bound,3.83,
159 ,,5% Trimmed Mean,,4.86,
162 ,,Std. Deviation,,1.25,
166 ,,Interquartile Range,,1.75,
172 AT_SETUP([EXAMINE -- extremes])
173 AT_DATA([examine.sps], [dnl
202 /statistics=extreme(6)
205 AT_CHECK([pspp -o pspp.csv examine.sps])
206 AT_CHECK([cat pspp.csv], [0], [dnl
207 Table: Case Processing Summary
209 ,Valid,,Missing,,Total,
210 ,N,Percent,N,Percent,N,Percent
211 V1,23.00,100%,.00,0%,23.00,100%
213 Table: Extreme Values
215 V1,Highest,1,21,20.00
232 AT_SETUP([EXAMINE -- extremes with fractional weights])
233 AT_DATA([extreme.sps], [dnl
235 data list notable list /w * x *.
262 /STATISTICS = DESCRIPTIVES EXTREME (5)
266 AT_CHECK([pspp -O format=csv extreme.sps], [0], [dnl
267 Table: Case Processing Summary
269 ,Valid,,Missing,,Total,
270 ,N,Percent,N,Percent,N,Percent
271 x,19.430,100%,.000,0%,19.430,100%
273 Table: Extreme Values
275 x,Highest,1,18,1560000.000
280 ,Lowest,1,1,300000.000
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,
298 ,Interquartile Range,,467258.065,
299 ,Skewness,,-.887,.519
300 ,Kurtosis,,.340,1.005
305 dnl Test the PERCENTILES subcommand of the EXAMINE command.
306 dnl In particular test that it behaves properly when there are only
308 AT_SETUP([EXAMINE -- percentiles])
309 AT_DATA([examine.sps], [dnl
318 /PERCENTILES=HAVERAGE.
321 /PERCENTILES=WAVERAGE.
327 /PERCENTILES=EMPIRICAL.
330 /PERCENTILES=AEMPIRICAL.
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.
338 Table: Case Processing Summary
340 ,Valid,,Missing,,Total,
341 ,N,Percent,N,Percent,N,Percent
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,,
350 Table: Case Processing Summary
352 ,Valid,,Missing,,Total,
353 ,N,Percent,N,Percent,N,Percent
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,,
362 Table: Case Processing Summary
364 ,Valid,,Missing,,Total,
365 ,N,Percent,N,Percent,N,Percent
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,,
374 Table: Case Processing Summary
376 ,Valid,,Missing,,Total,
377 ,N,Percent,N,Percent,N,Percent
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,,
386 Table: Case Processing Summary
388 ,Valid,,Missing,,Total,
389 ,N,Percent,N,Percent,N,Percent
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,,
400 AT_SETUP([EXAMINE -- missing values])
401 AT_DATA([examine.sps], [dnl
402 DATA LIST LIST /x * y *.
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.
424 Table: Case Processing Summary
426 ,Valid,,Missing,,Total,
427 ,N,Percent,N,Percent,N,Percent
428 x,6,85.7143%,1,14.2857%,7,100%
430 Table: Case Processing Summary
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%
440 AT_SETUP([EXAMINE -- user missing values])
441 AT_DATA([examine-m.sps], [dnl
442 DATA LIST notable LIST /x * y *.
449 MISSING VALUES x (9999999999).
450 MISSING VALUES y (99).
456 AT_CHECK([pspp -O format=csv examine-m.sps], [0], [dnl
457 Table: Case Processing Summary
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%
466 AT_SETUP([EXAMINE -- missing values and percentiles])
467 AT_DATA([examine.sps], [dnl
475 MISSING VALUE X (99).
478 /PERCENTILES=HAVERAGE.
480 AT_CHECK([pspp -o pspp.csv examine.sps])
481 dnl Ignore output -- this is just a no-crash check.
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 *.
499 /STATISTICS=DESCRIPTIVES
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.
509 Table: Case Processing Summary
511 ,Valid,,Missing,,Total,
512 ,N,Percent,N,Percent,N,Percent
513 X,52.00,100%,.00,0%,52.00,100%
516 ,,,Statistic,Std. Error
518 ,95% Confidence Interval for Mean,Lower Bound,1.95,
520 ,5% Trimmed Mean,,2.00,
523 ,Std. Deviation,,.24,
527 ,Interquartile Range,,.00,
533 AT_SETUP([EXAMINE -- crash bug])
534 AT_DATA([examine.sps], [dnl
535 data list list /a * x * y *.
543 /statistics=DESCRIPTIVES
546 AT_CHECK([pspp -o pspp.csv examine.sps])
547 dnl Ignore output -- this is just a no-crash check.
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 *.
560 EXAMINE /VARIABLES= z BY y.
562 EXAMINE /VARIABLES= z.
564 AT_CHECK([pspp -o pspp.csv examine.sps])
565 dnl Ignore output -- this is just a no-crash check.
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 *.
579 examine x by y /statistics=descriptives.
581 AT_CHECK([pspp -o pspp.csv examine.sps])
582 dnl Ignore output -- this is just a no-crash check.
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 * .
596 /STATISTICS descriptives
600 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
601 dnl Ignore output -- this is just a no-crash check.
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
615 EXAMINE /x PLOT=HISTOGRAM.
617 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
618 dnl Ignore output -- this is just a no-crash check.
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
626 COMPUTE X=NORMAL(10).
634 /STATISTICS=DESCRIPTIVES.
636 AT_CHECK([pspp -o pspp.csv examine.sps])
637 dnl Ignore output -- this is just a no-crash check.
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" };
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 .
652 AGGREGATE OUTFILE=* /BREAK=X /A=N.
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" };
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.
668 dnl Test that the ID command works with non-numberic variables
669 AT_SETUP([EXAMINE -- non-numeric ID])
671 AT_DATA([examine-id.sps], [dnl
672 data list notable list /x * y (a12).
691 /statistics = extreme
697 AT_CHECK([pspp -O format=csv examine-id.sps], [0],
698 [Table: Case Processing Summary
700 ,Valid,,Missing,,Total,
701 ,N,Percent,N,Percent,N,Percent
702 x,14,100%,0,0%,14,100%
704 Table: Extreme Values
706 x,Highest,1,threehundred,300.00
720 dnl Test for a crash which happened on cleanup from a bad input syntax
721 AT_SETUP([EXAMINE -- Bad Input])
723 AT_DATA([examine-bad.sps], [dnl
724 data list list /h * g *.
740 /STATISTICS = DESCRIPTIVES EXTREME
745 AT_CHECK([pspp -o pspp.csv examine-bad.sps], [1], [ignore])
750 dnl Check the MISSING=REPORT option
751 AT_SETUP([EXAMINE -- MISSING=REPORT])
754 AT_DATA([examine-report.sps], [dnl
756 data list list /x * g *.
791 MISSING VALUES g (9, 99, 999).
796 /STATISTICS = EXTREME
802 AT_CHECK([pspp -O format=csv examine-report.sps], [0], [dnl
803 Table: Reading free-form data from INLINE.
808 Table: Case Processing Summary
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%
818 Table: Extreme Values
819 ,g,,,Case Number,Value
820 x,. (missing),Highest,1,31,4004
850 ,9 (missing),Highest,1,22,401
860 ,99 (missing),Highest,1,27,901