CROSSTABS: Calculate ASE for asymmetric lambda (correctly).
[pspp] / tests / language / stats / crosstabs.at
index c33857b8f2eaa45805efdc847765b5b4d0fad8ca..ad34a60f6288ebbf60a58cdadeae698a2f28fbd8 100644 (file)
@@ -377,11 +377,11 @@ z,Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Table: Directional measures.
 z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 1,Nominal by Nominal,Lambda,Symmetric,.40,.28,1.12,
-,,,x Dependent,.25,,1.12,
-,,,y Dependent,1.00,,1.12,
+,,,x Dependent,.25,.22,1.12,
+,,,y Dependent,1.00,.00,1.12,
 ,,Goodman and Kruskal tau,x Dependent,.25,,,
 ,,,y Dependent,1.00,,,
-,,Uncertainty Coefficient,Symmetric,.47,.18,1.51,
+,,Uncertainty Coefficient,Symmetric,.47,.18,,
 ,,,x Dependent,.31,.15,2.02,
 ,,,y Dependent,1.00,.00,2.02,
 ,Ordinal by Ordinal,Somers' d,Symmetric,.00,,.00,
@@ -390,11 +390,11 @@ z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 ,Nominal by Interval,Eta,x Dependent,.04,,,
 ,,,y Dependent,1.00,,,
 2,Nominal by Nominal,Lambda,Symmetric,.50,.25,2.00,
-,,,x Dependent,.33,,1.15,
-,,,y Dependent,1.00,,1.15,
+,,,x Dependent,.33,.27,1.15,
+,,,y Dependent,1.00,.00,1.15,
 ,,Goodman and Kruskal tau,x Dependent,.33,,,
 ,,,y Dependent,1.00,,,
-,,Uncertainty Coefficient,Symmetric,.58,.17,1.56,
+,,Uncertainty Coefficient,Symmetric,.58,.17,,
 ,,,x Dependent,.41,.17,2.36,
 ,,,y Dependent,1.00,.00,2.36,
 ,Ordinal by Ordinal,Somers' d,Symmetric,-.67,,-1.73,
@@ -1031,8 +1031,8 @@ x * y,1296.000,100.0%,.000,0.0%,1296.000,100.0%
 Table: Directional measures.
 Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Nominal by Nominal,Lambda,Symmetric,.423,.021,16.875,
-,,x Dependent,.497,,15.986,
-,,y Dependent,.370,,16.339,
+,,x Dependent,.497,.024,15.986,
+,,y Dependent,.370,.020,16.339,
 ,Goodman and Kruskal tau,x Dependent,.382,,,
 ,,y Dependent,.198,,,
 
@@ -1045,8 +1045,8 @@ x * y,137.000,100.0%,.000,0.0%,137.000,100.0%
 Table: Directional measures.
 Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Nominal by Nominal,Lambda,Symmetric,.259,.081,2.902,
-,,x Dependent,.250,,2.479,
-,,y Dependent,.267,,2.766,
+,,x Dependent,.250,.089,2.479,
+,,y Dependent,.267,.085,2.766,
 ,Goodman and Kruskal tau,x Dependent,.129,,,
 ,,y Dependent,.123,,,
 
@@ -1059,8 +1059,8 @@ x * y,6800.000,100.0%,.000,0.0%,6800.000,100.0%
 Table: Directional measures.
 Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Nominal by Nominal,Lambda,Symmetric,.208,.010,18.793,
-,,x Dependent,.224,,16.076,
-,,y Dependent,.192,,14.438,
+,,x Dependent,.224,.013,16.076,
+,,y Dependent,.192,.012,14.438,
 ,Goodman and Kruskal tau,x Dependent,.089,,,
 ,,y Dependent,.081,,,
 ])
@@ -1373,8 +1373,8 @@ N of Valid Cases,,148.000,,,
 Table: Directional measures.
 Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Nominal by Nominal,Lambda,Symmetric,.338,.059,4.743,
-,,x Dependent,.640,,4.875,
-,,y Dependent,.174,,3.248,
+,,x Dependent,.640,.085,4.875,
+,,y Dependent,.174,.050,3.248,
 ,Goodman and Kruskal tau,x Dependent,.534,,,
 ,,y Dependent,.167,,,
 Ordinal by Ordinal,Somers' d,Symmetric,-.074,,-1.022,
@@ -1397,8 +1397,8 @@ N of Valid Cases,,212.000,,,
 Table: Directional measures.
 Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 Nominal by Nominal,Lambda,Symmetric,.102,.067,1.473,
-,,x Dependent,.027,,.302,
-,,y Dependent,.165,,2.349,
+,,x Dependent,.027,.087,.302,
+,,y Dependent,.165,.065,2.349,
 ,Goodman and Kruskal tau,x Dependent,.051,,,
 ,,y Dependent,.068,,,
 Ordinal by Ordinal,Somers' d,Symmetric,.209,,3.338,
@@ -1406,3 +1406,98 @@ Ordinal by Ordinal,Somers' d,Symmetric,.209,,3.338,
 ,,y Dependent,.217,.064,3.338,
 ])
 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 format=csv crosstabs.sps], [0], [dnl
+Table: Summary.
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+x * y,66.0000,100.0%,.0000,0.0%,66.0000,100.0%
+
+Table: Chi-square tests.
+Statistic,Value,df,Asymp. 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.
+Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+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.
+Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+Nominal by Nominal,Lambda,Symmetric,.0455,.1629,.2723,
+,,x Dependent,.0000,.0000,NaN,
+,,y Dependent,.0500,.1791,.2723,
+,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,
+,,x Dependent,.1152,.0572,1.9920,
+,,y Dependent,.6573,.1417,1.9920,
+])
+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 format=csv uc.sps], [0], [dnl
+Table: Summary.
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+x * y,987.000,100.0%,.000,0.0%,987.000,100.0%
+
+Table: Directional measures.
+Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+Nominal by Nominal,Lambda,Symmetric,.000,.000,NaN,
+,,x Dependent,.000,.000,NaN,
+,,y Dependent,.000,.000,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,
+])
+AT_CLEANUP