3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Testing details of missing value handling in summaries.
6 dnl - test CLABELS ROWLABELS=LAYER.
8 dnl - Test WEIGHT and adjustment weights.
9 dnl - Summary functions:
10 dnl * Separate summary functions for totals and subtotals.
11 dnl * )CILEVEL in summary label specification
15 dnl * ascending/descending
18 dnl * THRU (numeric ranges)
21 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
24 dnl - HIDESMALLCOUNTS.
25 dnl - Date/time variables and values
26 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
27 dnl - TITLES: )DATE, )TIME, )TABLE.
29 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
30 dnl * MISSING, OTHERNM
31 dnl * strings and string ranges
32 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
36 dnl - Summary functions:
37 dnl * U-prefix for unweighted summaries.
38 dnl * areaPCT.SUM and UareaPCT.SUM functions.
39 dnl - SPLIT FILE with SEPARATE splits
40 dnl - Definition of columns/rows when labels are rotated from one axis to another.
43 dnl - Multiple response sets
44 dnl - MRSETS subcommand.
45 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
48 dnl - Summary functions:
49 dnl * .LCL and .UCL suffixes.
52 dnl * Data-dependent sorting.
54 AT_SETUP([CTABLES parsing])
55 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
56 AT_DATA([ctables.sps],
59 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
60 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
61 /FORMAT UNITS=CM EMPTY="(-)"
62 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
63 /VLABELS VARIABLES=qn17 DISPLAY=NAME
64 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
65 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
66 /VLABELS VARIABLES=qn20 DISPLAY=NONE
67 /MRSETS COUNTDUPLICATES=NO
68 /MRSETS COUNTDUPLICATES=YES
71 /WEIGHT VARIABLE=qns3a
73 /HIDESMALLCOUNTS COUNT=10
75 /SLABELS POSITION=COLUMN VISIBLE=YES
76 /SLABELS VISIBLE=NO POSITION=ROW
77 /SLABELS POSITION=LAYER
79 /CLABELS ROWLABELS=OPPOSITE
81 /CATEGORIES VARIABLES=qn1 qn17
82 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
83 POSITION=BEFORE EMPTY=INCLUDE.
84 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
85 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
86 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
88 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
91 ╭───────────────────┬────┬────╮
93 ├───────────────────┼────┼────┤
94 │Sa1. SAMPLE SOURCE:│5392│1607│
95 ╰───────────────────┴────┴────╯
99 ╭───────────────────┬─────╮
101 ├───────────────────┼─────┤
102 │Sa1. SAMPLE SOURCE:│ 5392│
103 ╰───────────────────┴─────╯
106 ╭────────────────────────┬─────╮
108 ├────────────────────────┼─────┤
109 │Sa1. SAMPLE SOURCE: RDD │ 5392│
111 ╰────────────────────────┴─────╯
114 ╭────────────────────────┬─────╮
116 ├────────────────────────┼─────┤
117 │Sa1. SAMPLE SOURCE: RDD │ 5392│
119 ╰────────────────────────┴─────╯
123 AT_SETUP([CTABLES parsing - negative])
124 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
125 AT_DATA([ctables.sps],
128 CTABLES /FORMAT MINCOLWIDTH='foo'.
129 CTABLES /TABLE qn1 [**].
130 CTABLES /TABLE qn1 [NOTAFUNCTION].
133 CTABLES /TABLE NOTAVAR.
135 CTABLES /TABLE string[S].
136 CTABLES /TABLE qn1 [PTILE 101].
137 CTABLES /TABLE qn1 [MEAN F0.1].
138 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
139 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
140 CTABLES /TABLE qn1 [MEAN TOTALS].
141 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
155 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
156 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
157 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
158 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
159 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
160 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
161 CTABLES /PCOMPUTE &k=EXPR([LO **]).
162 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
163 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
164 CTABLES /PCOMPUTE &k=EXPR([1**]).
165 CTABLES /PCOMPUTE &k=EXPR((1x)).
166 CTABLES /PCOMPUTE **k.
167 CTABLES /PCOMPUTE &1.
168 CTABLES /PCOMPUTE &k**.
169 CTABLES /PCOMPUTE &k=**.
170 CTABLES /PCOMPUTE &k=EXPR**.
171 CTABLES /PCOMPUTE &k=EXPR(1x).
172 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
174 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
175 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
176 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
177 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
178 CTABLES /FORMAT EMPTY=**.
179 CTABLES /FORMAT MISSING=**.
181 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
183 CTABLES /VLABELS VARIABLES=NOTAVAR.
184 CTABLES /VLABELS VARIABLES=qn1 **.
185 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
187 CTABLES /MRSETS COUNTDUPLICATES=**.
188 CTABLES /SMISSING **.
190 CTABLES /WEIGHT VARIABLE=NOTAVAR.
191 CTABLES /HIDESMALLCOUNTS COUNT=1.
193 CTABLES /HIDESMALLCOUNTS COUNT=2.
194 CTABLES /TABLE qn1**.
195 CTABLES /TABLE qn1 /SLABELS POSITION=**.
196 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
197 CTABLES /TABLE qn1 /SLABELS **.
198 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
199 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
200 CTABLES /TABLE qn1 /CLABELS **.
201 CTABLES /TABLE qn1 /CRITERIA **.
202 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
203 CTABLES /TABLE qn1 /TITLES **.
204 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
205 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
206 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
207 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
208 CTABLES /TABLE qn1 /SIGTEST **.
209 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
210 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
211 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
212 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
213 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
214 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
215 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
216 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
217 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
218 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
219 CTABLES /TABLE qn1 /COMPARETEST **.
220 CTABLES /TABLE qn1 / **.
221 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
222 CTABLES /TABLE qn20 > qnd1.
223 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
224 NUMERIC datetime (DATETIME17.0).
225 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
227 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
228 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
230 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
231 negative number for MINCOLWIDTH.
233 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
236 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
237 summary function name.
239 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
241 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
244 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
246 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
248 10 | CTABLES /TABLE string[S].
251 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
252 between 0 and 100 for PTILE.
254 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
255 requires a width between 1 and 40.
257 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
258 format NEGPAREN requires width 2 or greater.
260 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
261 format NEGPAREN requires width greater than decimals.
263 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
265 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
268 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
269 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
272 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
274 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
276 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
279 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
280 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
283 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
285 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
287 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
289 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
291 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
293 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
295 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
298 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
299 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
302 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
303 between 0 and 100 for PTILE.
305 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
308 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
311 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
314 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
317 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
319 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
322 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
325 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
326 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
328 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
329 LABEL, POSITION, or EMPTY.
331 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
332 integer for SUBTOTAL.
334 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
336 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
338 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
340 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
342 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
344 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
346 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
348 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
350 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
352 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
354 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
356 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
358 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
359 the previous definition.
360 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
361 | ^~~~~~~~~~~~~~~~~~~
363 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
364 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
365 | ^~~~~~~~~~~~~~~~~~~
367 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
370 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
371 Expecting summary function name.
373 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
374 between 0 and 100 for PTILE.
376 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
378 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
381 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
382 FORMAT, or HIDESOURCECATS.
384 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
386 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
388 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
389 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
391 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
394 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
397 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
399 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
402 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
403 DEFAULT, NAME, LABEL, BOTH, or NONE.
405 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
408 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
411 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
412 VARIABLE or LISTWISE.
414 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
417 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
419 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
420 greater for HIDESMALLCOUNTS COUNT.
422 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
423 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
424 HIDESMALLCOUNTS, or TABLE.
426 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
429 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
431 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
434 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
437 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
440 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
443 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
446 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
447 ROWLABELS, or COLLABELS.
449 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
452 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
453 in @<:@0,100@:}@ for CILEVEL.
455 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
456 CAPTION, CORNER, or TITLE.
458 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
461 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
462 in @<:@0,1@:}@ for ALPHA.
464 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
467 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
468 ALLVISIBLE or SUBTOTALS.
470 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
471 ALPHA, INCLUDEMRSETS, or CATEGORIES.
473 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
476 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
479 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
482 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
483 BONFERRONI, BH, or NONE.
485 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
488 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
491 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
492 ALLVISIBLE or SUBTOTALS.
494 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
497 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
500 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
503 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
504 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
507 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
508 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
510 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
513 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
514 97 | CTABLES /TABLE qn20 > qnd1.
517 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
518 97 | CTABLES /TABLE qn20 > qnd1.
521 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
522 97 | CTABLES /TABLE qn20 > qnd1.
525 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
526 categorical variables at the innermost nesting level.
527 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
528 | ^~~~~~~~~~~~~~~~~~~~
530 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
532 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
535 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
536 specification as format DATETIME: Day (123) must be between 1 and 31..
537 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
540 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
542 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
544 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
547 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
549 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
552 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
554 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
559 AT_SETUP([CTABLES parsing - more negative])
560 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
561 AT_DATA([ctables.sps],
563 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
564 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
565 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
568 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
569 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
571 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
573 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
574 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
575 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
576 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
578 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
579 CTABLES /PCOMPUTE &x=EXPR([**]).
580 CTABLES /PCOMPUTE &x=EXPR(**).
584 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
586 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
587 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
588 category not included in the category list.
589 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
594 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
595 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
599 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
600 list of categories here.
601 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
606 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
607 category not included in the category list.
608 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
613 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
614 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
618 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
619 variable's CATEGORIES specification.
621 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
622 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
623 subtotals by position, e.g. SUBTOTAL[1].
624 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
625 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
627 ^~~~~~~~~~~~~~~~~~~~~~~~
629 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
631 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
632 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
635 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
636 applied only to string variables, but this subcommand tries to apply it to
637 numeric variable QN1.
638 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
641 ctables.sps:8.53: error: CTABLES: This category specification may be applied
642 only to numeric variables, but this subcommand tries to apply it to string
644 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
647 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
648 based on a summary function.
650 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
651 moved to be categorical, but qnd1 is a scale variable.
653 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
654 moved to have the same width, but QN1 has width 0 and string has width 8.
656 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
657 moved to have the same value labels, but QN1 and QNSA1 have different value
660 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
661 moved to have the same category specifications, but QN105BA and QN105BB have
662 different category specifications.
664 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
665 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
666 this warning, insert parentheses.
667 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
670 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
673 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
675 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
677 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
678 variable must be specified.
680 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
682 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
684 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
687 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
689 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
692 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
694 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
699 AT_SETUP([CTABLES one categorical variable])
700 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
701 AT_DATA([ctables.sps],
704 CTABLES /TABLE BY qn1.
705 CTABLES /TABLE BY BY qn1.
707 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
709 ╭────────────────────────────────────────────────────────────────────────┬─────╮
711 ├────────────────────────────────────────────────────────────────────────┼─────┤
712 │ 1. How often do you usually drive a car or other Every day │ 4667│
713 │motor vehicle? Several days a week │ 1274│
714 │ Once a week or less │ 361│
715 │ Only certain times a │ 130│
718 ╰────────────────────────────────────────────────────────────────────────┴─────╯
721 ╭──────────────────────────────────────────────────────────────────────────────╮
722 │ 1. How often do you usually drive a car or other motor vehicle? │
723 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
724 │ │ Several days a │ Once a week or │ Only certain times a │ │
725 │Every day│ week │ less │ year │Never│
726 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
727 │ Count │ Count │ Count │ Count │Count│
728 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
729 │ 4667│ 1274│ 361│ 130│ 540│
730 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
742 AT_SETUP([CTABLES one string variable])
743 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
744 AT_DATA([ctables.sps],
747 MISSING VALUES licensed('DontKnow', 'Refused').
748 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
749 CTABLES /TABLE licensed.
750 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
751 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
752 * Notice that the string matching is case-sensitive.
753 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
754 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
756 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
757 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
759 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
761 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
762 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
764 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
766 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
776 ╭─────────────────┬─────┬───────╮
778 ├─────────────────┼─────┼───────┤
779 │licensed DontKnow│ 4│ │
783 │ Total │ 6999│ 6951│
784 ╰─────────────────┴─────┴───────╯
787 ╭──────────────┬─────╮
789 ├──────────────┼─────┤
790 │licensed Yes │ 6379│
793 ╰──────────────┴─────╯
796 ╭──────────────┬─────╮
798 ├──────────────┼─────┤
799 │licensed Yes │ 6379│
802 ╰──────────────┴─────╯
805 ╭────────────────┬─────╮
807 ├────────────────┼─────┤
812 ╰────────────────┴─────╯
815 ╭────────────────┬─────╮
817 ├────────────────┼─────┤
818 │licensed Yes │ 6379│
820 ╰────────────────┴─────╯
824 AT_SETUP([CTABLES one scale variable])
825 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
826 AT_DATA([ctables.sps],
828 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
829 CTABLES /TABLE BY qnd1.
830 CTABLES /TABLE BY BY qnd1.
832 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
834 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
835 │ │ │ │ │ │ Std │ │ │
836 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
837 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
838 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
839 │age? │ │ │ │ │ │ │ │
840 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
843 ╭──────────────────────────╮
844 │D1. AGE: What is your age?│
845 ├──────────────────────────┤
847 ├──────────────────────────┤
849 ╰──────────────────────────╯
852 D1. AGE: What is your age?
861 AT_SETUP([CTABLES simple stacking])
862 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
863 AT_DATA([ctables.sps],
865 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
867 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
869 ╭───────────────────────────────────────────────────────────────┬──────────────╮
876 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
877 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
878 │too much to drink to drive safely will A. Get certain │ │ │
879 │stopped by the police? Very likely │ 21%│ 22%│
880 │ Somewhat │ 38%│ 42%│
882 │ Somewhat │ 21%│ 18%│
886 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
887 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
888 │too much to drink to drive safely will B. Have an certain │ │ │
889 │accident? Very likely │ 36%│ 45%│
890 │ Somewhat │ 39%│ 32%│
896 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
897 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
898 │too much to drink to drive safely will C. Be certain │ │ │
899 │convicted for drunk driving? Very likely │ 32%│ 28%│
900 │ Somewhat │ 27%│ 32%│
902 │ Somewhat │ 15%│ 15%│
906 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
907 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
908 │too much to drink to drive safely will D. Be certain │ │ │
909 │arrested for drunk driving? Very likely │ 26%│ 27%│
910 │ Somewhat │ 32%│ 35%│
912 │ Somewhat │ 17%│ 15%│
916 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
920 AT_SETUP([CTABLES show or hide empty categories])
921 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
922 AT_DATA([ctables.sps],
924 IF (qn105ba = 2) qn105ba = 1.
925 IF (qns3a = 1) qns3a = 2.
926 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
927 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
928 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
929 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
930 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
931 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
932 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
934 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
936 ╭──────────────────────────────────────────────────────────────┬───────────────╮
943 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
944 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
945 │too much to drink to drive safely will A. Get certain │ │ │
946 │stopped by the police? Very likely│ .│ 0%│
953 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
956 ╭──────────────────────────────────────────────────────────────┬───────────────╮
963 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
964 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
965 │too much to drink to drive safely will A. Get certain │ │ │
966 │stopped by the police? Somewhat │ .│ 40%│
972 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
975 ╭────────────────────────────────────────────────────────────────────┬─────────╮
982 ├────────────────────────────────────────────────────────────────────┼─────────┤
983 │105b. How likely is it that drivers who have had too Almost │ 32%│
984 │much to drink to drive safely will A. Get stopped by certain │ │
985 │the police? Very likely │ 0%│
992 ╰────────────────────────────────────────────────────────────────────┴─────────╯
995 ╭────────────────────────────────────────────────────────────────────┬─────────╮
1002 ├────────────────────────────────────────────────────────────────────┼─────────┤
1003 │105b. How likely is it that drivers who have had too Almost │ 32%│
1004 │much to drink to drive safely will A. Get stopped by certain │ │
1005 │the police? Somewhat │ 40%│
1011 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1015 AT_SETUP([CTABLES simple nesting])
1016 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1017 AT_DATA([ctables.sps],
1019 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1020 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1021 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1022 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1023 /CLABELS ROW=OPPOSITE.
1025 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1027 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1030 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1031 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1032 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1033 │drive safely will A. Get stopped by Total │ 700│ 10%│
1034 │the police? ╶──────────────────────────┼─────┼──────┤
1035 │ Very S3a. Male │ 660│ 10%│
1036 │ likely GENDER: Female│ 842│ 12%│
1037 │ Total │ 1502│ 22%│
1038 │ ╶──────────────────────────┼─────┼──────┤
1039 │ Somewhat S3a. Male │ 1174│ 17%│
1040 │ likely GENDER: Female│ 1589│ 23%│
1041 │ Total │ 2763│ 40%│
1042 │ ╶──────────────────────────┼─────┼──────┤
1043 │ Somewhat S3a. Male │ 640│ 9%│
1044 │ unlikely GENDER: Female│ 667│ 10%│
1045 │ Total │ 1307│ 19%│
1046 │ ╶──────────────────────────┼─────┼──────┤
1047 │ Very S3a. Male │ 311│ 5%│
1048 │ unlikely GENDER: Female│ 298│ 4%│
1050 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1051 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1052 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1053 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1054 │ ╶──────────────────────────┼─────┼──────┤
1055 │ Very S3a. Male │ 1104│ 16%│
1056 │ likely GENDER: Female│ 1715│ 25%│
1057 │ Total │ 2819│ 41%│
1058 │ ╶──────────────────────────┼─────┼──────┤
1059 │ Somewhat S3a. Male │ 1203│ 17%│
1060 │ likely GENDER: Female│ 1214│ 18%│
1061 │ Total │ 2417│ 35%│
1062 │ ╶──────────────────────────┼─────┼──────┤
1063 │ Somewhat S3a. Male │ 262│ 4%│
1064 │ unlikely GENDER: Female│ 168│ 2%│
1066 │ ╶──────────────────────────┼─────┼──────┤
1067 │ Very S3a. Male │ 81│ 1%│
1068 │ unlikely GENDER: Female│ 59│ 1%│
1070 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1071 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1072 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1073 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1074 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1075 │ Very S3a. Male │ 988│ 14%│
1076 │ likely GENDER: Female│ 1049│ 15%│
1077 │ Total │ 2037│ 30%│
1078 │ ╶──────────────────────────┼─────┼──────┤
1079 │ Somewhat S3a. Male │ 822│ 12%│
1080 │ likely GENDER: Female│ 1210│ 18%│
1081 │ Total │ 2032│ 30%│
1082 │ ╶──────────────────────────┼─────┼──────┤
1083 │ Somewhat S3a. Male │ 446│ 7%│
1084 │ unlikely GENDER: Female│ 548│ 8%│
1086 │ ╶──────────────────────────┼─────┼──────┤
1087 │ Very S3a. Male │ 268│ 4%│
1088 │ unlikely GENDER: Female│ 354│ 5%│
1090 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1091 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1092 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1093 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1094 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1095 │ Very S3a. Male │ 805│ 12%│
1096 │ likely GENDER: Female│ 1029│ 15%│
1097 │ Total │ 1834│ 27%│
1098 │ ╶──────────────────────────┼─────┼──────┤
1099 │ Somewhat S3a. Male │ 975│ 14%│
1100 │ likely GENDER: Female│ 1332│ 19%│
1101 │ Total │ 2307│ 34%│
1102 │ ╶──────────────────────────┼─────┼──────┤
1103 │ Somewhat S3a. Male │ 535│ 8%│
1104 │ unlikely GENDER: Female│ 560│ 8%│
1105 │ Total │ 1095│ 16%│
1106 │ ╶──────────────────────────┼─────┼──────┤
1107 │ Very S3a. Male │ 270│ 4%│
1108 │ unlikely GENDER: Female│ 279│ 4%│
1110 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1113 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1114 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1115 │ │ certain│likely│ likely │ unlikely│unlikely│
1116 │ ├────────┼──────┼─────────┼─────────┼────────┤
1118 │ │ Table %│ % │ Table % │ Table % │ Table %│
1119 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1120 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1121 │GENDER: is it that drivers│ │ │ │ │ │
1122 │ who have had too │ │ │ │ │ │
1123 │ much to drink to │ │ │ │ │ │
1124 │ drive safely will │ │ │ │ │ │
1125 │ A. Get stopped by │ │ │ │ │ │
1126 │ the police? │ │ │ │ │ │
1127 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1128 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1129 │ is it that drivers│ │ │ │ │ │
1130 │ who have had too │ │ │ │ │ │
1131 │ much to drink to │ │ │ │ │ │
1132 │ drive safely will │ │ │ │ │ │
1133 │ A. Get stopped by │ │ │ │ │ │
1134 │ the police? │ │ │ │ │ │
1135 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1136 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1137 │ is it that drivers│ │ │ │ │ │
1138 │ who have had too │ │ │ │ │ │
1139 │ much to drink to │ │ │ │ │ │
1140 │ drive safely will │ │ │ │ │ │
1141 │ A. Get stopped by │ │ │ │ │ │
1142 │ the police? │ │ │ │ │ │
1143 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1144 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1145 │GENDER: is it that drivers│ │ │ │ │ │
1146 │ who have had too │ │ │ │ │ │
1147 │ much to drink to │ │ │ │ │ │
1148 │ drive safely will │ │ │ │ │ │
1149 │ B. Have an │ │ │ │ │ │
1150 │ accident? │ │ │ │ │ │
1151 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1152 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1153 │ is it that drivers│ │ │ │ │ │
1154 │ who have had too │ │ │ │ │ │
1155 │ much to drink to │ │ │ │ │ │
1156 │ drive safely will │ │ │ │ │ │
1157 │ B. Have an │ │ │ │ │ │
1158 │ accident? │ │ │ │ │ │
1159 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1160 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1161 │ is it that drivers│ │ │ │ │ │
1162 │ who have had too │ │ │ │ │ │
1163 │ much to drink to │ │ │ │ │ │
1164 │ drive safely will │ │ │ │ │ │
1165 │ B. Have an │ │ │ │ │ │
1166 │ accident? │ │ │ │ │ │
1167 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1168 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1169 │GENDER: is it that drivers│ │ │ │ │ │
1170 │ who have had too │ │ │ │ │ │
1171 │ much to drink to │ │ │ │ │ │
1172 │ drive safely will │ │ │ │ │ │
1173 │ C. Be convicted │ │ │ │ │ │
1174 │ for drunk driving?│ │ │ │ │ │
1175 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1176 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1177 │ is it that drivers│ │ │ │ │ │
1178 │ who have had too │ │ │ │ │ │
1179 │ much to drink to │ │ │ │ │ │
1180 │ drive safely will │ │ │ │ │ │
1181 │ C. Be convicted │ │ │ │ │ │
1182 │ for drunk driving?│ │ │ │ │ │
1183 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1184 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1185 │ is it that drivers│ │ │ │ │ │
1186 │ who have had too │ │ │ │ │ │
1187 │ much to drink to │ │ │ │ │ │
1188 │ drive safely will │ │ │ │ │ │
1189 │ C. Be convicted │ │ │ │ │ │
1190 │ for drunk driving?│ │ │ │ │ │
1191 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1192 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1193 │GENDER: is it that drivers│ │ │ │ │ │
1194 │ who have had too │ │ │ │ │ │
1195 │ much to drink to │ │ │ │ │ │
1196 │ drive safely will │ │ │ │ │ │
1197 │ D. Be arrested for│ │ │ │ │ │
1198 │ drunk driving? │ │ │ │ │ │
1199 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1200 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1201 │ is it that drivers│ │ │ │ │ │
1202 │ who have had too │ │ │ │ │ │
1203 │ much to drink to │ │ │ │ │ │
1204 │ drive safely will │ │ │ │ │ │
1205 │ D. Be arrested for│ │ │ │ │ │
1206 │ drunk driving? │ │ │ │ │ │
1207 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1208 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1209 │ is it that drivers│ │ │ │ │ │
1210 │ who have had too │ │ │ │ │ │
1211 │ much to drink to │ │ │ │ │ │
1212 │ drive safely will │ │ │ │ │ │
1213 │ D. Be arrested for│ │ │ │ │ │
1214 │ drunk driving? │ │ │ │ │ │
1215 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1219 AT_SETUP([CTABLES nesting and scale variables])
1220 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1221 AT_DATA([ctables.sps],
1223 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1224 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1225 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1226 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1227 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1229 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1231 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1237 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1238 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1239 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1241 │ Once a week or │ 44│ 54│
1243 │ Only certain │ 34│ 41│
1244 │ times a year │ │ │
1246 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1249 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1250 │ │Minimum│Maximum│Mean│
1251 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1252 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1253 │What is GENDER: months, has there been a │ │ │ │
1254 │your time when you felt you │ │ │ │
1255 │age? should cut down on your No │ 16│ 86│ 46│
1257 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1258 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1259 │ months, has there been a │ │ │ │
1260 │ time when you felt you │ │ │ │
1261 │ should cut down on your No │ 16│ 86│ 48│
1263 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1264 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1265 │What is GENDER: months, has there been a │ │ │ │
1266 │your time when people criticized No │ 16│ 86│ 46│
1267 │age? your drinking? │ │ │ │
1268 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1269 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1270 │ months, has there been a │ │ │ │
1271 │ time when people criticized No │ 16│ 86│ 48│
1272 │ your drinking? │ │ │ │
1273 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1276 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1277 │ │S1. Including yourself, how many members of this│
1278 │ │ household are age 16 or older? │
1279 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1280 │ │ │ │ │ │ │ │ 6 or │
1281 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1282 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1283 │ │Column│Column│Column│Column│Column│Column│Column│
1284 │ │ % │ % │ % │ % │ % │ % │ % │
1285 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1286 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1287 │SAMPLE How certain │ │ │ │ │ │ │ │
1288 │SOURCE: likely │ │ │ │ │ │ │ │
1289 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1290 │ that likely │ │ │ │ │ │ │ │
1291 │ drivers │ │ │ │ │ │ │ │
1292 │ who have │ │ │ │ │ │ │ │
1293 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1294 │ much to likely │ │ │ │ │ │ │ │
1295 │ drink to │ │ │ │ │ │ │ │
1296 │ drive │ │ │ │ │ │ │ │
1297 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1298 │ will A. unlikely│ │ │ │ │ │ │ │
1299 │ Get │ │ │ │ │ │ │ │
1300 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1301 │ by the unlikely│ │ │ │ │ │ │ │
1302 │ police? │ │ │ │ │ │ │ │
1303 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1306 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1309 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1310 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1311 │group typical month did you have one or more │ │ │
1312 │ alcoholic beverages to drink? │ │ │
1313 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1314 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1315 │ typical month did you have one or more │ │ │
1316 │ alcoholic beverages to drink? │ │ │
1317 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1318 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1319 │ typical month did you have one or more │ │ │
1320 │ alcoholic beverages to drink? │ │ │
1321 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1322 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1323 │ typical month did you have one or more │ │ │
1324 │ alcoholic beverages to drink? │ │ │
1325 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1326 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1327 │ typical month did you have one or more │ │ │
1328 │ alcoholic beverages to drink? │ │ │
1329 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1330 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1331 │ older typical month did you have one or more │ │ │
1332 │ alcoholic beverages to drink? │ │ │
1333 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1338 AT_SETUP([CTABLES SLABELS])
1339 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1340 AT_DATA([ctables.sps],
1342 CTABLES /TABLE qn1 [COUNT COLPCT].
1343 CTABLES /TABLE qn1 [COUNT COLPCT]
1344 /SLABELS POSITION=ROW.
1345 CTABLES /TABLE qn1 [COUNT COLPCT]
1346 /SLABELS POSITION=ROW VISIBLE=NO.
1348 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1350 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1353 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1354 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1355 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1356 │ Once a week or less│ 361│ 5.2%│
1357 │ Only certain times │ 130│ 1.9%│
1359 │ Never │ 540│ 7.7%│
1360 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1363 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1364 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1365 │other motor vehicle? Column │66.9%│
1367 │ ╶───────────────────────────┼─────┤
1368 │ Several days a week Count │ 1274│
1371 │ ╶───────────────────────────┼─────┤
1372 │ Once a week or less Count │ 361│
1375 │ ╶───────────────────────────┼─────┤
1376 │ Only certain times Count │ 130│
1377 │ a year Column │ 1.9%│
1379 │ ╶───────────────────────────┼─────┤
1380 │ Never Count │ 540│
1383 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1386 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1387 │ 1. How often do you usually drive a car or other Every day │ 4667│
1388 │motor vehicle? │66.9%│
1389 │ Several days a week │ 1274│
1391 │ Once a week or less │ 361│
1393 │ Only certain times a │ 130│
1397 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1401 AT_SETUP([CTABLES simple totals])
1402 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1403 AT_DATA([ctables.sps],
1406 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1407 DESCRIPTIVES qn18/STATISTICS=MEAN.
1408 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1409 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1411 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1413 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1415 ├────────────────────────────────────────────────────────────────────────┼─────┤
1416 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1417 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1420 │ Wine coolers │ 137│
1421 │ Hard liquor or │ 888│
1423 │ Flavored malt │ 83│
1425 │ Number responding │ 4221│
1426 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1428 Descriptive Statistics
1429 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1431 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1432 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1433 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1434 │Valid N (listwise) │6999│ │
1435 │Missing N (listwise) │2781│ │
1436 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1439 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1440 │ │ │ │ Valid│Total│
1441 │ │Mean│Count│ N │ N │
1442 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1443 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1444 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1445 │ you usually drink per sitting? │ │ │ │ │
1446 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1447 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1448 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1449 │ you usually drink per sitting? │ │ │ │ │
1450 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1451 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1452 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1453 │ you usually drink per sitting? │ │ │ │ │
1454 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1455 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1456 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1457 │ you usually drink per sitting? │ │ │ │ │
1458 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1459 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1460 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1461 │ you usually drink per sitting? │ │ │ │ │
1462 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1466 AT_SETUP([CTABLES subtotals])
1467 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1468 AT_DATA([ctables.sps],
1470 CTABLES /TABLE=qn105ba BY qns1
1471 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1472 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1473 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1474 CTABLES /TABLE=qn105ba BY qns1
1475 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1476 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1478 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1480 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1481 │ │ S1. Including yourself, how many members of this household │
1482 │ │ are age 16 or older? │
1483 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1484 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1485 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1486 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1487 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1488 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1489 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1490 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1491 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1492 │ likely │ │ │ │ │ │ │ │
1493 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1494 │ unlikely │ │ │ │ │ │ │ │
1495 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1496 │ unlikely │ │ │ │ │ │ │ │
1497 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1500 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1501 │ │ S1. Including yourself, how many members of this household │
1502 │ │ are age 16 or older? │
1503 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1504 │ │ │ │ │ │ │ │ 6 or │
1505 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1506 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1507 │ │ │ │ │ │ Column│ │ │
1508 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1509 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1510 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1511 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1512 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1513 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1514 │ likely │ │ │ │ │ │ │ │
1515 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1516 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1517 │ unlikely │ │ │ │ │ │ │ │
1518 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1519 │ unlikely │ │ │ │ │ │ │ │
1520 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1521 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1524 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1525 │ │ S1. Including yourself, how many members of this household │
1526 │ │ are age 16 or older? │
1527 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1528 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1529 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1530 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1531 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1532 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1533 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1534 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1535 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1536 │ likely │ │ │ │ │ │ │ │
1537 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1538 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1539 │ unlikely │ │ │ │ │ │ │ │
1540 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1541 │ unlikely │ │ │ │ │ │ │ │
1542 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1543 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1547 AT_SETUP([CTABLES PCOMPUTE])
1548 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1549 AT_DATA([ctables.sps],
1552 /PCOMPUTE &x=EXPR([3] + [4])
1553 /PCOMPUTE &y=EXPR([4] + [5])
1554 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1555 /PPROPERTIES &y LABEL='4+5'
1556 /TABLE=qn105ba BY qns1
1557 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1559 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1561 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1562 │ │ S1. Including yourself, how many members of this household │
1563 │ │ are age 16 or older? │
1564 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1565 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1566 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1567 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1568 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1569 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1570 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1571 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1572 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1573 │ likely │ │ │ │ │ │ │ │
1574 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1575 │ unlikely │ │ │ │ │ │ │ │
1576 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1577 │ unlikely │ │ │ │ │ │ │ │
1578 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1582 AT_SETUP([CTABLES CLABELS])
1583 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1584 AT_DATA([ctables.sps],
1586 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1587 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1589 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1591 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1593 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1595 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1596 │ │ 15 or │ 16 to │ 26 to│ 36 to│ 46 to│ 56 to │ 66 or │ 15 or │ 16 to│ 26 to │ 36 to│ 46 to│ 56 to│ 66 or │
1597 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1598 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1599 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1600 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1601 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1602 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1603 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1606 ╭──────────────────────────────┬────────────╮
1610 ├──────────────────────────────┼────────────┤
1611 │Age group 15 or younger Male │ 0│
1613 │ ╶────────────────────┼────────────┤
1614 │ 16 to 25 Male │ 594│
1616 │ ╶────────────────────┼────────────┤
1617 │ 26 to 35 Male │ 476│
1619 │ ╶────────────────────┼────────────┤
1620 │ 36 to 45 Male │ 489│
1622 │ ╶────────────────────┼────────────┤
1623 │ 46 to 55 Male │ 526│
1625 │ ╶────────────────────┼────────────┤
1626 │ 56 to 65 Male │ 516│
1628 │ ╶────────────────────┼────────────┤
1629 │ 66 or older Male │ 531│
1631 ╰──────────────────────────────┴────────────╯
1635 AT_SETUP([CTABLES missing values])
1636 AT_DATA([ctables.sps],
1637 [[DATA LIST LIST NOTABLE/x y.
1676 MISSING VALUES x (1, 2) y (2, 3).
1677 VARIABLE LEVEL ALL (NOMINAL).
1679 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1680 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1681 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1682 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1683 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1684 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1685 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1686 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1687 /CATEGORIES VARIABLES=ALL TOTAL=YES
1688 /SLABELS POSITION=ROW.
1689 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1690 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1691 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1692 /SLABELS POSITION=ROW.
1693 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1694 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1695 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1696 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1697 /SLABELS POSITION=ROW.
1699 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1701 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1702 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1703 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1704 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1705 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1706 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1707 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1708 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1709 dnl Note that Column Total N % doesn't add up to 100 because missing
1710 dnl values are included in the total but not shown as a category and this
1711 dnl is expected behavior.
1714 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1715 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1716 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1717 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1718 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1719 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1720 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1721 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1722 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1723 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1724 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1725 dnl values are included in the total but not shown as a category and this
1726 dnl is expected behavior.
1729 ╭────────────────────────┬───────────────────────────╮
1731 │ ├──────┬──────┬──────┬──────┤
1732 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1733 ├────────────────────────┼──────┼──────┼──────┼──────┤
1734 │x 3.00 Count │ 1│ 1│ 1│ 3│
1735 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1736 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1737 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1738 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1739 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1740 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1741 │ Valid N │ │ │ │ 3│
1742 │ Total N │ │ │ │ 6│
1743 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1744 │ 4.00 Count │ 1│ 1│ 1│ 3│
1745 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1746 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1747 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1748 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1749 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1750 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1751 │ Valid N │ │ │ │ 3│
1752 │ Total N │ │ │ │ 6│
1753 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1754 │ 5.00 Count │ 1│ 1│ 1│ 3│
1755 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1756 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1757 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1758 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1759 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1760 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1761 │ Valid N │ │ │ │ 3│
1762 │ Total N │ │ │ │ 6│
1763 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1764 │ Total Count │ 3│ 3│ 3│ 9│
1765 │ Column % │100.0%│100.0%│100.0%│ .│
1766 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1767 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1768 │ Row % │ .│ .│ .│ .│
1769 │ Row Valid N % │ .│ .│ .│ .│
1770 │ Row Total N % │ .│ .│ .│ .│
1771 │ Valid N │ 3│ 3│ 3│ 9│
1772 │ Total N │ 6│ 6│ 6│ 36│
1773 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1776 ╭────────────────────────┬─────────────────────────────────────────╮
1778 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1779 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1780 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1781 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1782 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1783 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1784 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1785 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1786 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1787 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1788 │ Valid N │ │ │ │ │ │ 0│
1789 │ Total N │ │ │ │ │ │ 6│
1790 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1791 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1792 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1793 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1794 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1795 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1796 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1797 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1798 │ Valid N │ │ │ │ │ │ 0│
1799 │ Total N │ │ │ │ │ │ 6│
1800 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1801 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1802 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1803 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1804 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1805 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1806 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1807 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1808 │ Valid N │ │ │ │ │ │ 3│
1809 │ Total N │ │ │ │ │ │ 6│
1810 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1811 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1812 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1813 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1814 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1815 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1816 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1817 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1818 │ Valid N │ │ │ │ │ │ 3│
1819 │ Total N │ │ │ │ │ │ 6│
1820 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1821 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1822 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1823 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1824 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1825 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1826 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1827 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1828 │ Valid N │ │ │ │ │ │ 3│
1829 │ Total N │ │ │ │ │ │ 6│
1830 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1831 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1832 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1833 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1834 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1835 │ Row % │ .│ .│ .│ .│ .│ .│
1836 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1837 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1838 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1839 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1840 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1843 ╭────────────────────────┬──────────────────────────────────╮
1845 │ ├──────┬──────┬──────┬──────┬──────┤
1846 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1847 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1848 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1849 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1850 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1851 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1852 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1853 │ Row Valid N % │ .│ .│ .│ .│ .│
1854 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1855 │ Valid N │ │ │ │ │ 0│
1856 │ Total N │ │ │ │ │ 6│
1857 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1858 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1859 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1860 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1861 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1862 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1863 │ Row Valid N % │ .│ .│ .│ .│ .│
1864 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1865 │ Valid N │ │ │ │ │ 0│
1866 │ Total N │ │ │ │ │ 6│
1867 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1868 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1869 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1870 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1871 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1872 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1873 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1874 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1875 │ Valid N │ │ │ │ │ 3│
1876 │ Total N │ │ │ │ │ 6│
1877 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1878 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1879 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1880 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1881 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1882 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1883 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1884 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1885 │ Valid N │ │ │ │ │ 3│
1886 │ Total N │ │ │ │ │ 6│
1887 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1888 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1889 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1890 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1891 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1892 │ Row % │ .│ .│ .│ .│ .│
1893 │ Row Valid N % │ .│ .│ .│ .│ .│
1894 │ Row Total N % │ .│ .│ .│ .│ .│
1895 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1896 │ Total N │ 5│ 5│ 5│ 5│ 30│
1897 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1901 AT_SETUP([CTABLES SMISSING=LISTWISE])
1902 AT_KEYWORDS([SMISSING LISTWISE])
1903 AT_DATA([ctables.sps],
1904 [[DATA LIST LIST NOTABLE/x y z.
1912 VARIABLE LEVEL x (NOMINAL).
1914 CTABLES /TABLE (y + z) > x.
1915 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1917 * The following doesn't come out as listwise because the tables are
1918 separate, not linked by an > operator.
1919 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1921 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl