ROWLABELS=LAYER works
[pspp] / tests / language / stats / crosstabs.at
index 7e8a3f91eba94204672ba63c4eb0a171c9db2986..f51c3345a4132c92ac83573634f009c954aea7d6 100644 (file)
@@ -1,21 +1,82 @@
 dnl PSPP - a program for statistical analysis.
 dnl Copyright (C) 2017 Free Software Foundation, Inc.
-dnl 
+dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
 dnl the Free Software Foundation, either version 3 of the License, or
 dnl (at your option) any later version.
-dnl 
+dnl
 dnl This program is distributed in the hope that it will be useful,
 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 dnl GNU General Public License for more details.
-dnl 
+dnl
 dnl You should have received a copy of the GNU General Public License
 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl
 AT_BANNER([CROSSTABS procedure])
 
+dnl Based on bug #60982.
+AT_SETUP([CROSSTABS residuals])
+AT_DATA([crosstabs.sps],
+  [DATASET CLOSE ALL.
+DATA LIST LIST NOTABLE/ r c n.
+BEGIN DATA
+1 1 26
+1 2 31
+2 1 12
+2 2 32
+3 1 27
+3 2 18
+4 1 8
+4 2 7
+END DATA.
+WEIGHT by n.
+CROSSTABS r by c /STATISTICS=CHISQ
+/CELLS=COUNT EXPECTED RESID SRESID ASRESID.
+])
+AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
+  [Table: Summary
+,Cases,,,,,
+,Valid,,Missing,,Total,
+,N,Percent,N,Percent,N,Percent
+r × c,161.00,100.0%,.00,.0%,161.00,100.0%
+
+Table: r × c
+,,,c,,Total
+,,,1.00,2.00,
+r,1.00,Count,26.00,31.00,57.00
+,,Expected,25.84,31.16,.35
+,,Residual,.16,-.16,
+,,Std. Residual,.03,-.03,
+,,Adjusted Residual,.05,-.05,
+,2.00,Count,12.00,32.00,44.00
+,,Expected,19.95,24.05,.27
+,,Residual,-7.95,7.95,
+,,Std. Residual,-1.78,1.62,
+,,Adjusted Residual,-2.82,2.82,
+,3.00,Count,27.00,18.00,45.00
+,,Expected,20.40,24.60,.28
+,,Residual,6.60,-6.60,
+,,Std. Residual,1.46,-1.33,
+,,Adjusted Residual,2.33,-2.33,
+,4.00,Count,8.00,7.00,15.00
+,,Expected,6.80,8.20,.09
+,,Residual,1.20,-1.20,
+,,Std. Residual,.46,-.42,
+,,Adjusted Residual,.65,-.65,
+Total,,Count,73.00,88.00,161.00
+,,Expected,.45,.55,1.00
+
+Table: Chi-Square Tests
+,Value,df,Asymptotic Sig. (2-tailed)
+Pearson Chi-Square,10.09,3.00,.018
+Likelihood Ratio,10.35,3.00,.016
+Linear-by-Linear Association,1.96,1.00,.162
+N of Valid Cases,161.00,,
+])
+AT_CLEANUP
+
 AT_SETUP([CROSSTABS integer mode crash])
 AT_DATA([crosstabs.sps],
   [DATA LIST LIST /A * B * X * Y * .
@@ -44,13 +105,13 @@ Table: X × Y
 ,,,Y,,,,,,,Total
 ,,,1.00,2.00,3.00,4.00,5.00,6.00,7.00,
 X,1.00,Count,0,0,0,0,0,0,0,0
-,2.00,,0,0,0,0,0,0,0,0
-,3.00,,0,0,0,0,0,0,0,0
-,4.00,,0,0,0,0,1,0,0,1
-,5.00,,0,0,0,0,0,0,0,0
-,6.00,,0,0,0,0,0,0,0,0
-,7.00,,0,0,0,0,0,0,0,0
-Total,,,0,0,0,0,1,0,0,1
+,2.00,Count,0,0,0,0,0,0,0,0
+,3.00,Count,0,0,0,0,0,0,0,0
+,4.00,Count,0,0,0,0,1,0,0,1
+,5.00,Count,0,0,0,0,0,0,0,0
+,6.00,Count,0,0,0,0,0,0,0,0
+,7.00,Count,0,0,0,0,0,0,0,0
+Total,,Count,0,0,0,0,1,0,0,1
 ]])
 AT_CLEANUP
 
@@ -79,8 +140,12 @@ Table: Summary
 x × y,0,.0%,1,100.0%,1,100.0%
 
 Table: x × y
-,,
-,,
+,,,y,,,,,,,Total
+,,,1.00,2.00,3.00,4.00,5.00,6.00,7.00,
+x,1.00,Count,,,,,,,,
+,2.00,Count,,,,,,,,
+,3.00,Count,,,,,,,,
+Total,,Count,,,,,,,,
 ]])
 AT_CLEANUP
 
@@ -120,9 +185,9 @@ Table: x × y
 ,,,y,,,,Total
 ,,,one unity,three lots,two duality,zero none,
 x,1.00,Count,1,0,0,1,2
-,2.00,,0,0,1,0,1
-,3.00,,0,1,0,0,1
-Total,,,1,1,1,1,4
+,2.00,Count,0,0,1,0,1
+,3.00,Count,0,1,0,0,1
+Total,,Count,1,1,1,1,4
 ]])
 AT_CLEANUP
 
@@ -134,15 +199,15 @@ AT_DATA([crosstabs.sps],
        z   4.
 
 BEGIN DATA.
-0111 
-0222 
-0311 
-0412 
-0521 
-0612 
-0711 
-0811 
-0912 
+0111
+0222
+0311
+0412
+0521
+0612
+0711
+0811
+0912
 END DATA.
 
 LIST.
@@ -153,9 +218,9 @@ CROSSTABS TABLES  y by z.
 AT_CHECK([pspp -o - -O format=csv -o pspp.txt crosstabs.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-x,1,1-  2,F2.0
-y,1,3-  3,F1.0
-z,1,4-  4,F1.0
+x,1,1-2,F2.0
+y,1,3-3,F1.0
+z,1,4-4,F1.0
 
 Table: Data List
 x,y,z
@@ -179,8 +244,8 @@ Table: y × z
 ,,,z,,Total
 ,,,1,2,
 y,1,Count,4,3,7
-,2,,1,1,2
-Total,,,5,4,9
+,2,Count,1,1,2
+Total,,Count,5,4,9
 ])
 AT_CLEANUP
 
@@ -216,9 +281,9 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,2.00,Count,0,1,1
-,3.00,,1,0,1
-,4.00,,1,1,2
-Total,,,2,2,4
+,3.00,Count,1,0,1
+,4.00,Count,1,1,2
+Total,,Count,2,2,4
 
 Table: Chi-Square Tests
 ,Value,df,Asymptotic Sig. (2-tailed)
@@ -250,7 +315,7 @@ SPLIT FILE SEPARATE BY v0.
 
 CROSSTABS
     /TABLES= v1 BY v2
-    /FORMAT=AVALUE TABLES PIVOT
+    /FORMAT=AVALUE TABLES
     /STATISTICS=CHISQ
     /CELLS=COUNT ROW COLUMN TOTAL.
 ])
@@ -336,15 +401,15 @@ AT_DATA([crosstabs.sps],
        z   4.
 
 BEGIN DATA.
-0111 
-0222 
-0311 
-0412 
-0521 
-0612 
-0711 
-0811 
-0912 
+0111
+0222
+0311
+0412
+0521
+0612
+0711
+0811
+0912
 END DATA.
 
 LIST.
@@ -355,9 +420,9 @@ CROSSTABS TABLES  x BY y BY z/STATISTICS=ALL.
 AT_CHECK([pspp -o - -O format=csv -o pspp.csv -o pspp.txt crosstabs.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-x,1,1-  2,F2.0
-y,1,3-  3,F1.0
-z,1,4-  4,F1.0
+x,1,1-2,F2.0
+y,1,3-3,F1.0
+z,1,4-4,F1.0
 
 Table: Data List
 x,y,z
@@ -381,16 +446,16 @@ Table: x × y × z
 ,,,,,y,,Total
 ,,,,,1,2,
 z,1,x,1,Count,1,0,1
-,,,3,,0,0,1
-,,,5,,1,0,1
-,,,7,,0,0,1
-,,,8,,0,1,1
-,,Total,,,4,1,5
-,2,x,2,,0,0,1
-,,,4,,0,1,1
-,,,6,,0,0,1
-,,,9,,1,0,1
-,,Total,,,3,1,4
+,,,3,Count,0,0,1
+,,,5,Count,1,0,1
+,,,7,Count,0,0,1
+,,,8,Count,0,1,1
+,,Total,,Count,4,1,5
+,2,x,2,Count,0,0,1
+,,,4,Count,0,1,1
+,,,6,Count,0,0,1
+,,,9,Count,1,0,1
+,,Total,,Count,3,1,4
 
 Table: Chi-Square Tests
 ,,,Value,df,Asymptotic Sig. (2-tailed)
@@ -493,8 +558,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,2.80,3.20,6.00
-,2.00,,1.00,2.00,3.00
-Total,,,3.80,5.20,9.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,3.80,5.20,9.00
 
 Table: Summary
 ,Cases,,,,,
@@ -506,8 +571,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,2.80,3.20,6.00
-,2.00,,1.00,2.00,3.00
-Total,,,3.80,5.20,9.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,3.80,5.20,9.00
 
 Table: Summary
 ,Cases,,,,,
@@ -519,8 +584,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,2.00,4.00,6.00
-,2.00,,1.00,2.00,3.00
-Total,,,3.00,6.00,9.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,3.00,6.00,9.00
 
 Table: Summary
 ,Cases,,,,,
@@ -532,8 +597,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,2.00,2.00,4.00
-,2.00,,1.00,2.00,3.00
-Total,,,3.00,4.00,7.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,3.00,4.00,7.00
 
 Table: Summary
 ,Cases,,,,,
@@ -545,8 +610,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,3.00,3.00,6.00
-,2.00,,1.00,2.00,3.00
-Total,,,4.00,5.00,9.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,4.00,5.00,9.00
 
 Table: Summary
 ,Cases,,,,,
@@ -558,8 +623,8 @@ Table: x × y
 ,,,y,,Total
 ,,,1.00,2.00,
 x,1.00,Count,2.00,3.00,5.00
-,2.00,,1.00,2.00,3.00
-Total,,,3.00,5.00,8.00
+,2.00,Count,1.00,2.00,3.00
+Total,,Count,3.00,5.00,8.00
 ])
 AT_CLEANUP
 
@@ -592,9 +657,9 @@ Table: x × y
 ,,,y,,Total
 ,,,2.00,1.00,
 x,4.00,Count,0,1,1
-,3.00,,2,1,3
-,2.00,,2,0,2
-Total,,,4,2,6
+,3.00,Count,2,1,3
+,2.00,Count,2,0,2
+Total,,Count,4,2,6
 ])
 AT_CLEANUP
 
@@ -632,206 +697,206 @@ SET DECIMAL DOT.
 
 DATA LIST notable LIST  /schtyp (F9.2) female (F9.2) ses (F9.2) .
 begin data.
-      1.00       .00      1.00 
-      1.00      1.00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      1.00 
-      1.00       .00      3.00 
-      2.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      2.00       .00      2.00 
-      2.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      2.00       .00      3.00 
-      1.00       .00      2.00 
-      2.00       .00      3.00 
-      1.00       .00      3.00 
-      2.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      2.00       .00      2.00 
-      2.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      1.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      2.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      2.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      2.00       .00      2.00 
-      1.00       .00      2.00 
-      2.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      2.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      1.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      2.00 
-      1.00       .00      1.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      1.00 
-      2.00       .00      2.00 
-      1.00       .00      1.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      3.00 
-      1.00       .00      2.00 
-      1.00       .00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      2.00      1.00      3.00 
-      1.00      1.00      3.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      2.00      1.00      1.00 
-      2.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      2.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      2.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      2.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      2.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      2.00      1.00      3.00 
-      1.00      1.00      2.00 
-      2.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      2.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      1.00 
-      2.00      1.00      2.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      2.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      2.00 
-      1.00      1.00      2.00 
-      2.00      1.00      3.00 
-      1.00      1.00      1.00 
-      1.00      1.00      1.00 
-      2.00      1.00      3.00 
-      2.00      1.00      2.00 
-      1.00      1.00      3.00 
-      2.00      1.00      2.00 
-      2.00      1.00      2.00 
-      1.00      1.00      2.00 
-      2.00      1.00      2.00 
-      1.00      1.00      2.00 
-      1.00      1.00      3.00 
+      1.00       .00      1.00
+      1.00      1.00      2.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      1.00
+      1.00       .00      3.00
+      2.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      2.00       .00      2.00
+      2.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      2.00       .00      3.00
+      1.00       .00      2.00
+      2.00       .00      3.00
+      1.00       .00      3.00
+      2.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      2.00       .00      2.00
+      2.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      1.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      2.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      2.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      2.00       .00      2.00
+      1.00       .00      2.00
+      2.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      2.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      1.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      2.00
+      1.00       .00      1.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      1.00
+      2.00       .00      2.00
+      1.00       .00      1.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      3.00
+      1.00       .00      2.00
+      1.00       .00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      2.00      1.00      3.00
+      1.00      1.00      3.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      2.00      1.00      1.00
+      2.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      2.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      2.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      2.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      2.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      2.00      1.00      3.00
+      1.00      1.00      2.00
+      2.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      2.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      1.00
+      2.00      1.00      2.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      2.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      2.00
+      1.00      1.00      2.00
+      2.00      1.00      3.00
+      1.00      1.00      1.00
+      1.00      1.00      1.00
+      2.00      1.00      3.00
+      2.00      1.00      2.00
+      1.00      1.00      3.00
+      2.00      1.00      2.00
+      2.00      1.00      2.00
+      1.00      1.00      2.00
+      2.00      1.00      2.00
+      1.00      1.00      2.00
+      1.00      1.00      3.00
 end data.
 
 VARIABLE LABEL schtyp 'type of school'.
@@ -854,8 +919,8 @@ Table: type of school × female
 ,,,female,,Total
 ,,,male,female,
 type of school,public,Count,77,91,168
-,private,,14,18,32
-Total,,,91,109,200
+,private,Count,14,18,32
+Total,,Count,91,109,200
 
 Table: Chi-Square Tests
 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
@@ -876,8 +941,8 @@ Table: female × ses
 ,,,ses,,,Total
 ,,,low,middle,high,
 female,male,Count,15,47,29,91
-,female,,32,48,29,109
-Total,,,47,95,58,200
+,female,Count,32,48,29,109
+Total,,Count,47,95,58,200
 
 Table: Chi-Square Tests
 ,Value,df,Asymptotic Sig. (2-tailed)
@@ -916,10 +981,10 @@ Table: x × y
 ,,,y,,,,,Total
 ,,,4.000,6.000,10.000,12.000,13.000,
 x,1.000,Count,1,0,0,0,0,1
-,3.000,,0,1,0,0,0,1
-,5.000,,0,0,1,1,0,2
-,6.000,,0,0,0,0,1,1
-Total,,,1,1,1,1,1,5
+,3.000,Count,0,1,0,0,0,1
+,5.000,Count,0,0,1,1,0,2
+,6.000,Count,0,0,0,0,1,1
+Total,,Count,1,1,1,1,1,5
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -961,16 +1026,16 @@ Table: x × y
 ,,,y,,,,,,,,,Total
 ,,,1.500,4.000,5.000,6.000,6.500,7.000,9.000,10.500,11.000,
 x,1.000,Count,1,0,0,0,0,0,0,0,0,1
-,2.000,,1,0,0,0,0,0,0,0,0,1
-,3.000,,0,1,0,0,0,0,0,0,0,1
-,4.000,,0,0,0,1,0,0,0,0,0,1
-,5.000,,0,0,1,0,0,0,0,0,0,1
-,6.000,,0,0,0,0,0,1,0,0,0,1
-,7.000,,0,0,0,0,1,0,0,0,0,1
-,8.000,,0,0,0,0,0,0,1,0,0,1
-,9.000,,0,0,0,0,0,0,0,1,0,1
-,10.000,,0,0,0,0,0,0,0,0,1,1
-Total,,,2,1,1,1,1,1,1,1,1,10
+,2.000,Count,1,0,0,0,0,0,0,0,0,1
+,3.000,Count,0,1,0,0,0,0,0,0,0,1
+,4.000,Count,0,0,0,1,0,0,0,0,0,1
+,5.000,Count,0,0,1,0,0,0,0,0,0,1
+,6.000,Count,0,0,0,0,0,1,0,0,0,1
+,7.000,Count,0,0,0,0,1,0,0,0,0,1
+,8.000,Count,0,0,0,0,0,0,1,0,0,1
+,9.000,Count,0,0,0,0,0,0,0,1,0,1
+,10.000,Count,0,0,0,0,0,0,0,0,1,1
+Total,,Count,2,1,1,1,1,1,1,1,1,10
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -1011,13 +1076,13 @@ Table: x × y
 ,,,y,,,,,,,,Total
 ,,,28.000,58.000,66.000,75.000,85.000,87.000,91.000,122.000,
 x,25.000,Count,1,0,0,0,0,0,0,0,1
-,35.000,,0,1,0,0,0,0,0,0,1
-,44.000,,0,0,1,0,0,0,0,0,1
-,50.000,,0,0,0,1,0,0,0,0,1
-,56.000,,0,0,0,0,0,1,1,0,2
-,65.000,,0,0,0,0,1,0,1,0,2
-,87.000,,0,0,0,0,0,0,0,1,1
-Total,,,1,1,1,1,1,1,2,1,9
+,35.000,Count,0,1,0,0,0,0,0,0,1
+,44.000,Count,0,0,1,0,0,0,0,0,1
+,50.000,Count,0,0,0,1,0,0,0,0,1
+,56.000,Count,0,0,0,0,0,1,1,0,2
+,65.000,Count,0,0,0,0,1,0,1,0,2
+,87.000,Count,0,0,0,0,0,0,0,1,1
+Total,,Count,1,1,1,1,1,1,2,1,9
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -1061,15 +1126,15 @@ Table: x × y
 ,,,y,,,,,,,,,,,,Total
 ,,,2.000,4.000,5.000,7.000,9.000,11.000,12.000,14.000,15.000,17.000,18.000,20.000,
 x,2.000,Count,0,0,0,1,0,0,0,0,0,0,0,0,1
-,3.000,,0,0,0,0,0,0,1,0,0,0,0,0,1
-,4.000,,0,0,0,0,1,1,0,0,0,0,0,0,2
-,5.000,,0,0,1,0,0,0,0,0,0,0,0,0,1
-,6.000,,1,1,0,0,0,0,0,0,0,0,0,0,2
-,7.000,,0,0,0,0,0,0,0,1,0,0,0,0,1
-,8.000,,0,0,0,0,0,0,0,0,1,0,0,0,1
-,9.000,,0,0,0,0,0,0,0,0,0,1,0,0,1
-,10.000,,0,0,0,0,0,0,0,0,0,0,1,1,2
-Total,,,1,1,1,1,1,1,1,1,1,1,1,1,12
+,3.000,Count,0,0,0,0,0,0,1,0,0,0,0,0,1
+,4.000,Count,0,0,0,0,1,1,0,0,0,0,0,0,2
+,5.000,Count,0,0,1,0,0,0,0,0,0,0,0,0,1
+,6.000,Count,1,1,0,0,0,0,0,0,0,0,0,0,2
+,7.000,Count,0,0,0,0,0,0,0,1,0,0,0,0,1
+,8.000,Count,0,0,0,0,0,0,0,0,1,0,0,0,1
+,9.000,Count,0,0,0,0,0,0,0,0,0,1,0,0,1
+,10.000,Count,0,0,0,0,0,0,0,0,0,0,1,1,2
+Total,,Count,1,1,1,1,1,1,1,1,1,1,1,1,12
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -1111,16 +1176,16 @@ Table: x × y
 ,,,y,,,,,,,,,,Total
 ,,,15000.00,26000.00,29000.00,32000.00,33000.00,41000.00,45000.00,52000.00,68000.00,80000.00,
 x,18.000,Count,1,0,0,0,0,0,0,0,0,0,1
-,24.000,,0,1,0,0,0,0,0,0,0,0,1
-,25.000,,0,0,1,0,0,0,0,0,0,0,1
-,26.000,,0,0,0,1,0,0,0,0,0,0,1
-,33.000,,0,0,0,0,1,0,0,0,0,0,1
-,37.000,,0,0,0,0,0,1,0,0,0,0,1
-,40.000,,0,0,0,0,0,0,1,0,0,0,1
-,45.000,,0,0,0,0,0,0,0,1,0,0,1
-,57.000,,0,0,0,0,0,0,0,0,1,0,1
-,64.000,,0,0,0,0,0,0,0,0,0,1,1
-Total,,,1,1,1,1,1,1,1,1,1,1,10
+,24.000,Count,0,1,0,0,0,0,0,0,0,0,1
+,25.000,Count,0,0,1,0,0,0,0,0,0,0,1
+,26.000,Count,0,0,0,1,0,0,0,0,0,0,1
+,33.000,Count,0,0,0,0,1,0,0,0,0,0,1
+,37.000,Count,0,0,0,0,0,1,0,0,0,0,1
+,40.000,Count,0,0,0,0,0,0,1,0,0,0,1
+,45.000,Count,0,0,0,0,0,0,0,1,0,0,1
+,57.000,Count,0,0,0,0,0,0,0,0,1,0,1
+,64.000,Count,0,0,0,0,0,0,0,0,0,1,1
+Total,,Count,1,1,1,1,1,1,1,1,1,1,10
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -1639,7 +1704,7 @@ AT_CLEANUP
 
 AT_SETUP([CROSSTABS Cohens Kappa])
 
-dnl Example from Wood J. M. 
+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
@@ -1655,7 +1720,7 @@ end data.
 weight by w.
 
 crosstabs /table = p1 by p2
-       statistics = kappa
+       /statistics = kappa
        .
 ])
 
@@ -1671,8 +1736,8 @@ 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
+,1.000,Count,1.000,.000,1.000
+Total,,Count,19.000,1.000,20.000
 
 Table: Symmetric Measures
 ,,Value,Asymp. Std. Error,Approx. T
@@ -1814,8 +1879,8 @@ Table: factor × disease
 ,,,disease,,Total
 ,,,Yes,No,
 factor,Placebo,Count,20,80,100
-,Aspirin,,15,135,150
-Total,,,35,215,250
+,Aspirin,Count,15,135,150
+Total,,Count,35,215,250
 
 Table: Chi-Square Tests
 ,Value,df,Asymptotic Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
@@ -1858,7 +1923,7 @@ END DATA.
 
 WEIGHT BY w.
 
-CROSSTABS 
+CROSSTABS
          /table x BY y BY z
          /table x BY y
          /barchart.