CROSSTABS: Add test to verify treatment of ties.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 11 May 2014 04:01:35 +0000 (21:01 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 11 May 2014 04:01:35 +0000 (21:01 -0700)
From an example provided privately by Douglas Bonett.

tests/language/stats/crosstabs.at

index 1191215333c6997361a7f68ccd349b928756f5f1..31546677686d20425d837076019d8da6688a6394 100644 (file)
@@ -1066,6 +1066,41 @@ Nominal by Nominal,Lambda,Symmetric,.208,.010,18.793,.000
 ])
 AT_CLEANUP
 
+AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - treatment of ties])
+AT_DATA([lambda.sps], [dnl
+SET FORMAT F8.3.
+
+* From Douglas Bonett.
+DATA LIST LIST NOTABLE/x y w.
+WEIGHT BY w.
+BEGIN DATA.
+1 1 225
+1 2 43
+1 3 216
+2 1 3
+2 2 1
+2 3 12
+END DATA.
+
+CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA.
+])
+AT_CHECK([pspp -O format=csv lambda.sps], [0], [dnl
+Table: Summary.
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+x * y,500.000,100.0%,.000,0.0%,500.000,100.0%
+
+Table: Directional measures.
+Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig.
+Nominal by Nominal,Lambda,Symmetric,.031,.013,2.336,.019
+,,x Dependent,.000,.000,NaN,NaN
+,,y Dependent,.033,.014,2.336,.019
+,Goodman and Kruskal tau,x Dependent,.012,,,.   @&t@
+,,y Dependent,.009,,,.   @&t@
+])
+AT_CLEANUP
+
 AT_SETUP([CROSSTABS Somers' D, Tau-B, Tau-C, Gamma])
 AT_DATA([somersd.sps], [dnl
 SET FORMAT F8.3.