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
230 dnl Test the PERCENTILES subcommand of the EXAMINE command.
231 dnl In particular test that it behaves properly when there are only
233 AT_SETUP([EXAMINE -- percentiles])
234 AT_DATA([examine.sps], [dnl
243 /PERCENTILES=HAVERAGE.
246 /PERCENTILES=WAVERAGE.
252 /PERCENTILES=EMPIRICAL.
255 /PERCENTILES=AEMPIRICAL.
257 AT_CHECK([pspp -o pspp.csv examine.sps])
258 AT_CHECK([cat pspp.csv], [0], [dnl
259 Table: Reading free-form data from INLINE.
263 Table: Case Processing Summary
265 ,Valid,,Missing,,Total,
266 ,N,Percent,N,Percent,N,Percent
271 ,,5,10,25,50,75,90,95
272 X,HAverage,.40,.80,2.00,5.00,8.00,8.00,8.00
273 ,Tukey's Hinges,,,3.50,5.00,6.50,,
275 Table: Case Processing Summary
277 ,Valid,,Missing,,Total,
278 ,N,Percent,N,Percent,N,Percent
283 ,,5,10,25,50,75,90,95
284 X,Weighted Average,.30,.60,1.50,3.50,5.75,7.10,7.55
285 ,Tukey's Hinges,,,3.50,5.00,6.50,,
287 Table: Case Processing Summary
289 ,Valid,,Missing,,Total,
290 ,N,Percent,N,Percent,N,Percent
295 ,,5,10,25,50,75,90,95
296 X,Rounded,.00,.00,2.00,5.00,5.00,8.00,8.00
297 ,Tukey's Hinges,,,3.50,5.00,6.50,,
299 Table: Case Processing Summary
301 ,Valid,,Missing,,Total,
302 ,N,Percent,N,Percent,N,Percent
307 ,,5,10,25,50,75,90,95
308 X,Empirical,2.00,2.00,2.00,5.00,8.00,8.00,8.00
309 ,Tukey's Hinges,,,3.50,5.00,6.50,,
311 Table: Case Processing Summary
313 ,Valid,,Missing,,Total,
314 ,N,Percent,N,Percent,N,Percent
319 ,,5,10,25,50,75,90,95
320 X,Empirical with averaging,2.00,2.00,2.00,5.00,8.00,8.00,8.00
321 ,Tukey's Hinges,,,3.50,5.00,6.50,,
325 AT_SETUP([EXAMINE -- missing values])
326 AT_DATA([examine.sps], [dnl
327 DATA LIST LIST /x * y *.
342 AT_CHECK([pspp -o pspp.csv examine.sps])
343 AT_CHECK([cat pspp.csv], [0], [dnl
344 Table: Reading free-form data from INLINE.
349 Table: Case Processing Summary
351 ,Valid,,Missing,,Total,
352 ,N,Percent,N,Percent,N,Percent
353 x,6,85.7143%,1,14.2857%,7,100%
355 Table: Case Processing Summary
357 ,,Valid,,Missing,,Total,
358 ,y,N,Percent,N,Percent,N,Percent
359 x,1.00,4,100%,0,0%,4,100%
360 ,2.00,2,66.6667%,1,33.3333%,3,100%
365 AT_SETUP([EXAMINE -- user missing values])
366 AT_DATA([examine-m.sps], [dnl
367 DATA LIST notable LIST /x * y *.
374 MISSING VALUES x (9999999999).
375 MISSING VALUES y (99).
381 AT_CHECK([pspp -O format=csv examine-m.sps], [0], [dnl
382 Table: Case Processing Summary
384 ,Valid,,Missing,,Total,
385 ,N,Percent,N,Percent,N,Percent
386 x,1,33.3333%,2,66.6667%,3,100%
387 y,2,66.6667%,1,33.3333%,3,100%
391 AT_SETUP([EXAMINE -- missing values and percentiles])
392 AT_DATA([examine.sps], [dnl
400 MISSING VALUE X (99).
403 /PERCENTILES=HAVERAGE.
405 AT_CHECK([pspp -o pspp.csv examine.sps])
406 dnl Ignore output -- this is just a no-crash check.
409 dnl Tests the trimmed mean calculation in the case
410 dnl where the data is weighted towards the centre.
411 AT_SETUP([EXAMINE -- trimmed mean])
412 AT_DATA([examine.sps], [dnl
413 DATA LIST LIST /X * C *.
424 /STATISTICS=DESCRIPTIVES
427 AT_CHECK([pspp -o pspp.csv examine.sps])
428 AT_CHECK([cat pspp.csv], [0], [dnl
429 Table: Reading free-form data from INLINE.
434 Table: Case Processing Summary
436 ,Valid,,Missing,,Total,
437 ,N,Percent,N,Percent,N,Percent
438 X,52.00,100%,.00,0%,52.00,100%
441 ,,,Statistic,Std. Error
443 ,95% Confidence Interval for Mean,Lower Bound,1.95,
445 ,5% Trimmed Mean,,2.00,
448 ,Std. Deviation,,.24,
452 ,Interquartile Range,,.00,
458 AT_SETUP([EXAMINE -- crash bug])
459 AT_DATA([examine.sps], [dnl
460 data list list /a * x * y *.
468 /statistics=DESCRIPTIVES
471 AT_CHECK([pspp -o pspp.csv examine.sps])
472 dnl Ignore output -- this is just a no-crash check.
475 dnl Test that two consecutive EXAMINE commands don't crash PSPP.
476 AT_SETUP([EXAMINE -- consecutive runs don't crash])
477 AT_DATA([examine.sps], [dnl
478 data list list /y * z *.
485 EXAMINE /VARIABLES= z BY y.
487 EXAMINE /VARIABLES= z.
489 AT_CHECK([pspp -o pspp.csv examine.sps])
490 dnl Ignore output -- this is just a no-crash check.
493 dnl Test that /DESCRIPTIVES does not crash in presence of missing values.
494 AT_SETUP([EXAMINE -- missing values don't crash])
495 AT_DATA([examine.sps], [dnl
496 data list list /x * y *.
504 examine x by y /statistics=descriptives.
506 AT_CHECK([pspp -o pspp.csv examine.sps])
507 dnl Ignore output -- this is just a no-crash check.
510 dnl Test that having only a single case doesn't crash.
511 AT_SETUP([EXAMINE -- single case doesn't crash])
512 AT_DATA([examine.sps], [dnl
513 DATA LIST LIST /quality * .
521 /STATISTICS descriptives
525 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
526 dnl Ignore output -- this is just a no-crash check.
529 dnl Test that all-missing data doesn't crash.
530 AT_SETUP([EXAMINE -- all-missing data doesn't crash])
531 AT_DATA([examine.sps], [dnl
540 EXAMINE /x PLOT=HISTOGRAM.
542 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore])
543 dnl Ignore output -- this is just a no-crash check.
546 dnl Test that big input doesn't crash (bug 11307).
547 AT_SETUP([EXAMINE -- big input doesn't crash])
548 AT_DATA([examine.sps], [dnl
551 COMPUTE X=NORMAL(10).
559 /STATISTICS=DESCRIPTIVES.
561 AT_CHECK([pspp -o pspp.csv examine.sps])
562 dnl Ignore output -- this is just a no-crash check.
565 dnl Another test that big input doesn't crash.
566 dnl The actual bug that this checks for has been lost.
567 AT_SETUP([EXAMINE -- big input doesn't crash 2])
568 AT_DATA([make-big-input.pl],
569 [for ($i=0; $i<100000; $i++) { print "AB12\n" };
570 for ($i=0; $i<100000; $i++) { print "AB04\n" };
572 AT_CHECK([$PERL make-big-input.pl > large.txt])
573 AT_DATA([examine.sps], [dnl
574 DATA LIST FILE='large.txt' /S 1-2 (A) X 3 .
577 AGGREGATE OUTFILE=* /BREAK=X /A=N.
582 AT_CHECK([pspp -o pspp.csv examine.sps])
583 dnl Ignore output -- this is just a no-crash check.
584 AT_DATA([more-big-input.pl],
585 [for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" };
587 AT_CHECK([$PERL more-big-input.pl >> large.txt])
588 AT_CHECK([pspp -o pspp.csv examine.sps])
589 dnl Ignore output -- this is just a no-crash check.
593 dnl Test that the ID command works with non-numberic variables
594 AT_SETUP([EXAMINE -- non-numeric ID])
596 AT_DATA([examine-id.sps], [dnl
597 data list notable list /x * y (a12).
616 /statistics = extreme
622 AT_CHECK([pspp -O format=csv examine-id.sps], [0],
623 [Table: Case Processing Summary
625 ,Valid,,Missing,,Total,
626 ,N,Percent,N,Percent,N,Percent
627 x,14,100%,0,0%,14,100%
629 Table: Extreme Values
631 x,Highest,1,threehundred,300.00
645 dnl Test for a crash which happened on cleanup from a bad input syntax
646 AT_SETUP([EXAMINE -- Bad Input])
648 AT_DATA([examine-bad.sps], [dnl
649 data list list /h * g *.
665 /STATISTICS = DESCRIPTIVES EXTREME
670 AT_CHECK([pspp -o pspp.csv examine-bad.sps], [1], [ignore])
675 dnl Check the MISSING=REPORT option
676 AT_SETUP([EXAMINE -- MISSING=REPORT])
679 AT_DATA([examine-report.sps], [dnl
681 data list list /x * g *.
716 MISSING VALUES g (9, 99, 999).
721 /STATISTICS = EXTREME
727 AT_CHECK([pspp -O format=csv examine-report.sps], [0], [dnl
728 Table: Reading free-form data from INLINE.
733 Table: Case Processing Summary
735 ,,Valid,,Missing,,Total,
736 ,g,N,Percent,N,Percent,N,Percent
737 x,. (missing),4,100%,0,0%,4,100%
738 ,1,9,100%,0,0%,9,100%
739 ,2,9,100%,0,0%,9,100%
740 ,9 (missing),4,100%,0,0%,4,100%
741 ,99 (missing),5,100%,0,0%,5,100%
743 Table: Extreme Values
744 ,g,,,Case Number,Value
745 x,. (missing),Highest,1,31,4004
775 ,9 (missing),Highest,1,22,401
785 ,99 (missing),Highest,1,27,901