1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([CROSSTABS procedure])
19 AT_SETUP([CROSSTABS integer mode crash])
20 AT_DATA([crosstabs.sps],
21 [DATA LIST LIST /A * B * X * Y * .
26 CROSSTABS VARIABLES X (1,7) Y (1,7) /TABLES X BY Y.
28 AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs.sps])
29 AT_CHECK([cat pspp.csv], [0],
30 [[Table: Reading free-form data from INLINE.
39 ,Valid,,Missing,,Total,
40 ,N,Percent,N,Percent,N,Percent
41 X × Y,1,100.0%,0,.0%,1,100.0%
44 ,,,Y,,,,,,,Total
45 ,,,1.00,2.00,3.00,4.00,5.00,6.00,7.00,
46 X,1.00,Count,0,0,0,0,0,0,0,0
47 ,2.00,Count,0,0,0,0,0,0,0,0
48 ,3.00,Count,0,0,0,0,0,0,0,0
49 ,4.00,Count,0,0,0,0,1,0,0,1
50 ,5.00,Count,0,0,0,0,0,0,0,0
51 ,6.00,Count,0,0,0,0,0,0,0,0
52 ,7.00,Count,0,0,0,0,0,0,0,0
53 Total,,Count,0,0,0,0,1,0,0,1
58 AT_SETUP([CROSSTABS integer mode crash 2])
59 AT_DATA([crosstabs.sps], [dnl
66 VARIABLES x (1,3) y (1,7)
69 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
70 [[Table: Reading free-form data from INLINE.
77 ,Valid,,Missing,,Total,
78 ,N,Percent,N,Percent,N,Percent
79 x × y,0,.0%,1,100.0%,1,100.0%
82 ,,,y,,,,,,,Total
83 ,,,1.00,2.00,3.00,4.00,5.00,6.00,7.00,
84 x,1.00,Count,,,,,,,,
85 ,2.00,Count,,,,,,,,
86 ,3.00,Count,,,,,,,,
87 Total,,Count,,,,,,,,
92 AT_SETUP([CROSSTABS long string crash])
93 AT_DATA([crosstabs.sps],
94 [data list list /x * y (a18).
105 CROSSTABS /TABLES = x BY y.
107 AT_CHECK([pspp -o - -O format=csv -o pspp.txt crosstabs.sps], [0],
108 [[Table: Reading free-form data from INLINE.
113 "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."
115 "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."
119 ,Valid,,Missing,,Total,
120 ,N,Percent,N,Percent,N,Percent
121 x × y,4,66.7%,2,33.3%,6,100.0%
125 ,,,one unity,three lots,two duality,zero none,
126 x,1.00,Count,1,0,0,1,2
127 ,2.00,Count,0,0,1,0,1
128 ,3.00,Count,0,1,0,0,1
129 Total,,Count,1,1,1,1,4
133 AT_SETUP([CROSSTABS crash])
134 AT_DATA([crosstabs.sps],
155 CROSSTABS TABLES y by z.
157 AT_CHECK([pspp -o - -O format=csv -o pspp.txt crosstabs.sps], [0],
158 [Table: Reading 1 record from INLINE.
159 Variable,Record,Columns,Format
178 ,Valid,,Missing,,Total,
179 ,N,Percent,N,Percent,N,Percent
180 y × z,9,100.0%,0,.0%,9,100.0%
191 # Bug #26739, which caused CROSSTABS to crash or to fail to output
192 # chi-square results.
193 AT_SETUP([CROSSTABS chi-square crash])
194 AT_DATA([crosstabs.sps],
195 [[DATA LIST LIST /x * y *.
207 AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
208 [[Table: Reading free-form data from INLINE.
215 ,Valid,,Missing,,Total,
216 ,N,Percent,N,Percent,N,Percent
217 x × y,4,100.0%,0,.0%,4,100.0%
227 Table: Chi-Square Tests
228 ,Value,df,Asymptotic Sig. (2-tailed)
229 Pearson Chi-Square,2.00,2,.368
230 Likelihood Ratio,2.77,2,.250
231 Linear-by-Linear Association,.27,1,.602
237 AT_SETUP([CROSSTABS crash with SPLIT FILE])
238 AT_DATA([crosstabs.sps],
239 [data list notable / v0 to v2 1-6 (A)
253 SPLIT FILE SEPARATE BY v0.
257 /FORMAT=AVALUE TABLES
259 /CELLS=COUNT ROW COLUMN TOTAL.
262 AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs.sps])
263 AT_CHECK([cat pspp.csv], [0], [dnl
270 ,Valid,,Missing,,Total,
271 ,N,Percent,N,Percent,N,Percent
272 v1 × v2,6,100.0%,0,.0%,6,100.0%
278 ,,Row %,75.0%,25.0%,100.0%
279 ,,Column %,75.0%,50.0%,66.7%
280 ,,Total %,50.0%,16.7%,66.7%
282 ,,Row %,50.0%,50.0%,100.0%
283 ,,Column %,25.0%,50.0%,33.3%
284 ,,Total %,16.7%,16.7%,33.3%
286 ,,Row %,66.7%,33.3%,100.0%
287 ,,Column %,100.0%,100.0%,100.0%
288 ,,Total %,66.7%,33.3%,100.0%
290 Table: Chi-Square Tests
291 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
292 Pearson Chi-Square,.38,1,.540,,
293 Likelihood Ratio,.37,1,.545,,
294 Fisher's Exact Test,,,,1.000,.600
295 Continuity Correction,.00,1,1.000,,
296 N of Valid Cases,6,,,,
304 ,Valid,,Missing,,Total,
305 ,N,Percent,N,Percent,N,Percent
306 v1 × v2,4,100.0%,0,.0%,4,100.0%
312 ,,Row %,.0%,100.0%,100.0%
313 ,,Column %,.0%,33.3%,25.0%
314 ,,Total %,.0%,25.0%,25.0%
316 ,,Row %,33.3%,66.7%,100.0%
317 ,,Column %,100.0%,66.7%,75.0%
318 ,,Total %,25.0%,50.0%,75.0%
320 ,,Row %,25.0%,75.0%,100.0%
321 ,,Column %,100.0%,100.0%,100.0%
322 ,,Total %,25.0%,75.0%,100.0%
324 Table: Chi-Square Tests
325 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
326 Pearson Chi-Square,.44,1,.505,,
327 Likelihood Ratio,.68,1,.410,,
328 Fisher's Exact Test,,,,1.000,.750
329 Continuity Correction,.00,1,1.000,,
330 N of Valid Cases,4,,,,
335 AT_SETUP([3-way CROSSTABS])
336 AT_DATA([crosstabs.sps],
357 CROSSTABS TABLES x BY y BY z/STATISTICS=ALL.
359 AT_CHECK([pspp -o - -O format=csv -o pspp.csv -o pspp.txt crosstabs.sps], [0],
360 [Table: Reading 1 record from INLINE.
361 Variable,Record,Columns,Format
380 ,Valid,,Missing,,Total,
381 ,N,Percent,N,Percent,N,Percent
382 x × y × z,9,100.0%,0,.0%,9,100.0%
399 Table: Chi-Square Tests
400 ,,,Value,df,Asymptotic Sig. (2-tailed)
401 z,1,Pearson Chi-Square,5.00,4,.287
402 ,,Likelihood Ratio,5.00,4,.287
403 ,,Linear-by-Linear Association,.01,1,.938
404 ,,N of Valid Cases,5,,
405 ,2,Pearson Chi-Square,4.00,3,.261
406 ,,Likelihood Ratio,4.50,3,.212
407 ,,Linear-by-Linear Association,1.58,1,.209
408 ,,N of Valid Cases,4,,
410 Table: Symmetric Measures
411 ,,,,Value,Asymp. Std. Error,Approx. T
412 z,1,Nominal by Nominal,Phi,1.00,,
414 ,,,Contingency Coefficient,.71,,
415 ,,Ordinal by Ordinal,Kendall's tau-b,.00,.32,.00
416 ,,,Kendall's tau-c,.00,.32,.00
418 ,,,Spearman Correlation,.00,.22,.00
419 ,,Interval by Interval,Pearson's R,.04,.22,.07
420 ,,N of Valid Cases,,5,,
421 ,2,Nominal by Nominal,Phi,1.00,,
423 ,,,Contingency Coefficient,.71,,
424 ,,Ordinal by Ordinal,Kendall's tau-b,-.71,.20,-1.73
425 ,,,Kendall's tau-c,-.75,.43,-1.73
426 ,,,Gamma,-1.00,.00,-1.73
427 ,,,Spearman Correlation,-.77,.17,-1.73
428 ,,Interval by Interval,Pearson's R,-.73,.18,-1.49
429 ,,N of Valid Cases,,4,,
431 Table: Directional Measures
432 ,,,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
433 z,1,Nominal by Nominal,Lambda,Symmetric,.40,.28,1.12,.264
434 ,,,,x Dependent,.25,.22,1.12,.264
435 ,,,,y Dependent,1.00,.00,1.12,.264
436 ,,,Goodman and Kruskal tau,x Dependent,.25,,,
437 ,,,,y Dependent,1.00,,,
438 ,,,Uncertainty Coefficient,Symmetric,.47,.18,,
439 ,,,,x Dependent,.31,.15,2.02,
440 ,,,,y Dependent,1.00,.00,2.02,
441 ,,Ordinal by Ordinal,Somers' d,Symmetric,.00,,.00,1.000
442 ,,,,x Dependent,.00,.50,.00,1.000
443 ,,,,y Dependent,.00,.20,.00,1.000
444 ,,Nominal by Interval,Eta,x Dependent,.04,,,
445 ,,,,y Dependent,1.00,,,
446 ,2,Nominal by Nominal,Lambda,Symmetric,.50,.25,2.00,.046
447 ,,,,x Dependent,.33,.27,1.15,.248
448 ,,,,y Dependent,1.00,.00,1.15,.248
449 ,,,Goodman and Kruskal tau,x Dependent,.33,,,
450 ,,,,y Dependent,1.00,,,
451 ,,,Uncertainty Coefficient,Symmetric,.58,.17,,
452 ,,,,x Dependent,.41,.17,2.36,
453 ,,,,y Dependent,1.00,.00,2.36,
454 ,,Ordinal by Ordinal,Somers' d,Symmetric,-.67,,-1.73,.083
455 ,,,,x Dependent,-1.00,.00,-1.73,.083
456 ,,,,y Dependent,-.50,.29,-1.73,.083
457 ,,Nominal by Interval,Eta,x Dependent,.73,,,
458 ,,,,y Dependent,1.00,,,
462 AT_SETUP([CROSSTABS rounding weights with COUNT])
463 AT_DATA([crosstabs.sps],
464 [[DATA LIST NOTABLE LIST /x y w.
475 * These should have the same effect (no rounding).
476 CROSSTABS /TABLES x BY y.
477 CROSSTABS /TABLES x BY y /COUNT ASIS.
479 * Round input weights.
480 CROSSTABS /TABLES x BY y /COUNT CASE ROUND.
481 CROSSTABS /TABLES x BY y /COUNT CASE TRUNCATE.
483 * Round cell weights.
484 CROSSTABS /TABLES x BY y /COUNT.
485 CROSSTABS /TABLES x BY y /COUNT TRUNCATE.
488 AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs.sps])
489 AT_CHECK([cat pspp.csv], [0],
492 ,Valid,,Missing,,Total,
493 ,N,Percent,N,Percent,N,Percent
494 x × y,9.00,100.0%,.00,.0%,9.00,100.0%
499 x,1.00,Count,2.80,3.20,6.00
500 ,2.00,Count,1.00,2.00,3.00
501 Total,,Count,3.80,5.20,9.00
505 ,Valid,,Missing,,Total,
506 ,N,Percent,N,Percent,N,Percent
507 x × y,9.00,100.0%,.00,.0%,9.00,100.0%
512 x,1.00,Count,2.80,3.20,6.00
513 ,2.00,Count,1.00,2.00,3.00
514 Total,,Count,3.80,5.20,9.00
518 ,Valid,,Missing,,Total,
519 ,N,Percent,N,Percent,N,Percent
520 x × y,9.00,100.0%,.00,.0%,9.00,100.0%
525 x,1.00,Count,2.00,4.00,6.00
526 ,2.00,Count,1.00,2.00,3.00
527 Total,,Count,3.00,6.00,9.00
531 ,Valid,,Missing,,Total,
532 ,N,Percent,N,Percent,N,Percent
533 x × y,7.00,100.0%,.00,.0%,7.00,100.0%
538 x,1.00,Count,2.00,2.00,4.00
539 ,2.00,Count,1.00,2.00,3.00
540 Total,,Count,3.00,4.00,7.00
544 ,Valid,,Missing,,Total,
545 ,N,Percent,N,Percent,N,Percent
546 x × y,9.00,100.0%,.00,.0%,9.00,100.0%
551 x,1.00,Count,3.00,3.00,6.00
552 ,2.00,Count,1.00,2.00,3.00
553 Total,,Count,4.00,5.00,9.00
557 ,Valid,,Missing,,Total,
558 ,N,Percent,N,Percent,N,Percent
559 x × y,8.00,100.0%,.00,.0%,8.00,100.0%
564 x,1.00,Count,2.00,3.00,5.00
565 ,2.00,Count,1.00,2.00,3.00
566 Total,,Count,3.00,5.00,8.00
570 AT_SETUP([CROSSTABS descending sort order])
571 AT_DATA([crosstabs-descending.sps],
572 [[DATA LIST NOTABLE LIST /x * y *.
587 AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs-descending.sps])
588 AT_CHECK([cat pspp.csv], [0],
591 ,Valid,,Missing,,Total,
592 ,N,Percent,N,Percent,N,Percent
593 x × y,6,100.0%,0,.0%,6,100.0%
606 AT_SETUP([CROSSTABS crash when all cases missing])
607 AT_DATA([crosstabs.sps], [dnl
608 DATA LIST LIST NOTABLE /X1 X2.
613 MISSING VALUES x2 (1).
615 CROSSTABS /TABLES= X1 by X2.
617 AT_CHECK([pspp -O format=csv crosstabs.sps], [0], [dnl
620 ,Valid,,Missing,,Total,
621 ,N,Percent,N,Percent,N,Percent
622 X1 × X2,0,.0%,1,100.0%,1,100.0%
624 crosstabs.sps:8: warning: CROSSTABS: Crosstabulation X1 × X2 contained no non-missing cases.
630 dnl This example comes from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm#chisq
631 AT_SETUP([CROSSTABS Fisher Exact Test])
633 AT_DATA([fisher-exact.sps], [dnl
637 DATA LIST notable LIST /schtyp (F9.2) female (F9.2) ses (F9.2) .
841 VARIABLE LABEL schtyp 'type of school'.
842 ADD VALUE LABELS female 0 male 1 female.
843 ADD VALUE LABELS ses 1 low 2 middle 3 high.
844 ADD VALUE LABELS schtyp 1 public 2 private.
846 crosstabs /tables = schtyp by female /statistic = chisq.
847 crosstabs /tables = female by ses /statistic = chisq.
850 AT_CHECK([pspp -o pspp.csv -o pspp.txt fisher-exact.sps])
851 AT_CHECK([cat pspp.csv], [0], [Table: Summary
853 ,Valid,,Missing,,Total,
854 ,N,Percent,N,Percent,N,Percent
855 type of school × female,200,100.0%,0,.0%,200,100.0%
857 Table: type of school × female
860 type of school,public,Count,77,91,168
861 ,private,Count,14,18,32
862 Total,,Count,91,109,200
864 Table: Chi-Square Tests
865 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
866 Pearson Chi-Square,.047,1,.828,,
867 Likelihood Ratio,.047,1,.828,,
868 Fisher's Exact Test,,,,.849,.492
869 Continuity Correction,.001,1,.981,,
870 Linear-by-Linear Association,.047,1,.829,,
871 N of Valid Cases,200,,,,
875 ,Valid,,Missing,,Total,
876 ,N,Percent,N,Percent,N,Percent
877 female × ses,200,100.0%,0,.0%,200,100.0%
882 female,male,Count,15,47,29,91
883 ,female,Count,32,48,29,109
884 Total,,Count,47,95,58,200
886 Table: Chi-Square Tests
887 ,Value,df,Asymptotic Sig. (2-tailed)
888 Pearson Chi-Square,4.577,2,.101
889 Likelihood Ratio,4.679,2,.096
890 Linear-by-Linear Association,3.110,1,.078
891 N of Valid Cases,200,,
896 AT_SETUP([CROSSTABS Pearson's R - 1])
897 AT_DATA([pearson.sps], [dnl
900 * From http://www.statisticslectures.com/topics/pearsonr/.
909 CROSSTABS x BY y/STATISTICS=CORR.
911 AT_CHECK([pspp -o pspp.csv -o pspp.txt pearson.sps])
912 AT_CHECK([cat pspp.csv], [0], [dnl
915 ,Valid,,Missing,,Total,
916 ,N,Percent,N,Percent,N,Percent
917 x × y,5,100.0%,0,.0%,5,100.0%
921 ,,,4.000,6.000,10.000,12.000,13.000,
922 x,1.000,Count,1,0,0,0,0,1
923 ,3.000,Count,0,1,0,0,0,1
924 ,5.000,Count,0,0,1,1,0,2
925 ,6.000,Count,0,0,0,0,1,1
926 Total,,Count,1,1,1,1,1,5
928 Table: Symmetric Measures
929 ,,Value,Asymp. Std. Error,Approx. T
930 Ordinal by Ordinal,Spearman Correlation,.975,.022,7.550
931 Interval by Interval,Pearson's R,.968,.017,6.708
932 N of Valid Cases,,5,,
936 AT_SETUP([CROSSTABS Pearson's R - 2])
937 AT_DATA([pearson2.sps], [dnl
940 * Checked with http://www.socscistatistics.com/tests/pearson/Default2.aspx.
954 CROSSTABS x BY y/STATISTICS=CORR.
956 AT_CHECK([pspp -o pspp.csv -o pspp.txt pearson2.sps])
957 AT_CHECK([cat pspp.csv], [0], [dnl
960 ,Valid,,Missing,,Total,
961 ,N,Percent,N,Percent,N,Percent
962 x × y,10,100.0%,0,.0%,10,100.0%
965 ,,,y,,,,,,,,,Total
966 ,,,1.500,4.000,5.000,6.000,6.500,7.000,9.000,10.500,11.000,
967 x,1.000,Count,1,0,0,0,0,0,0,0,0,1
968 ,2.000,Count,1,0,0,0,0,0,0,0,0,1
969 ,3.000,Count,0,1,0,0,0,0,0,0,0,1
970 ,4.000,Count,0,0,0,1,0,0,0,0,0,1
971 ,5.000,Count,0,0,1,0,0,0,0,0,0,1
972 ,6.000,Count,0,0,0,0,0,1,0,0,0,1
973 ,7.000,Count,0,0,0,0,1,0,0,0,0,1
974 ,8.000,Count,0,0,0,0,0,0,1,0,0,1
975 ,9.000,Count,0,0,0,0,0,0,0,1,0,1
976 ,10.000,Count,0,0,0,0,0,0,0,0,1,1
977 Total,,Count,2,1,1,1,1,1,1,1,1,10
979 Table: Symmetric Measures
980 ,,Value,Asymp. Std. Error,Approx. T
981 Ordinal by Ordinal,Spearman Correlation,.973,.015,11.844
982 Interval by Interval,Pearson's R,.971,.017,11.580
983 N of Valid Cases,,10,,
987 AT_SETUP([CROSSTABS Pearson's R - 3])
988 AT_DATA([pearson3.sps], [dnl
991 * From http://learntech.uwe.ac.uk/da/Default.aspx?pageid=1442.
1004 CROSSTABS x BY y/STATISTICS=CORR.
1006 AT_CHECK([pspp -o pspp.csv -o pspp.txt pearson3.sps])
1007 AT_CHECK([cat pspp.csv], [0], [dnl
1010 ,Valid,,Missing,,Total,
1011 ,N,Percent,N,Percent,N,Percent
1012 x × y,9,100.0%,0,.0%,9,100.0%
1015 ,,,y,,,,,,,,Total
1016 ,,,28.000,58.000,66.000,75.000,85.000,87.000,91.000,122.000,
1017 x,25.000,Count,1,0,0,0,0,0,0,0,1
1018 ,35.000,Count,0,1,0,0,0,0,0,0,1
1019 ,44.000,Count,0,0,1,0,0,0,0,0,1
1020 ,50.000,Count,0,0,0,1,0,0,0,0,1
1021 ,56.000,Count,0,0,0,0,0,1,1,0,2
1022 ,65.000,Count,0,0,0,0,1,0,1,0,2
1023 ,87.000,Count,0,0,0,0,0,0,0,1,1
1024 Total,,Count,1,1,1,1,1,1,2,1,9
1026 Table: Symmetric Measures
1027 ,,Value,Asymp. Std. Error,Approx. T
1028 Ordinal by Ordinal,Spearman Correlation,.911,.068,5.860
1029 Interval by Interval,Pearson's R,.966,.017,9.915
1030 N of Valid Cases,,9,,
1034 AT_SETUP([CROSSTABS Pearson's R - 4])
1035 AT_DATA([pearson4.sps], [dnl
1038 * From http://psychology.ucdavis.edu/faculty_sites/sommerb/sommerdemo/correlation/hand/pearson_hand.htm.
1054 CROSSTABS x BY y/STATISTICS=CORR.
1056 AT_CHECK([pspp -o pspp.csv -o pspp.txt pearson4.sps])
1057 AT_CHECK([cat pspp.csv], [0], [dnl
1060 ,Valid,,Missing,,Total,
1061 ,N,Percent,N,Percent,N,Percent
1062 x × y,12,100.0%,0,.0%,12,100.0%
1065 ,,,y,,,,,,,,,,,,Total
1066 ,,,2.000,4.000,5.000,7.000,9.000,11.000,12.000,14.000,15.000,17.000,18.000,20.000,
1067 x,2.000,Count,0,0,0,1,0,0,0,0,0,0,0,0,1
1068 ,3.000,Count,0,0,0,0,0,0,1,0,0,0,0,0,1
1069 ,4.000,Count,0,0,0,0,1,1,0,0,0,0,0,0,2
1070 ,5.000,Count,0,0,1,0,0,0,0,0,0,0,0,0,1
1071 ,6.000,Count,1,1,0,0,0,0,0,0,0,0,0,0,2
1072 ,7.000,Count,0,0,0,0,0,0,0,1,0,0,0,0,1
1073 ,8.000,Count,0,0,0,0,0,0,0,0,1,0,0,0,1
1074 ,9.000,Count,0,0,0,0,0,0,0,0,0,1,0,0,1
1075 ,10.000,Count,0,0,0,0,0,0,0,0,0,0,1,1,2
1076 Total,,Count,1,1,1,1,1,1,1,1,1,1,1,1,12
1078 Table: Symmetric Measures
1079 ,,Value,Asymp. Std. Error,Approx. T
1080 Ordinal by Ordinal,Spearman Correlation,.657,.140,2.758
1081 Interval by Interval,Pearson's R,.667,.132,2.830
1082 N of Valid Cases,,12,,
1086 AT_SETUP([CROSSTABS Pearson's R - 5])
1087 AT_DATA([pearson5.sps], [dnl
1090 * From http://www.statisticslectures.com/topics/pearsonr/.
1104 CROSSTABS x BY y/STATISTICS=CORR.
1106 AT_CHECK([pspp -o pspp.csv -o pspp.txt pearson5.sps])
1107 AT_CHECK([cat pspp.csv], [0], [dnl
1110 ,Valid,,Missing,,Total,
1111 ,N,Percent,N,Percent,N,Percent
1112 x × y,10,100.0%,0,.0%,10,100.0%
1115 ,,,y,,,,,,,,,,Total
1116 ,,,15000.00,26000.00,29000.00,32000.00,33000.00,41000.00,45000.00,52000.00,68000.00,80000.00,
1117 x,18.000,Count,1,0,0,0,0,0,0,0,0,0,1
1118 ,24.000,Count,0,1,0,0,0,0,0,0,0,0,1
1119 ,25.000,Count,0,0,1,0,0,0,0,0,0,0,1
1120 ,26.000,Count,0,0,0,1,0,0,0,0,0,0,1
1121 ,33.000,Count,0,0,0,0,1,0,0,0,0,0,1
1122 ,37.000,Count,0,0,0,0,0,1,0,0,0,0,1
1123 ,40.000,Count,0,0,0,0,0,0,1,0,0,0,1
1124 ,45.000,Count,0,0,0,0,0,0,0,1,0,0,1
1125 ,57.000,Count,0,0,0,0,0,0,0,0,1,0,1
1126 ,64.000,Count,0,0,0,0,0,0,0,0,0,1,1
1127 Total,,Count,1,1,1,1,1,1,1,1,1,1,10
1129 Table: Symmetric Measures
1130 ,,Value,Asymp. Std. Error,Approx. T
1131 Ordinal by Ordinal,Spearman Correlation,1.000,.000,+Infinit
1132 Interval by Interval,Pearson's R,.992,.004,22.638
1133 N of Valid Cases,,10,,
1137 AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - 1])
1138 AT_DATA([lambda.sps], [dnl
1141 * From http://www.csupomona.edu/~jlkorey/POWERMUTT/Topics/contingency_tables.html.
1142 DATA LIST LIST NOTABLE/x y w.
1153 CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA.
1155 AT_CHECK([pspp -o pspp.csv -o pspp.txt lambda.sps])
1156 AT_CHECK([cat pspp.csv], [0], [dnl
1159 ,Valid,,Missing,,Total,
1160 ,N,Percent,N,Percent,N,Percent
1161 x × y,1296.000,100.0%,.000,.0%,1296.000,100.0%
1163 Table: Directional Measures
1164 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1165 Nominal by Nominal,Lambda,Symmetric,.423,.021,16.875,.000
1166 ,,x Dependent,.497,.024,15.986,.000
1167 ,,y Dependent,.370,.020,16.339,.000
1168 ,Goodman and Kruskal tau,x Dependent,.382,,,
1169 ,,y Dependent,.198,,,
1173 AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - 2])
1174 AT_DATA([lambda.sps], [dnl
1177 * From http://vassarstats.net.
1178 DATA LIST LIST NOTABLE/x y w.
1192 CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA.
1194 AT_CHECK([pspp -o pspp.csv -o pspp.txt lambda.sps])
1195 AT_CHECK([cat pspp.csv], [0], [dnl
1198 ,Valid,,Missing,,Total,
1199 ,N,Percent,N,Percent,N,Percent
1200 x × y,137.000,100.0%,.000,.0%,137.000,100.0%
1202 Table: Directional Measures
1203 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1204 Nominal by Nominal,Lambda,Symmetric,.259,.081,2.902,.004
1205 ,,x Dependent,.250,.089,2.479,.013
1206 ,,y Dependent,.267,.085,2.766,.006
1207 ,Goodman and Kruskal tau,x Dependent,.129,,,
1208 ,,y Dependent,.123,,,
1212 AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - 3])
1213 AT_DATA([lambda.sps], [dnl
1216 * From Goodman, L.A., Kruskal, W.H. (1954) "Measures of association for
1217 cross classifications". Part I. Journal of the American Statistical
1218 Association, 49, 732-764.
1219 DATA LIST LIST NOTABLE/x y w.
1235 CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA.
1237 AT_CHECK([pspp -o pspp.csv -o pspp.txt lambda.sps])
1238 AT_CHECK([cat pspp.csv], [0], [dnl
1241 ,Valid,,Missing,,Total,
1242 ,N,Percent,N,Percent,N,Percent
1243 x × y,6800.000,100.0%,.000,.0%,6800.000,100.0%
1245 Table: Directional Measures
1246 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1247 Nominal by Nominal,Lambda,Symmetric,.208,.010,18.793,.000
1248 ,,x Dependent,.224,.013,16.076,.000
1249 ,,y Dependent,.192,.012,14.438,.000
1250 ,Goodman and Kruskal tau,x Dependent,.089,,,
1251 ,,y Dependent,.081,,,
1255 AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - treatment of ties])
1256 AT_DATA([lambda.sps], [dnl
1259 * From Douglas Bonett.
1260 DATA LIST LIST NOTABLE/x y w.
1271 CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA.
1273 AT_CHECK([pspp -o pspp.csv -o pspp.txt lambda.sps])
1274 AT_CHECK([cat pspp.csv], [0], [dnl
1277 ,Valid,,Missing,,Total,
1278 ,N,Percent,N,Percent,N,Percent
1279 x × y,500.000,100.0%,.000,.0%,500.000,100.0%
1281 Table: Directional Measures
1282 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1283 Nominal by Nominal,Lambda,Symmetric,.031,.013,2.336,.019
1284 ,,x Dependent,.000,.000,NaN,NaN
1285 ,,y Dependent,.033,.014,2.336,.019
1286 ,Goodman and Kruskal tau,x Dependent,.012,,,
1287 ,,y Dependent,.009,,,
1291 AT_SETUP([CROSSTABS Somers' D, Tau-B, Tau-C, Gamma - 1])
1292 AT_DATA([somersd.sps], [dnl
1295 * From http://stats.stackexchange.com/questions/72203/problem-with-calculating-asymptotic-standard-error-for-somers-d.
1296 DATA LIST LIST NOTABLE/x y * w (F10.6).
1314 CROSSTABS x BY y/STATISTICS=D/CELLS=NONE.
1316 AT_CHECK([pspp -o pspp.csv -o pspp.txt somersd.sps])
1317 AT_CHECK([cat pspp.csv], [0], [dnl
1320 ,Valid,,Missing,,Total,
1321 ,N,Percent,N,Percent,N,Percent
1322 x × y,1.000000,100.0%,.000000,.0%,1.000000,100.0%
1324 Table: Directional Measures
1325 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1326 Ordinal by Ordinal,Somers' d,Symmetric,-.084,,-.149,.882
1327 ,,x Dependent,-.045,.300,-.149,.882
1328 ,,y Dependent,-.684,2.378,-.149,.882
1332 AT_SETUP([CROSSTABS Somers' D, Tau-B, Tau-C, Gamma - 2])
1333 AT_DATA([somersd.sps], [dnl
1336 * From http://uregina.ca/~gingrich/gamma.pdf.
1337 DATA LIST LIST NOTABLE/x y w.
1350 CROSSTABS x BY y/STATISTICS=BTAU CTAU GAMMA D/CELLS=NONE.
1352 AT_CHECK([pspp -o pspp.csv -o pspp.txt somersd.sps])
1353 AT_CHECK([cat pspp.csv], [0], [dnl
1356 ,Valid,,Missing,,Total,
1357 ,N,Percent,N,Percent,N,Percent
1358 x × y,687.000,100.0%,.000,.0%,687.000,100.0%
1360 Table: Symmetric Measures
1361 ,,Value,Asymp. Std. Error,Approx. T
1362 Ordinal by Ordinal,Kendall's tau-b,.372,.033,10.669
1363 ,Kendall's tau-c,.310,.029,10.669
1364 ,Gamma,.591,.043,10.669
1365 N of Valid Cases,,687.000,,
1367 Table: Directional Measures
1368 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1369 Ordinal by Ordinal,Somers' d,Symmetric,.371,,10.669,.000
1370 ,,x Dependent,.351,.032,10.669,.000
1371 ,,y Dependent,.394,.035,10.669,.000
1375 AT_SETUP([CROSSTABS Somers' D, Tau-B, Tau-C, Gamma - 3])
1376 AT_DATA([ordinal.sps], [dnl
1379 * From https://www.iup.edu/WorkArea/DownloadAsset.aspx?id=9829, "Case 1".
1380 DATA LIST LIST NOTABLE /x y w.
1387 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1389 * Same site, case 2.
1390 DATA LIST LIST NOTABLE /x y w.
1397 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1399 * Same site, case 3.
1400 DATA LIST LIST NOTABLE /x y w.
1407 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1409 * Same site, case 4.
1410 DATA LIST LIST NOTABLE /x y w.
1418 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1420 * Same site, case 5.
1421 DATA LIST LIST NOTABLE /x y w.
1429 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1431 * Same site, case 6.
1432 DATA LIST LIST NOTABLE /x y w.
1444 CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE.
1446 * Same site, case 7.
1447 DATA LIST LIST NOTABLE /x y w.
1459 CROSSTABS x BY y/STATISTICS=LAMBDA D PHI GAMMA/CELLS=NONE.
1461 * Same site, case 8.
1462 DATA LIST LIST NOTABLE /x y w.
1482 CROSSTABS x BY y/STATISTICS=LAMBDA D PHI BTAU/CELLS=NONE.
1484 AT_CHECK([pspp -o pspp.csv -o pspp.txt ordinal.sps])
1485 AT_CHECK([cat pspp.csv], [0], [dnl
1488 ,Valid,,Missing,,Total,
1489 ,N,Percent,N,Percent,N,Percent
1490 x × y,150.000,100.0%,.000,.0%,150.000,100.0%
1492 Table: Symmetric Measures
1493 ,,Value,Asymp. Std. Error,Approx. T
1494 Ordinal by Ordinal,Kendall's tau-b,1.000,.000,24.841
1495 ,Gamma,1.000,.000,24.841
1496 N of Valid Cases,,150.000,,
1498 Table: Directional Measures
1499 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1500 Ordinal by Ordinal,Somers' d,Symmetric,1.000,,24.841,.000
1501 ,,x Dependent,1.000,.000,24.841,.000
1502 ,,y Dependent,1.000,.000,24.841,.000
1506 ,Valid,,Missing,,Total,
1507 ,N,Percent,N,Percent,N,Percent
1508 x × y,150.000,100.0%,.000,.0%,150.000,100.0%
1510 Table: Symmetric Measures
1511 ,,Value,Asymp. Std. Error,Approx. T
1512 Ordinal by Ordinal,Kendall's tau-b,1.000,.000,24.841
1513 ,Gamma,1.000,.000,24.841
1514 N of Valid Cases,,150.000,,
1516 Table: Directional Measures
1517 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1518 Ordinal by Ordinal,Somers' d,Symmetric,1.000,,24.841,.000
1519 ,,x Dependent,1.000,.000,24.841,.000
1520 ,,y Dependent,1.000,.000,24.841,.000
1524 ,Valid,,Missing,,Total,
1525 ,N,Percent,N,Percent,N,Percent
1526 x × y,150.000,100.0%,.000,.0%,150.000,100.0%
1528 Table: Symmetric Measures
1529 ,,Value,Asymp. Std. Error,Approx. T
1530 Ordinal by Ordinal,Kendall's tau-b,-1.000,.000,-24.841
1531 ,Gamma,-1.000,.000,-24.841
1532 N of Valid Cases,,150.000,,
1534 Table: Directional Measures
1535 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1536 Ordinal by Ordinal,Somers' d,Symmetric,-1.000,,-24.841,.000
1537 ,,x Dependent,-1.000,.000,-24.841,.000
1538 ,,y Dependent,-1.000,.000,-24.841,.000
1542 ,Valid,,Missing,,Total,
1543 ,N,Percent,N,Percent,N,Percent
1544 x × y,150.000,100.0%,.000,.0%,150.000,100.0%
1546 Table: Symmetric Measures
1547 ,,Value,Asymp. Std. Error,Approx. T
1548 Ordinal by Ordinal,Kendall's tau-b,.972,.007,24.841
1549 ,Gamma,1.000,.000,24.841
1550 N of Valid Cases,,150.000,,
1552 Table: Directional Measures
1553 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1554 Ordinal by Ordinal,Somers' d,Symmetric,.971,,24.841,.000
1555 ,,x Dependent,.944,.013,24.841,.000
1556 ,,y Dependent,1.000,.000,24.841,.000
1560 ,Valid,,Missing,,Total,
1561 ,N,Percent,N,Percent,N,Percent
1562 x × y,150.000,100.0%,.000,.0%,150.000,100.0%
1564 Table: Symmetric Measures
1565 ,,Value,Asymp. Std. Error,Approx. T
1566 Ordinal by Ordinal,Kendall's tau-b,.119,.059,1.009
1567 ,Gamma,1.000,.000,1.009
1568 N of Valid Cases,,150.000,,
1570 Table: Directional Measures
1571 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1572 Ordinal by Ordinal,Somers' d,Symmetric,.035,,1.009,.313
1573 ,,x Dependent,.805,.032,1.009,.313
1574 ,,y Dependent,.018,.017,1.009,.313
1578 ,Valid,,Missing,,Total,
1579 ,N,Percent,N,Percent,N,Percent
1580 x × y,148.000,100.0%,.000,.0%,148.000,100.0%
1582 Table: Symmetric Measures
1583 ,,Value,Asymp. Std. Error,Approx. T
1584 Ordinal by Ordinal,Kendall's tau-b,-.208,.078,-2.641
1585 ,Gamma,-.381,.130,-2.641
1586 N of Valid Cases,,148.000,,
1588 Table: Directional Measures
1589 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1590 Ordinal by Ordinal,Somers' d,Symmetric,-.206,,-2.641,.008
1591 ,,x Dependent,-.182,.069,-2.641,.008
1592 ,,y Dependent,-.237,.089,-2.641,.008
1596 ,Valid,,Missing,,Total,
1597 ,N,Percent,N,Percent,N,Percent
1598 x × y,148.000,100.0%,.000,.0%,148.000,100.0%
1600 Table: Symmetric Measures
1601 ,,Value,Asymp. Std. Error,Approx. T
1602 Nominal by Nominal,Phi,.731,,
1604 Ordinal by Ordinal,Gamma,-.110,.107,-1.022
1605 N of Valid Cases,,148.000,,
1607 Table: Directional Measures
1608 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1609 Nominal by Nominal,Lambda,Symmetric,.338,.059,4.743,.000
1610 ,,x Dependent,.640,.085,4.875,.000
1611 ,,y Dependent,.174,.050,3.248,.001
1612 ,Goodman and Kruskal tau,x Dependent,.534,,,
1613 ,,y Dependent,.167,,,
1614 Ordinal by Ordinal,Somers' d,Symmetric,-.074,,-1.022,.307
1615 ,,x Dependent,-.060,.059,-1.022,.307
1616 ,,y Dependent,-.096,.094,-1.022,.307
1620 ,Valid,,Missing,,Total,
1621 ,N,Percent,N,Percent,N,Percent
1622 x × y,212.000,100.0%,.000,.0%,212.000,100.0%
1624 Table: Symmetric Measures
1625 ,,Value,Asymp. Std. Error,Approx. T
1626 Nominal by Nominal,Phi,.432,,
1628 Ordinal by Ordinal,Kendall's tau-b,.209,.062,3.338
1629 N of Valid Cases,,212.000,,
1631 Table: Directional Measures
1632 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1633 Nominal by Nominal,Lambda,Symmetric,.102,.067,1.473,.141
1634 ,,x Dependent,.027,.087,.302,.763
1635 ,,y Dependent,.165,.065,2.349,.019
1636 ,Goodman and Kruskal tau,x Dependent,.051,,,
1637 ,,y Dependent,.068,,,
1638 Ordinal by Ordinal,Somers' d,Symmetric,.209,,3.338,.001
1639 ,,x Dependent,.202,.060,3.338,.001
1640 ,,y Dependent,.217,.064,3.338,.001
1644 AT_SETUP([CROSSTABS Cohens Kappa])
1646 dnl Example from Wood J. M.
1647 dnl "Understanding and Computing Cohen's Kappa: A Tutorial"
1648 dnl WebPsychEmpiricist. Oct 3 2007
1649 AT_DATA([kappa.sps], [dnl
1652 data list notable list /p1 * p2 * w *.
1661 crosstabs /table = p1 by p2
1666 AT_CHECK([pspp -o pspp.csv -o pspp.txt kappa.sps])
1667 AT_CHECK([cat pspp.csv], [0], [dnl
1670 ,Valid,,Missing,,Total,
1671 ,N,Percent,N,Percent,N,Percent
1672 p1 × p2,20.000,100.0%,.000,.0%,20.000,100.0%
1677 p1,.000,Count,18.000,1.000,19.000
1678 ,1.000,Count,1.000,.000,1.000
1679 Total,,Count,19.000,1.000,20.000
1681 Table: Symmetric Measures
1682 ,,Value,Asymp. Std. Error,Approx. T
1683 Measure of Agreement,Kappa,-.053,.037,-.235
1684 N of Valid Cases,,20.000,,
1690 AT_SETUP([CROSSTABS many statistics])
1691 AT_DATA([crosstabs.sps], [dnl
1694 * From http://www4.stat.ncsu.edu/~dzhang2/st744/table3.9.lst.txt.
1695 DATA LIST LIST NOTABLE/x y w.
1704 CROSSTABS x BY y/STATISTICS=CHISQ PHI CC LAMBDA UC BTAU CTAU GAMMA D CORR/CELLS=NONE.
1706 AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs.sps])
1707 AT_CHECK([cat pspp.csv], [0], [dnl
1710 ,Valid,,Missing,,Total,
1711 ,N,Percent,N,Percent,N,Percent
1712 x × y,66.0000,100.0%,.0000,.0%,66.0000,100.0%
1714 Table: Chi-Square Tests
1715 ,Value,df,Asymptotic Sig. (2-tailed)
1716 Pearson Chi-Square,6.9562,2.0000,.031
1717 Likelihood Ratio,6.6901,2.0000,.035
1718 Linear-by-Linear Association,5.8450,1.0000,.016
1719 N of Valid Cases,66.0000,,
1721 Table: Symmetric Measures
1722 ,,Value,Asymp. Std. Error,Approx. T
1723 Nominal by Nominal,Phi,.3246,,
1725 ,Contingency Coefficient,.3088,,
1726 Ordinal by Ordinal,Kendall's tau-b,.2752,.0856,1.9920
1727 ,Kendall's tau-c,.1497,.0751,1.9920
1728 ,Gamma,.8717,.1250,1.9920
1729 ,Spearman Correlation,.2908,.0906,2.4311
1730 Interval by Interval,Pearson's R,.2999,.0973,2.5147
1731 N of Valid Cases,,66.0000,,
1733 Table: Directional Measures
1734 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1735 Nominal by Nominal,Lambda,Symmetric,.0455,.1629,.2723,.785
1736 ,,x Dependent,.0000,.0000,NaN,NaN
1737 ,,y Dependent,.0500,.1791,.2723,.785
1738 ,Goodman and Kruskal tau,x Dependent,.1054,,,
1739 ,,y Dependent,.0434,,,
1740 ,Uncertainty Coefficient,Symmetric,.0780,.0474,,
1741 ,,x Dependent,.2217,.1062,1.5373,
1742 ,,y Dependent,.0473,.0306,1.5373,
1743 Ordinal by Ordinal,Somers' d,Symmetric,.1960,,1.9920,.046
1744 ,,x Dependent,.1152,.0572,1.9920,.046
1745 ,,y Dependent,.6573,.1417,1.9920,.046
1749 AT_SETUP([CROSSTABS uncertainy coefficient])
1750 AT_DATA([uc.sps], [dnl
1751 * From http://groups.chass.utoronto.ca/pol242/5bMeasuringAssociation.htm.
1754 DATA LIST LIST NOTABLE/x y w.
1764 CROSSTABS x BY y/STATISTICS=LAMBDA UC/CELLS=NONE.
1766 AT_CHECK([pspp -o pspp.csv -o pspp.txt uc.sps])
1767 AT_CHECK([cat pspp.csv], [0], [dnl
1770 ,Valid,,Missing,,Total,
1771 ,N,Percent,N,Percent,N,Percent
1772 x × y,987.000,100.0%,.000,.0%,987.000,100.0%
1774 Table: Directional Measures
1775 ,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
1776 Nominal by Nominal,Lambda,Symmetric,.000,.000,NaN,NaN
1777 ,,x Dependent,.000,.000,NaN,NaN
1778 ,,y Dependent,.000,.000,NaN,NaN
1779 ,Goodman and Kruskal tau,x Dependent,.076,,,
1780 ,,y Dependent,.108,,,
1781 ,Uncertainty Coefficient,Symmetric,.105,.012,,
1782 ,,x Dependent,.073,.009,7.890,
1783 ,,y Dependent,.184,.019,7.890,
1787 AT_SETUP([CROSSTABS estimated risk])
1788 dnl Example data and expected output from
1789 dnl http://www.psychology.nottingham.ac.uk/staff/ddc/c8cxpa/further/Project_resources/SPSSCrosstabW.pdf
1790 AT_DATA([risk.sps], [dnl
1791 DATA LIST LIST /factor disease count (F8.0).
1793 VALUE LABELS /factor 0 'Placebo' 1 'Aspirin'
1794 /disease 1 'No' 0 'Yes'.
1801 CROSSTABS factor BY disease/STATISTICS=RISK CHISQ.
1803 AT_CHECK([pspp -o pspp.csv -o pspp.txt risk.sps])
1804 AT_CHECK([cat pspp.csv], [0], [dnl
1805 Table: Reading free-form data from INLINE.
1813 ,Valid,,Missing,,Total,
1814 ,N,Percent,N,Percent,N,Percent
1815 factor × disease,250,100.0%,0,.0%,250,100.0%
1817 Table: factor × disease
1820 factor,Placebo,Count,20,80,100
1821 ,Aspirin,Count,15,135,150
1822 Total,,Count,35,215,250
1824 Table: Chi-Square Tests
1825 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
1826 Pearson Chi-Square,4.98,1,.026,,
1827 Likelihood Ratio,4.88,1,.027,,
1828 Fisher's Exact Test,,,,.039,.021
1829 Continuity Correction,4.19,1,.041,,
1830 Linear-by-Linear Association,4.96,1,.026,,
1831 N of Valid Cases,250,,,,
1833 Table: Risk Estimate
1834 ,Value,95% Confidence Interval,
1836 Odds Ratio for factor (Placebo / Aspirin),2.25,2.25,2.25
1837 For cohort disease = Yes,1.08,1.08,1.08
1838 For cohort disease = No,.99,.99,.99
1839 N of Valid Cases,250.00,,
1843 AT_SETUP([CROSSTABS barchart])
1844 AT_DATA([bc.sps], [dnl
1847 DATA LIST LIST NOTABLE /x (a20) y (f8) z (f8) w (f8) .
1871 AT_CHECK([pspp -O format=txt -o xxx bc.sps], [0], [ignore])
1873 AT_CHECK([test -e xxx-1.png], [0], [ignore])
1874 AT_CHECK([test -e xxx-2.png], [0], [ignore])
1876 AT_CHECK([diff xxx-1.png xxx-2.png], [0], [ignore])