CROSSTABS: Don't calculate symmetric uncertainty coefficient approx T.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 6 May 2014 07:13:42 +0000 (00:13 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 6 May 2014 07:13:42 +0000 (00:13 -0700)
It was calculated wrong.

doc/statistics.texi
src/language/stats/crosstabs.q
tests/language/stats/crosstabs.at

index 6ae9da9577582d4f11d9f82e25adccbb2ca272f4..e366468ee4bc2ad3ab74c541d6618b2f034bbda0 100644 (file)
@@ -608,7 +608,7 @@ Significance of symmetric and directional measures is not calculated.
 Asymptotic standard error is not calculated for asymmetric lambda, 
 Goodman and Kruskal's tau, or symmetric Somers' d.
 @item
-Approximate T of uncertainty coefficient is wrong.
+Approximate T is not calculated for symmetric uncertainty coefficient.
 @end itemize
 
 Fixes for any of these deficiencies would be welcomed.
index e3f5aee1d573ec8dc105d085538cc677090fcd26..23859b5dd40baf6ea2bc9a07e555a834ba4c6330 100644 (file)
@@ -18,9 +18,9 @@
 
    - How to calculate significance of symmetric and directional measures?
    - How to calculate ASE for asymmetric lambda?
-   - How to calculate ASE for symmetric Somers' d?
+   - How to calculate ASE for symmetric Somers ' d?
    - How to calculate ASE for Goodman and Kruskal's tau?
-   - Approx. T of uncertainty coefficient is wrong.
+   - How to calculate approx. T of symmetric uncertainty coefficient?
 
 */
 
@@ -2920,8 +2920,7 @@ calc_directional (struct crosstabs_proc *proc, struct pivot_table *pt,
 
       v[5] = 2. * ((UX + UY - UXY) / (UX + UY));
       ase[5] = (2. / (pt->total * pow2 (UX + UY))) * sqrt (ase1_sym);
-      t[5] = v[5] / ((2. / (pt->total * (UX + UY)))
-                    * sqrt (P - pow2 (UX + UY - UXY) / pt->total));
+      t[5] = SYSMIS;
 
       v[6] = (UX + UY - UXY) / UX;
       ase[6] = sqrt (ase1_xy) / (pt->total * UX * UX);
index a0a34396a718acfded2cda66502651de31e0bcd8..7a441de1af0a2ce860368fc2fb3c8b87dcb86e4f 100644 (file)
@@ -381,7 +381,7 @@ z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 ,,,y Dependent,1.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,
@@ -394,7 +394,7 @@ z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
 ,,,y Dependent,1.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,
@@ -1456,7 +1456,7 @@ Nominal by Nominal,Lambda,Symmetric,.0455,.1629,.2723,
 ,,y Dependent,.0500,,.2723,
 ,Goodman and Kruskal tau,x Dependent,.1054,,,
 ,,y Dependent,.0434,,,
-,Uncertainty Coefficient,Symmetric,.0780,.0474,1.5105,
+,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,
@@ -1464,3 +1464,40 @@ Ordinal by Ordinal,Somers' d,Symmetric,.1960,,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,,NaN,
+,,y Dependent,.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