more missing value tests
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Jun 2022 02:19:18 +0000 (19:19 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Jun 2022 02:19:18 +0000 (19:19 -0700)
tests/language/stats/ctables.at

index 8f038da121ca43f5cb1ceef6fa8afd570f0bc861..49525da66fecf7d2183b95c7c2e837b302402bd0 100644 (file)
@@ -983,7 +983,7 @@ END DATA.
 MISSING VALUES x (1, 2) y (2, 3).
 VARIABLE LEVEL ALL (NOMINAL).
 
-*TABLES /TABLE x[COUNT, TOTALS[COUNT, VALIDN, TOTALN]]
+CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
     /CATEGORIES VARIABLES=ALL TOTAL=YES.
 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
@@ -996,6 +996,19 @@ AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
+│x 3.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
+│  4.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
+│  5.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
+│  Total│   18│  100.0%│          100.0%│          100.0%│     18│     36│
+╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
+dnl Note that Column Total N % doesn't add up to 100 because missing
+dnl values are included in the total but not shown as a category and this
+dnl is expected behavior.
+
+                               Custom Tables
+╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
+│       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
+├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
 │x 1.00 │    6│   20.0%│             .0%│           16.7%│       │       │
 │  2.00 │    6│   20.0%│             .0%│           16.7%│       │       │
 │  3.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
@@ -1003,7 +1016,7 @@ AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
 │  5.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
 │  Total│   30│  100.0%│          100.0%│          100.0%│     18│     36│
 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
-dnl Note that the Total N % doesn't add up to 100 because system-missing
+dnl Note that Column Total N % doesn't add up to 100 because system-missing
 dnl values are included in the total but not shown as a category and this
 dnl is expected behavior.
 ])