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,5,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 *.
340 AT_CHECK([pspp -o pspp.csv examine.sps])
341 AT_CHECK([cat pspp.csv], [0], [dnl
342 Table: Reading free-form data from INLINE.
347 Table: Case Processing Summary
349 ,Valid,,Missing,,Total,
350 ,N,Percent,N,Percent,N,Percent
351 x,6,85.7143%,1,14.2857%,7,100%
353 Table: Case Processing Summary
355 ,,Valid,,Missing,,Total,
356 ,y,N,Percent,N,Percent,N,Percent
357 x,1.00,4,100%,0,0%,4,100%
358 ,2.00,2,66.6667%,1,33.3333%,3,100%
362 AT_SETUP([EXAMINE -- missing values and percentiles])
363 AT_DATA([examine.sps], [dnl
371 MISSING VALUE X (99).
374 /PERCENTILES=HAVERAGE.
376 AT_CHECK([pspp -o pspp.csv examine.sps])
377 dnl Ignore output -- this is just a no-crash check.
380 dnl Tests the trimmed mean calculation in the case
381 dnl where the data is weighted towards the centre.
382 AT_SETUP([EXAMINE -- trimmed mean])
383 AT_DATA([examine.sps], [dnl
384 DATA LIST LIST /X * C *.
395 /STATISTICS=DESCRIPTIVES
398 AT_CHECK([pspp -o pspp.csv examine.sps])
399 AT_CHECK([cat pspp.csv], [0], [dnl
400 Table: Reading free-form data from INLINE.
405 Table: Case Processing Summary
407 ,Valid,,Missing,,Total,
408 ,N,Percent,N,Percent,N,Percent
409 X,52.00,100%,.00,0%,52.00,100%
412 ,,,Statistic,Std. Error
414 ,95% Confidence Interval for Mean,Lower Bound,1.95,
416 ,5% Trimmed Mean,,2.00,
419 ,Std. Deviation,,.24,
423 ,Interquartile Range,,.00,
429 AT_SETUP([EXAMINE -- crash bug])
430 AT_DATA([examine.sps], [dnl
431 data list list /a * x * y *.
439 /statistics=DESCRIPTIVES
442 AT_CHECK([pspp -o pspp.csv examine.sps])
443 dnl Ignore output -- this is just a no-crash check.
446 dnl Test that two consecutive EXAMINE commands don't crash PSPP.
447 AT_SETUP([EXAMINE -- consecutive runs don't crash])
448 AT_DATA([examine.sps], [dnl
449 data list list /y * z *.
456 EXAMINE /VARIABLES= z BY y.
458 EXAMINE /VARIABLES= z.
460 AT_CHECK([pspp -o pspp.csv examine.sps])
461 dnl Ignore output -- this is just a no-crash check.
464 dnl Test that /DESCRIPTIVES does not crash in presence of missing values.
465 AT_SETUP([EXAMINE -- missing values don't crash])
466 AT_DATA([examine.sps], [dnl
467 data list list /x * y *.
475 examine x by y /statistics=descriptives.
477 AT_CHECK([pspp -o pspp.csv examine.sps])
478 dnl Ignore output -- this is just a no-crash check.
481 dnl Test that having only a single case doesn't crash.
482 AT_SETUP([EXAMINE -- single case doesn't crash])
483 AT_DATA([examine.sps], [dnl
484 DATA LIST LIST /quality * .
492 /STATISTICS descriptives
495 AT_CHECK([pspp -o pspp.csv examine.sps])
496 dnl Ignore output -- this is just a no-crash check.
499 dnl Test that all-missing data doesn't crash.
500 AT_SETUP([EXAMINE -- all-missing data doesn't crash])
501 AT_DATA([examine.sps], [dnl
510 EXAMINE /x PLOT=HISTOGRAM.
512 AT_CHECK([pspp -o pspp.csv examine.sps], [0], [dnl
513 warning: Not creating plot because data set is empty.
515 dnl Ignore output -- this is just a no-crash check.
518 dnl Test that big input doesn't crash (bug 11307).
519 AT_SETUP([EXAMINE -- big input doesn't crash])
520 AT_DATA([examine.sps], [dnl
523 COMPUTE X=NORMAL(10).
531 /STATISTICS=DESCRIPTIVES.
533 AT_CHECK([pspp -o pspp.csv examine.sps])
534 dnl Ignore output -- this is just a no-crash check.
537 dnl Another test that big input doesn't crash.
538 dnl The actual bug that this checks for has been lost.
539 AT_SETUP([EXAMINE -- big input doesn't crash 2])
540 AT_DATA([make-big-input.pl],
541 [for ($i=0; $i<100000; $i++) { print "AB12\n" };
542 for ($i=0; $i<100000; $i++) { print "AB04\n" };
544 AT_CHECK([$PERL make-big-input.pl > large.txt])
545 AT_DATA([examine.sps], [dnl
546 DATA LIST FILE='large.txt' /S 1-2 (A) X 3 .
549 AGGREGATE OUTFILE=* /BREAK=X /A=N.
554 AT_CHECK([pspp -o pspp.csv examine.sps])
555 dnl Ignore output -- this is just a no-crash check.
556 AT_DATA([more-big-input.pl],
557 [for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" };
559 AT_CHECK([$PERL more-big-input.pl >> large.txt])
560 AT_CHECK([pspp -o pspp.csv examine.sps])
561 dnl Ignore output -- this is just a no-crash check.