fbe9df6e3a8801bee63ea6c074ae9e85067d0a46
[pspp] / tests / language / stats / crosstabs.at
1 AT_BANNER([CROSSTABS procedure])
2
3 AT_SETUP([CROSSTABS integer mode crash])
4 AT_DATA([crosstabs.sps],
5   [DATA LIST LIST /A * B * X * Y * .
6 BEGIN DATA.
7 2 3 4 5
8 END DATA.
9
10 CROSSTABS VARIABLES X (1,7) Y (1,7) /TABLES X BY Y.
11 ])
12 AT_CHECK([pspp -O format=csv crosstabs.sps], [0], 
13   [[Table: Reading free-form data from INLINE.
14 Variable,Format
15 A,F8.0
16 B,F8.0
17 X,F8.0
18 Y,F8.0
19
20 Table: Summary.
21 ,Cases,,,,,
22 ,Valid,,Missing,,Total,
23 ,N,Percent,N,Percent,N,Percent
24 X * Y,1,100.0%,0,0.0%,1,100.0%
25
26 Table: X * Y [count].
27 ,Y,,,,,,,
28 X,1.00,2.00,3.00,4.00,5.00,6.00,7.00,Total
29 1.00,.00,.00,.00,.00,.00,.00,.00,.00
30 2.00,.00,.00,.00,.00,.00,.00,.00,.00
31 3.00,.00,.00,.00,.00,.00,.00,.00,.00
32 4.00,.00,.00,.00,.00,1.00,.00,.00,1.00
33 5.00,.00,.00,.00,.00,.00,.00,.00,.00
34 6.00,.00,.00,.00,.00,.00,.00,.00,.00
35 7.00,.00,.00,.00,.00,.00,.00,.00,.00
36 Total,.00,.00,.00,.00,1.00,.00,.00,1.00
37 ]])
38 AT_CLEANUP
39
40 # Bug #22037.
41 AT_SETUP([CROSSTABS long string crash])
42 AT_DATA([crosstabs.sps],
43   [data list list /x * y (a18).
44
45 begin data.
46
47    1. 'zero none'
48
49 1 'one unity'
50 2 'two duality'
51 3 'three lots'
52 end data.
53
54 CROSSTABS /TABLES = x BY y.
55 ])
56 AT_CHECK([pspp -o - -O format=csv crosstabs.sps], [0],
57   [[Table: Reading free-form data from INLINE.
58 Variable,Format
59 x,F8.0
60 y,A18
61
62 "crosstabs.sps:4: warning: Missing value(s) for all variables from x onward.  These will be filled with the system-missing value or blanks, as appropriate."
63
64 "crosstabs.sps:6: warning: Missing value(s) for all variables from x onward.  These will be filled with the system-missing value or blanks, as appropriate."
65
66 Table: Summary.
67 ,Cases,,,,,
68 ,Valid,,Missing,,Total,
69 ,N,Percent,N,Percent,N,Percent
70 x * y,4,66.7%,2,33.3%,6,100.0%
71
72 Table: x * y [count].
73 ,y,,,,
74 x,one unity         ,three lots        ,two duality       ,zero none         ,Total
75 1.00,1.00,.00,.00,1.00,2.00
76 2.00,.00,.00,1.00,.00,1.00
77 3.00,.00,1.00,.00,.00,1.00
78 Total,1.00,1.00,1.00,1.00,4.00
79 ]])
80 AT_CLEANUP
81
82 AT_SETUP([CROSSTABS crash])
83 AT_DATA([crosstabs.sps],
84   [[DATA LIST FIXED
85      / x   1-2
86        y   3
87        z   4.
88
89 BEGIN DATA.
90 0111 
91 0222 
92 0311 
93 0412 
94 0521 
95 0612 
96 0711 
97 0811 
98 0912 
99 END DATA.
100
101 LIST.
102
103
104 CROSSTABS TABLES  y by z.
105 ]])
106 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
107   [[Table: Reading 1 record from INLINE.
108 Variable,Record,Columns,Format
109 x,1,1-  2,F2.0
110 y,1,3-  3,F1.0
111 z,1,4-  4,F1.0
112
113 Table: Data List
114 x,y,z
115 1,1,1
116 2,2,2
117 3,1,1
118 4,1,2
119 5,2,1
120 6,1,2
121 7,1,1
122 8,1,1
123 9,1,2
124
125 Table: Summary.
126 ,Cases,,,,,
127 ,Valid,,Missing,,Total,
128 ,N,Percent,N,Percent,N,Percent
129 y * z,9,100.0%,0,0.0%,9,100.0%
130
131 Table: y * z [count].
132 ,z,,
133 y,1,2,Total
134 1,4.00,3.00,7.00
135 2,1.00,1.00,2.00
136 Total,5.00,4.00,9.00
137 ]])
138 AT_CLEANUP
139
140 # Bug #26739, which caused CROSSTABS to crash or to fail to output
141 # chi-square results.
142 AT_SETUP([CROSSTABS chi-square crash])
143 AT_DATA([crosstabs.sps],
144   [[DATA LIST LIST /x * y *.
145 BEGIN DATA.
146 2 2
147 3 1
148 4 2
149 4 1
150 END DATA.
151
152 CROSSTABS
153         /TABLES= x BY y
154         /STATISTICS=CHISQ.
155 ]])
156 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
157   [[Table: Reading free-form data from INLINE.
158 Variable,Format
159 x,F8.0
160 y,F8.0
161
162 Table: Summary.
163 ,Cases,,,,,
164 ,Valid,,Missing,,Total,
165 ,N,Percent,N,Percent,N,Percent
166 x * y,4,100.0%,0,0.0%,4,100.0%
167
168 Table: x * y [count].
169 ,y,,
170 x,1.00,2.00,Total
171 2.00,.00,1.00,1.00
172 3.00,1.00,.00,1.00
173 4.00,1.00,1.00,2.00
174 Total,2.00,2.00,4.00
175
176 Table: Chi-square tests.
177 Statistic,Value,df,Asymp. Sig. (2-tailed)
178 Pearson Chi-Square,2.00,2,.37
179 Likelihood Ratio,2.77,2,.25
180 Linear-by-Linear Association,.27,1,.60
181 N of Valid Cases,4,,
182 ]])
183 AT_CLEANUP
184
185 # Bug #27883.
186 AT_SETUP([CROSSTABS crash with SPLIT FILE])
187 AT_DATA([crosstabs.sps],
188   [data list notable / v0 to v2 1-6 (A)
189 begin data.
190 a c e
191 a c e
192 a c e
193 a d e
194 a d f
195 b d f
196 b d f
197 b c f
198 b d e
199 a c f
200 end data.
201 SORT CASES BY v0.
202 SPLIT FILE SEPARATE BY v0.
203
204 CROSSTABS
205     /TABLES= v1 BY v2
206     /FORMAT=AVALUE TABLES PIVOT
207     /STATISTICS=CHISQ
208     /CELLS=COUNT ROW COLUMN TOTAL.
209 ])
210 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
211   [[Variable,Value,Label
212 v0,a ,
213
214 Table: Summary.
215 ,Cases,,,,,
216 ,Valid,,Missing,,Total,
217 ,N,Percent,N,Percent,N,Percent
218 v1 * v2,6,100.0%,0,0.0%,6,100.0%
219
220 "Table: v1 * v2 [count, row %, column %, total %]."
221 ,v2,,
222 v1,e ,f ,Total
223 c ,3.00,1.00,4.00
224 ,75.00%,25.00%,100.00%
225 ,75.00%,50.00%,66.67%
226 ,50.00%,16.67%,66.67%
227 d ,1.00,1.00,2.00
228 ,50.00%,50.00%,100.00%
229 ,25.00%,50.00%,33.33%
230 ,16.67%,16.67%,33.33%
231 Total,4.00,2.00,6.00
232 ,66.67%,33.33%,100.00%
233 ,100.00%,100.00%,100.00%
234 ,66.67%,33.33%,100.00%
235
236 Table: Chi-square tests.
237 Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
238 Pearson Chi-Square,.38,1,.54,,
239 Likelihood Ratio,.37,1,.54,,
240 Fisher's Exact Test,,,,1.00,.60
241 Continuity Correction,.00,1,1.00,,
242 N of Valid Cases,6,,,,
243
244 Variable,Value,Label
245 v0,b ,
246
247 Table: Summary.
248 ,Cases,,,,,
249 ,Valid,,Missing,,Total,
250 ,N,Percent,N,Percent,N,Percent
251 v1 * v2,4,100.0%,0,0.0%,4,100.0%
252
253 "Table: v1 * v2 [count, row %, column %, total %]."
254 ,v2,,
255 v1,e ,f ,Total
256 c ,.00,1.00,1.00
257 ,.00%,100.00%,100.00%
258 ,.00%,33.33%,25.00%
259 ,.00%,25.00%,25.00%
260 d ,1.00,2.00,3.00
261 ,33.33%,66.67%,100.00%
262 ,100.00%,66.67%,75.00%
263 ,25.00%,50.00%,75.00%
264 Total,1.00,3.00,4.00
265 ,25.00%,75.00%,100.00%
266 ,100.00%,100.00%,100.00%
267 ,25.00%,75.00%,100.00%
268
269 Table: Chi-square tests.
270 Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
271 Pearson Chi-Square,.44,1,.50,,
272 Likelihood Ratio,.68,1,.41,,
273 Fisher's Exact Test,,,,1.00,.75
274 Continuity Correction,.00,1,1.00,,
275 N of Valid Cases,4,,,,
276 ]])
277 AT_CLEANUP
278
279 # Bug #24752.
280 AT_SETUP([3-way CROSSTABS])
281 AT_DATA([crosstabs.sps],
282   [[DATA LIST FIXED
283      / x   1-2
284        y   3
285        z   4.
286
287 BEGIN DATA.
288 0111 
289 0222 
290 0311 
291 0412 
292 0521 
293 0612 
294 0711 
295 0811 
296 0912 
297 END DATA.
298
299 LIST.
300
301
302 CROSSTABS TABLES  x BY y BY z/STATISTICS=ALL.
303 ]])
304 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
305   [[Table: Reading 1 record from INLINE.
306 Variable,Record,Columns,Format
307 x,1,1-  2,F2.0
308 y,1,3-  3,F1.0
309 z,1,4-  4,F1.0
310
311 Table: Data List
312 x,y,z
313 1,1,1
314 2,2,2
315 3,1,1
316 4,1,2
317 5,2,1
318 6,1,2
319 7,1,1
320 8,1,1
321 9,1,2
322
323 Table: Summary.
324 ,Cases,,,,,
325 ,Valid,,Missing,,Total,
326 ,N,Percent,N,Percent,N,Percent
327 x * y * z,9,100.0%,0,0.0%,9,100.0%
328
329 Table: x * y * z [count].
330 z,,y,,
331 ,x,1,2,Total
332 1,1,1.00,.00,1.00
333 ,3,1.00,.00,1.00
334 ,5,.00,1.00,1.00
335 ,7,1.00,.00,1.00
336 ,8,1.00,.00,1.00
337 Total,,4.00,1.00,5.00
338 2,2,.00,1.00,1.00
339 ,4,1.00,.00,1.00
340 ,6,1.00,.00,1.00
341 ,9,1.00,.00,1.00
342 Total,,3.00,1.00,4.00
343
344 Table: Chi-square tests.
345 z,Statistic,Value,df,Asymp. Sig. (2-tailed)
346 1,Pearson Chi-Square,5.00,4,.29
347 ,Likelihood Ratio,5.00,4,.29
348 ,Linear-by-Linear Association,.01,1,.94
349 ,N of Valid Cases,5,,
350 2,Pearson Chi-Square,4.00,3,.26
351 ,Likelihood Ratio,4.50,3,.21
352 ,Linear-by-Linear Association,1.58,1,.21
353 ,N of Valid Cases,4,,
354
355 Table: Symmetric measures.
356 z,Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
357 1,Nominal by Nominal,Phi,1.00,,,
358 ,,Cramer's V,1.00,,,
359 ,,Contingency Coefficient,.71,,,
360 ,Ordinal by Ordinal,Kendall's tau-b,.00,.32,.00,
361 ,,Kendall's tau-c,.00,.32,.00,
362 ,,Gamma,.00,.50,.00,
363 ,,Spearman Correlation,.00,.22,.00,
364 ,Interval by Interval,Pearson's R,.04,.22,.18,
365 ,N of Valid Cases,,5,,,
366 2,Nominal by Nominal,Phi,1.00,,,
367 ,,Cramer's V,1.00,,,
368 ,,Contingency Coefficient,.71,,,
369 ,Ordinal by Ordinal,Kendall's tau-b,-.71,.20,-1.73,
370 ,,Kendall's tau-c,-.75,.43,-1.73,
371 ,,Gamma,-1.00,.00,-1.73,
372 ,,Spearman Correlation,-.77,.17,-6.77,
373 ,Interval by Interval,Pearson's R,-.73,.18,-5.49,
374 ,N of Valid Cases,,4,,,
375
376 Table: Directional measures.
377 z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
378 1,Nominal by Nominal,Lambda,Symmetric,.40,.28,1.02,
379 ,,,x Dependent,.25,NaN,1.12,
380 ,,,y Dependent,1.00,NaN,1.12,
381 ,,Goodman and Kruskal tau,x Dependent,.25,,,
382 ,,,y Dependent,1.00,,,
383 ,,Uncertainty Coefficient,Symmetric,.47,.18,1.51,
384 ,,,x Dependent,.31,.15,2.02,
385 ,,,y Dependent,1.00,.00,2.02,
386 ,Ordinal by Ordinal,Somers' d,Symmetric,.00,.09,.00,
387 ,,,x Dependent,.00,.50,.00,
388 ,,,y Dependent,.00,.20,.00,
389 ,Nominal by Interval,Eta,x Dependent,.04,,,
390 ,,,y Dependent,1.00,,,
391 2,Nominal by Nominal,Lambda,Symmetric,.50,.25,1.51,
392 ,,,x Dependent,.33,NaN,1.15,
393 ,,,y Dependent,1.00,NaN,1.15,
394 ,,Goodman and Kruskal tau,x Dependent,.33,,,
395 ,,,y Dependent,1.00,,,
396 ,,Uncertainty Coefficient,Symmetric,.58,.17,1.56,
397 ,,,x Dependent,.41,.17,2.36,
398 ,,,y Dependent,1.00,.00,2.36,
399 ,Ordinal by Ordinal,Somers' d,Symmetric,-.67,.04,-1.73,
400 ,,,x Dependent,-1.00,.00,-1.73,
401 ,,,y Dependent,-.50,.29,-1.73,
402 ,Nominal by Interval,Eta,x Dependent,.73,,,
403 ,,,y Dependent,1.00,,,
404 ]])
405 AT_CLEANUP
406
407
408
409 AT_SETUP([CROSSTABS descending sort order])
410 AT_DATA([crosstabs-descending.sps],
411   [[DATA LIST NOTABLE LIST /x * y *.
412 BEGIN DATA.
413 2 2
414 2 2
415 3 1
416 4 1
417 3 2
418 3 2
419 END DATA.
420
421 CROSSTABS
422         /TABLES= x BY y
423         /FORMAT = DVALUE.
424 ]])
425
426 AT_CHECK([pspp -O format=csv crosstabs-descending.sps], [0],
427   [[Table: Summary.
428 ,Cases,,,,,
429 ,Valid,,Missing,,Total,
430 ,N,Percent,N,Percent,N,Percent
431 x * y,6,100.0%,0,0.0%,6,100.0%
432
433 Table: x * y [count].
434 ,y,,
435 x,2.00,1.00,Total
436 4.00,.00,1.00,1.00
437 3.00,2.00,1.00,3.00
438 2.00,2.00,.00,2.00
439 Total,4.00,2.00,6.00
440 ]])
441 AT_CLEANUP
442
443 # Bug #31260.
444 AT_SETUP([CROSSTABS crash when all cases missing])
445 AT_DATA([crosstabs.sps], [dnl
446 DATA LIST LIST NOTABLE /X1 X2.
447 BEGIN DATA.
448 1 1
449 END DATA.
450
451 MISSING VALUES x2 (1).
452
453 CROSSTABS /TABLES= X1 by X2.
454 ])
455 AT_CHECK([pspp -O format=csv crosstabs.sps], [0], [dnl
456 Table: Summary.
457 ,Cases,,,,,
458 ,Valid,,Missing,,Total,
459 ,N,Percent,N,Percent,N,Percent
460 X1 * X2,0,0.0%,1,100.0%,1,100.0%
461
462 crosstabs.sps:8: warning: CROSSTABS: Crosstabulation X1 * X2 contained no non-missing cases.
463 ])
464 AT_CLEANUP
465
466
467
468 dnl This example comes from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm#chisq
469 AT_SETUP([CROSSTABS Fisher Exact Test])
470
471 AT_DATA([fisher-exact.sps], [dnl
472 SET FORMAT F12.3.
473 SET DECIMAL DOT.
474
475 DATA LIST notable LIST  /schtyp (F9.2) female (F9.2) ses (F9.2) .
476 begin data.
477       1.00       .00      1.00 
478       1.00      1.00      2.00 
479       1.00       .00      3.00 
480       1.00       .00      3.00 
481       1.00       .00      2.00 
482       1.00       .00      2.00 
483       1.00       .00      2.00 
484       1.00       .00      2.00 
485       1.00       .00      2.00 
486       1.00       .00      2.00 
487       1.00       .00      2.00 
488       1.00       .00      2.00 
489       1.00       .00      3.00 
490       1.00       .00      3.00 
491       1.00       .00      1.00 
492       1.00       .00      1.00 
493       1.00       .00      3.00 
494       2.00       .00      2.00 
495       1.00       .00      3.00 
496       1.00       .00      2.00 
497       1.00       .00      2.00 
498       1.00       .00      2.00 
499       1.00       .00      2.00 
500       1.00       .00      3.00 
501       1.00       .00      2.00 
502       1.00       .00      2.00 
503       1.00       .00      3.00 
504       2.00       .00      2.00 
505       2.00       .00      3.00 
506       1.00       .00      1.00 
507       1.00       .00      2.00 
508       1.00       .00      3.00 
509       2.00       .00      3.00 
510       1.00       .00      2.00 
511       2.00       .00      3.00 
512       1.00       .00      3.00 
513       2.00       .00      2.00 
514       1.00       .00      3.00 
515       1.00       .00      1.00 
516       1.00       .00      2.00 
517       2.00       .00      2.00 
518       2.00       .00      2.00 
519       1.00       .00      2.00 
520       1.00       .00      1.00 
521       1.00       .00      3.00 
522       1.00       .00      1.00 
523       1.00       .00      3.00 
524       1.00       .00      2.00 
525       2.00       .00      2.00 
526       1.00       .00      2.00 
527       1.00       .00      2.00 
528       1.00       .00      3.00 
529       1.00       .00      2.00 
530       2.00       .00      2.00 
531       1.00       .00      2.00 
532       1.00       .00      3.00 
533       1.00       .00      1.00 
534       1.00       .00      2.00 
535       2.00       .00      2.00 
536       1.00       .00      2.00 
537       2.00       .00      2.00 
538       1.00       .00      3.00 
539       1.00       .00      1.00 
540       1.00       .00      2.00 
541       2.00       .00      3.00 
542       1.00       .00      2.00 
543       1.00       .00      2.00 
544       1.00       .00      1.00 
545       1.00       .00      1.00 
546       1.00       .00      2.00 
547       1.00       .00      2.00 
548       1.00       .00      3.00 
549       1.00       .00      2.00 
550       1.00       .00      2.00 
551       1.00       .00      2.00 
552       1.00       .00      1.00 
553       1.00       .00      3.00 
554       1.00       .00      3.00 
555       1.00       .00      2.00 
556       1.00       .00      3.00 
557       1.00       .00      3.00 
558       1.00       .00      1.00 
559       2.00       .00      2.00 
560       1.00       .00      1.00 
561       1.00       .00      2.00 
562       1.00       .00      3.00 
563       1.00       .00      3.00 
564       1.00       .00      3.00 
565       1.00       .00      2.00 
566       1.00       .00      3.00 
567       1.00       .00      2.00 
568       1.00       .00      1.00 
569       1.00      1.00      3.00 
570       1.00      1.00      1.00 
571       1.00      1.00      1.00 
572       1.00      1.00      1.00 
573       1.00      1.00      2.00 
574       1.00      1.00      3.00 
575       1.00      1.00      1.00 
576       2.00      1.00      3.00 
577       1.00      1.00      3.00 
578       1.00      1.00      3.00 
579       1.00      1.00      1.00 
580       1.00      1.00      3.00 
581       1.00      1.00      2.00 
582       1.00      1.00      2.00 
583       1.00      1.00      3.00 
584       1.00      1.00      1.00 
585       2.00      1.00      1.00 
586       2.00      1.00      3.00 
587       1.00      1.00      2.00 
588       1.00      1.00      1.00 
589       1.00      1.00      3.00 
590       1.00      1.00      1.00 
591       2.00      1.00      3.00 
592       1.00      1.00      2.00 
593       1.00      1.00      3.00 
594       1.00      1.00      3.00 
595       1.00      1.00      1.00 
596       1.00      1.00      1.00 
597       2.00      1.00      1.00 
598       1.00      1.00      2.00 
599       1.00      1.00      2.00 
600       1.00      1.00      2.00 
601       1.00      1.00      1.00 
602       1.00      1.00      3.00 
603       1.00      1.00      2.00 
604       1.00      1.00      2.00 
605       1.00      1.00      3.00 
606       1.00      1.00      1.00 
607       1.00      1.00      2.00 
608       1.00      1.00      1.00 
609       1.00      1.00      2.00 
610       1.00      1.00      2.00 
611       1.00      1.00      1.00 
612       1.00      1.00      3.00 
613       2.00      1.00      2.00 
614       1.00      1.00      2.00 
615       1.00      1.00      2.00 
616       2.00      1.00      2.00 
617       1.00      1.00      1.00 
618       1.00      1.00      3.00 
619       1.00      1.00      2.00 
620       1.00      1.00      2.00 
621       1.00      1.00      2.00 
622       2.00      1.00      3.00 
623       1.00      1.00      2.00 
624       2.00      1.00      2.00 
625       1.00      1.00      1.00 
626       1.00      1.00      1.00 
627       1.00      1.00      1.00 
628       1.00      1.00      3.00 
629       1.00      1.00      2.00 
630       1.00      1.00      2.00 
631       1.00      1.00      2.00 
632       1.00      1.00      2.00 
633       1.00      1.00      2.00 
634       1.00      1.00      2.00 
635       1.00      1.00      2.00 
636       1.00      1.00      3.00 
637       1.00      1.00      1.00 
638       1.00      1.00      2.00 
639       2.00      1.00      3.00 
640       1.00      1.00      1.00 
641       1.00      1.00      2.00 
642       1.00      1.00      1.00 
643       1.00      1.00      2.00 
644       1.00      1.00      1.00 
645       2.00      1.00      2.00 
646       1.00      1.00      1.00 
647       1.00      1.00      1.00 
648       1.00      1.00      2.00 
649       1.00      1.00      3.00 
650       1.00      1.00      3.00 
651       1.00      1.00      1.00 
652       1.00      1.00      1.00 
653       1.00      1.00      2.00 
654       1.00      1.00      2.00 
655       1.00      1.00      3.00 
656       1.00      1.00      1.00 
657       1.00      1.00      2.00 
658       2.00      1.00      2.00 
659       1.00      1.00      3.00 
660       1.00      1.00      2.00 
661       1.00      1.00      3.00 
662       1.00      1.00      1.00 
663       1.00      1.00      2.00 
664       1.00      1.00      2.00 
665       2.00      1.00      3.00 
666       1.00      1.00      1.00 
667       1.00      1.00      1.00 
668       2.00      1.00      3.00 
669       2.00      1.00      2.00 
670       1.00      1.00      3.00 
671       2.00      1.00      2.00 
672       2.00      1.00      2.00 
673       1.00      1.00      2.00 
674       2.00      1.00      2.00 
675       1.00      1.00      2.00 
676       1.00      1.00      3.00 
677 end data.
678
679 VARIABLE LABEL schtyp 'type of school'.
680 ADD VALUE LABELS female 0 male 1 female.
681 ADD VALUE LABELS ses 1 low 2 middle 3 high.
682 ADD VALUE LABELS schtyp 1 public 2 private.
683
684 crosstabs /tables = schtyp by female /statistic = chisq.
685 crosstabs /tables = female by ses  /statistic = chisq.
686 ])
687
688 AT_CHECK([pspp -O format=csv fisher-exact.sps], [0], [dnl
689 Table: Summary.
690 ,Cases,,,,,
691 ,Valid,,Missing,,Total,
692 ,N,Percent,N,Percent,N,Percent
693 type of school * female,200,100.0%,0,0.0%,200,100.0%
694
695 Table: type of school * female [[count]].
696 ,female,,
697 type of school,male,female,Total
698 public,77.000,91.000,168.000
699 private,14.000,18.000,32.000
700 Total,91.000,109.000,200.000
701
702 Table: Chi-square tests.
703 Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
704 Pearson Chi-Square,.047,1,.828,,
705 Likelihood Ratio,.047,1,.828,,
706 Fisher's Exact Test,,,,.849,.492
707 Continuity Correction,.001,1,.981,,
708 Linear-by-Linear Association,.047,1,.829,,
709 N of Valid Cases,200,,,,
710
711 Table: Summary.
712 ,Cases,,,,,
713 ,Valid,,Missing,,Total,
714 ,N,Percent,N,Percent,N,Percent
715 female * ses,200,100.0%,0,0.0%,200,100.0%
716
717 Table: female * ses [[count]].
718 ,ses,,,
719 female,low,middle,high,Total
720 male,15.000,47.000,29.000,91.000
721 female,32.000,48.000,29.000,109.000
722 Total,47.000,95.000,58.000,200.000
723
724 Table: Chi-square tests.
725 Statistic,Value,df,Asymp. Sig. (2-tailed)
726 Pearson Chi-Square,4.577,2,.101
727 Likelihood Ratio,4.679,2,.096
728 Linear-by-Linear Association,3.110,1,.078
729 N of Valid Cases,200,,
730 ])
731
732 AT_CLEANUP