areapct_sum
[pspp] / tests / language / stats / ctables.at
index 49525da66fecf7d2183b95c7c2e837b302402bd0..7a52b185defa09e0717ec07f160f6119452f3d04 100644 (file)
@@ -2,31 +2,12 @@ AT_BANNER([CTABLES])
 
 dnl Features not yet implemented:
 dnl
-dnl - Date/time variables and values
 dnl - SPLIT FILE with SEPARATE splits
 dnl - Definition of columns/rows when labels are rotated from one axis to another.
 dnl - Preprocessing to distinguish categorical from scale.
-dnl - )CILEVEL in summary specifications
-dnl - Summary functions:
-dnl   * Unimplemented ones.
-dnl   * U-prefix for unweighted summaries.
-dnl   * .LCL and .UCL suffixes.
-dnl   * .SE suffixes.
-dnl   * Why are summary functions for scale variables also available for totals and subtotals?
-dnl - CATEGORIES:
-dnl   * String values
-dnl   * Date values
-dnl   * Data-dependent sorting.
-dnl - TITLES: )DATE, )TIME, )TABLE.
-dnl - SMISSING (see documentation).
 dnl - PCOMPUTE:
-dnl   * multi-dimensional
-dnl   * MISSING, OTHERNM
-dnl   * strings
-dnl - PPROPERTIES:
-dnl   * )LABEL[N].
-dnl   * summary statistics and formats?
-dnl - Are string ranges a thing?
+dnl   * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
+dnl   * dates
 dnl
 dnl Features not yet tested:
 dnl - Parsing (positive and negative)
@@ -35,18 +16,37 @@ dnl - Testing details of missing value handling in summaries.
 dnl - test CLABELS ROWLABELS=LAYER.
 dnl - Test VLABELS.
 dnl - Test WEIGHT and adjustment weights.
-dnl - Test PCOMPUTE and PPROPERTIES.
+dnl - EMPTY=INCLUDE For string ranges.
 dnl - Summary functions:
 dnl   * Separate summary functions for totals and subtotals.
+dnl   * )CILEVEL in summary label specification
+dnl Category sorting:
+dnl   * VALUE
+dnl   * LABEL
+dnl   * ascending/descending
 dnl - CATEGORIES:
-dnl   * THRU
+dnl   * String values
+dnl   * Date values
+dnl   * THRU (numeric ranges)
+dnl   * THRU (string ranges)
 dnl   * OTHERNM
 dnl - FORMAT:
 dnl   * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
 dnl   * EMPTY.
 dnl   * MISSING.
 dnl - HIDESMALLCOUNTS.
+dnl - Date/time variables and values
 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
+dnl - TITLES: )DATE, )TIME, )TABLE.
+dnl - Test PCOMPUTE:
+dnl   * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
+dnl   * MISSING, OTHERNM
+dnl   * strings and string ranges
+dnl - PPROPERTIES:
+dnl   * )LABEL[N].
+dnl - Summary functions:
+dnl   * U-prefix for unweighted summaries.
+dnl   * areaPCT.SUM and UareaPCT.SUM functions.
 dnl
 dnl Not for v1:
 dnl - Multiple response sets
@@ -54,6 +54,11 @@ dnl - MRSETS subcommand.
 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
 dnl - SIGTEST
 dnl - COMPARETEST
+dnl - Summary functions:
+dnl   * .LCL and .UCL suffixes.
+dnl   * .SE suffixes.
+dnl - CATEGORIES:
+dnl   * Data-dependent sorting.
 dnl
 dnl
 dnl Bug:
@@ -858,31 +863,31 @@ AT_DATA([ctables.sps],
 CTABLES
     /PCOMPUTE &x=EXPR([3] + [4])
     /PCOMPUTE &y=EXPR([4] + [5])
-    /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
+    /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
     /PPROPERTIES &y LABEL='4+5'
     /TABLE=qn105ba BY qns1
     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
 ]])
 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
                                                       Custom Tables
\95­â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¬────────────────────────────────────────────────────────────╮
-│                                                         │ S1. Including yourself, how many members of this household │
-│                                                         │                    are age 16 or older?                    │
-│                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
-│                                                         │   1   │   2   │ Subtotal│   5   │   3+4  │  4+5 │ Subtotal │
-│                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
-│                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
\94\9câ\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼─────────┼───────┼────────┼──────┼──────────┤
-│105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     11│      81│    30│        92│
-│had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
-│Get stopped by the police?                    Very likely│    384│    552│      936│     14│     171│    65│       185│
-│                                              Somewhat   │    590│   1249│     1839│     20│     265│    92│       285│
-│                                              likely     │       │       │         │       │        │      │          │
-│                                              Somewhat   │    278│    647│      925│      6│     116│    38│       122│
-│                                              unlikely   │       │       │         │       │        │      │          │
-│                                              Very       │    141│    290│      431│      4│      59│    22│        63│
-│                                              unlikely   │       │       │         │       │        │      │          │
\95°â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´─────────┴───────┴────────┴──────┴──────────╯
\95­â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¬â\94\80────────────────────────────────────────────────────────────╮
+│                                                        │  S1. Including yourself, how many members of this household │
+│                                                        │                     are age 16 or older?                    │
+│                                                        ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
+│                                                        │   1   │   2   │ Subtotal │   5   │   3+4  │  4+5 │ Subtotal │
+│                                                        ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
+│                                                        │ Count │ Count │   Count  │ Count │  Count │ Count│   Count  │
\94\9câ\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80─────────┼───────┼────────┼──────┼──────────┤
+│105b. How likely is it that drivers who have Almost     │    147│    246│       393│     11│   81.00│    30│        92│
+│had too much to drink to drive safely will   certain    │       │       │          │       │        │      │          │
+│A. Get stopped by the police?                Very likely│    384│    552│       936│     14│  171.00│    65│       185│
+│                                             Somewhat   │    590│   1249│      1839│     20│  265.00│    92│       285│
+│                                             likely     │       │       │          │       │        │      │          │
+│                                             Somewhat   │    278│    647│       925│      6│  116.00│    38│       122│
+│                                             unlikely   │       │       │          │       │        │      │          │
+│                                             Very       │    141│    290│       431│      4│   59.00│    22│        63│
+│                                             unlikely   │       │       │          │       │        │      │          │
\95°â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94\80â\94´â\94\80─────────┴───────┴────────┴──────┴──────────╯
 ])
 AT_CLEANUP
 
@@ -987,9 +992,16 @@ CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLP
     /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.
-*CTABLES /TABLE x BY y.
-*CTABLES /TABLE x BY y /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
-*CTABLES /TABLE y BY x /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
+CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
+    /CATEGORIES VARIABLES=ALL TOTAL=YES
+    /SLABELS POSITION=ROW.
+CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
+    /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
+    /SLABELS POSITION=ROW.
+CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
+    /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES 
+    /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES 
+    /SLABELS POSITION=ROW.
 ]])
 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
                                Custom Tables
@@ -1019,5 +1031,226 @@ dnl is expected behavior.
 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.
+
+                     Custom Tables
+╭────────────────────────┬───────────────────────────╮
+│                        │             y             │
+│                        ├──────┬──────┬──────┬──────┤
+│                        │ 1.00 │ 4.00 │ 5.00 │ Total│
+├────────────────────────┼──────┼──────┼──────┼──────┤
+│x 3.00  Count           │     1│     1│     1│     3│
+│        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │     3│
+│        Total N         │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┤
+│  4.00  Count           │     1│     1│     1│     3│
+│        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │     3│
+│        Total N         │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┤
+│  5.00  Count           │     1│     1│     1│     3│
+│        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │     3│
+│        Total N         │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┤
+│  Total Count           │     3│     3│     3│     9│
+│        Column %        │100.0%│100.0%│100.0%│     .│
+│        Column Valid N %│100.0%│100.0%│100.0%│     .│
+│        Column Total N %│100.0%│100.0%│100.0%│     .│
+│        Row %           │     .│     .│     .│     .│
+│        Row Valid N %   │     .│     .│     .│     .│
+│        Row Total N %   │     .│     .│     .│     .│
+│        Valid N         │     3│     3│     3│     9│
+│        Total N         │     6│     6│     6│    36│
+╰────────────────────────┴──────┴──────┴──────┴──────╯
+
+                            Custom Tables
+╭────────────────────────┬─────────────────────────────────────────╮
+│                        │                    y                    │
+│                        ├──────┬──────┬──────┬──────┬──────┬──────┤
+│                        │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
+├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│x 1.00  Count           │     1│     1│     1│     1│     1│     5│
+│        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Column Valid N %│   .0%│     .│     .│   .0%│   .0%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
+│        Row Valid N %   │     .│     .│     .│     .│     .│     .│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │      │     0│
+│        Total N         │      │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│  2.00  Count           │     1│     1│     1│     1│     1│     5│
+│        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Column Valid N %│   .0%│     .│     .│   .0%│   .0%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
+│        Row Valid N %   │     .│     .│     .│     .│     .│     .│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │      │     0│
+│        Total N         │      │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│  3.00  Count           │     1│     1│     1│     1│     1│     5│
+│        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Column Valid N %│ 33.3%│     .│     .│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
+│        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │      │     3│
+│        Total N         │      │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│  4.00  Count           │     1│     1│     1│     1│     1│     5│
+│        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Column Valid N %│ 33.3%│     .│     .│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
+│        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │      │     3│
+│        Total N         │      │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│  5.00  Count           │     1│     1│     1│     1│     1│     5│
+│        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Column Valid N %│ 33.3%│     .│     .│ 33.3%│ 33.3%│     .│
+│        Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│     .│
+│        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
+│        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │      │     3│
+│        Total N         │      │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│  Total Count           │     5│     5│     5│     5│     5│    25│
+│        Column %        │100.0%│100.0%│100.0%│100.0%│100.0%│     .│
+│        Column Valid N %│100.0%│     .│     .│100.0%│100.0%│     .│
+│        Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│     .│
+│        Row %           │     .│     .│     .│     .│     .│     .│
+│        Row Valid N %   │     .│     .│     .│     .│     .│     .│
+│        Row Total N %   │     .│     .│     .│     .│     .│     .│
+│        Valid N         │     3│     0│     0│     3│     3│     9│
+│        Total N         │     6│     6│     6│     6│     6│    36│
+╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
+
+                        Custom Tables
+╭────────────────────────┬──────────────────────────────────╮
+│                        │                 y                │
+│                        ├──────┬──────┬──────┬──────┬──────┤
+│                        │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
+├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
+│x 1.00  Count           │     1│     1│     1│     1│     4│
+│        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
+│        Column Valid N %│   .0%│     .│   .0%│   .0%│     .│
+│        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
+│        Row Valid N %   │     .│     .│     .│     .│     .│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │     0│
+│        Total N         │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
+│  2.00  Count           │     1│     1│     1│     1│     4│
+│        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
+│        Column Valid N %│   .0%│     .│   .0%│   .0%│     .│
+│        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
+│        Row Valid N %   │     .│     .│     .│     .│     .│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │     0│
+│        Total N         │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
+│  3.00  Count           │     1│     1│     1│     1│     4│
+│        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
+│        Column Valid N %│ 50.0%│     .│ 50.0%│ 50.0%│     .│
+│        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
+│        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │     3│
+│        Total N         │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
+│  4.00  Count           │     1│     1│     1│     1│     4│
+│        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
+│        Column Valid N %│ 50.0%│     .│ 50.0%│ 50.0%│     .│
+│        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
+│        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
+│        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
+│        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
+│        Valid N         │      │      │      │      │     3│
+│        Total N         │      │      │      │      │     6│
+│ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
+│  Total Count           │     4│     4│     4│     4│    16│
+│        Column %        │100.0%│100.0%│100.0%│100.0%│     .│
+│        Column Valid N %│100.0%│     .│100.0%│100.0%│     .│
+│        Column Total N %│100.0%│100.0%│100.0%│100.0%│     .│
+│        Row %           │     .│     .│     .│     .│     .│
+│        Row Valid N %   │     .│     .│     .│     .│     .│
+│        Row Total N %   │     .│     .│     .│     .│     .│
+│        Valid N         │     2│     0│     2│     2│     6│
+│        Total N         │     5│     5│     5│     5│    30│
+╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
 ])
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP
+
+AT_SETUP([CTABLES SMISSING=LISTWISE])
+AT_KEYWORDS([SMISSING LISTWISE])
+AT_DATA([ctables.sps],
+[[DATA LIST LIST NOTABLE/x y z.
+BEGIN DATA.
+1  . 40
+1 10 50
+1 20 60
+1  .  .
+1 30  .
+END DATA.
+VARIABLE LEVEL x (NOMINAL).
+
+CTABLES /TABLE (y + z) > x.
+CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
+
+* The following doesn't come out as listwise because the tables are
+separate, not linked by an > operator.
+CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
+  Custom Tables
+╭────────┬─────╮
+│        │ Mean│
+├────────┼─────┤
+│y x 1.00│20.00│
+├────────┼─────┤
+│z x 1.00│50.00│
+╰────────┴─────╯
+
+  Custom Tables
+╭────────┬─────╮
+│        │ Mean│
+├────────┼─────┤
+│y x 1.00│15.00│
+├────────┼─────┤
+│z x 1.00│55.00│
+╰────────┴─────╯
+
+  Custom Tables
+╭────────┬─────╮
+│        │ Mean│
+├────────┼─────┤
+│y x 1.00│20.00│
+├────────┼─────┤
+│z x 1.00│50.00│
+╰────────┴─────╯
+])
+AT_CLEANUP