+Ordinal by Ordinal,Somers' d,Symmetric,.209,,3.338,.001
+,,x Dependent,.202,.060,3.338,.001
+,,y Dependent,.217,.064,3.338,.001
+])
+AT_CLEANUP
+
+AT_SETUP([CROSSTABS Cohens Kappa])
+
+dnl Example from Wood J. M.
+dnl "Understanding and Computing Cohen's Kappa: A Tutorial"
+dnl WebPsychEmpiricist. Oct 3 2007
+AT_DATA([kappa.sps], [dnl
+SET FORMAT=F8.3.
+
+data list notable list /p1 * p2 * w *.
+begin data.
+0 0 18
+1 0 1
+0 1 1
+end data.
+
+weight by w.
+
+crosstabs /table = p1 by p2
+ statistics = kappa
+ .
+])
+
+AT_CHECK([pspp -o pspp.csv -o pspp.txt kappa.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Summary
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+p1 × p2,20.000,100.0%,.000,.0%,20.000,100.0%
+
+Table: p1 × p2
+,,,p2,,Total
+,,,.000,1.000,
+p1,.000,Count,18.000,1.000,19.000
+,1.000,,1.000,.000,1.000
+Total,,,19.000,1.000,20.000
+
+Table: Symmetric Measures
+,,Value,Asymp. Std. Error,Approx. T
+Measure of Agreement,Kappa,-.053,.037,-.235
+N of Valid Cases,,20.000,,
+])
+
+AT_CLEANUP
+
+
+AT_SETUP([CROSSTABS many statistics])
+AT_DATA([crosstabs.sps], [dnl
+SET FORMAT=F8.4.
+
+* From http://www4.stat.ncsu.edu/~dzhang2/st744/table3.9.lst.txt.
+DATA LIST LIST NOTABLE/x y w.
+WEIGHT BY w.
+BEGIN DATA.
+1 1 25
+1 2 25
+1 3 12
+2 2 1
+2 3 3
+END DATA.
+CROSSTABS x BY y/STATISTICS=CHISQ PHI CC LAMBDA UC BTAU CTAU GAMMA D CORR/CELLS=NONE.
+])
+AT_CHECK([pspp -o pspp.csv -o pspp.txt crosstabs.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Summary
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+x × y,66.0000,100.0%,.0000,.0%,66.0000,100.0%
+
+Table: Chi-Square Tests
+,Value,df,Asymptotic Sig. (2-tailed)
+Pearson Chi-Square,6.9562,2.0000,.031
+Likelihood Ratio,6.6901,2.0000,.035
+Linear-by-Linear Association,5.8450,1.0000,.016
+N of Valid Cases,66.0000,,
+
+Table: Symmetric Measures
+,,Value,Asymp. Std. Error,Approx. T
+Nominal by Nominal,Phi,.3246,,
+,Cramer's V,.3246,,
+,Contingency Coefficient,.3088,,
+Ordinal by Ordinal,Kendall's tau-b,.2752,.0856,1.9920
+,Kendall's tau-c,.1497,.0751,1.9920
+,Gamma,.8717,.1250,1.9920
+,Spearman Correlation,.2908,.0906,2.4311
+Interval by Interval,Pearson's R,.2999,.0973,2.5147
+N of Valid Cases,,66.0000,,
+
+Table: Directional Measures
+,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+Nominal by Nominal,Lambda,Symmetric,.0455,.1629,.2723,.785
+,,x Dependent,.0000,.0000,NaN,NaN
+,,y Dependent,.0500,.1791,.2723,.785
+,Goodman and Kruskal tau,x Dependent,.1054,,,
+,,y Dependent,.0434,,,
+,Uncertainty Coefficient,Symmetric,.0780,.0474,,
+,,x Dependent,.2217,.1062,1.5373,
+,,y Dependent,.0473,.0306,1.5373,
+Ordinal by Ordinal,Somers' d,Symmetric,.1960,,1.9920,.046
+,,x Dependent,.1152,.0572,1.9920,.046
+,,y Dependent,.6573,.1417,1.9920,.046
+])
+AT_CLEANUP
+
+AT_SETUP([CROSSTABS uncertainy coefficient])
+AT_DATA([uc.sps], [dnl
+* From http://groups.chass.utoronto.ca/pol242/5bMeasuringAssociation.htm.
+SET FORMAT=F8.3.
+
+DATA LIST LIST NOTABLE/x y w.
+WEIGHT BY w.
+BEGIN DATA.
+1 1 416
+1 2 121
+2 1 335
+2 2 2
+3 1 112
+3 2 1
+END DATA.
+CROSSTABS x BY y/STATISTICS=LAMBDA UC/CELLS=NONE.
+])
+AT_CHECK([pspp -o pspp.csv -o pspp.txt uc.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Summary
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+x × y,987.000,100.0%,.000,.0%,987.000,100.0%
+
+Table: Directional Measures
+,,,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+Nominal by Nominal,Lambda,Symmetric,.000,.000,NaN,NaN
+,,x Dependent,.000,.000,NaN,NaN
+,,y Dependent,.000,.000,NaN,NaN
+,Goodman and Kruskal tau,x Dependent,.076,,,
+,,y Dependent,.108,,,
+,Uncertainty Coefficient,Symmetric,.105,.012,,
+,,x Dependent,.073,.009,7.890,
+,,y Dependent,.184,.019,7.890,