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 * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
35 dnl - Summary functions:
36 dnl * U-prefix for unweighted summaries.
37 dnl * areaPCT.SUM and UareaPCT.SUM functions.
38 dnl - SPLIT FILE with SEPARATE splits
39 dnl - Definition of columns/rows when labels are rotated from one axis to another.
42 dnl - Multiple response sets
43 dnl - MRSETS subcommand.
44 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
47 dnl - Summary functions:
48 dnl * .LCL and .UCL suffixes.
51 dnl * Data-dependent sorting.
53 AT_SETUP([CTABLES parsing])
54 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
55 AT_DATA([ctables.sps],
58 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
59 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
60 /FORMAT UNITS=CM EMPTY="(-)"
61 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
62 /VLABELS VARIABLES=qn17 DISPLAY=NAME
63 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
64 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
65 /VLABELS VARIABLES=qn20 DISPLAY=NONE
66 /MRSETS COUNTDUPLICATES=NO
67 /MRSETS COUNTDUPLICATES=YES
70 /WEIGHT VARIABLE=qns3a
72 /HIDESMALLCOUNTS COUNT=10
74 /SLABELS POSITION=COLUMN VISIBLE=YES
75 /SLABELS VISIBLE=NO POSITION=ROW
76 /SLABELS POSITION=LAYER
78 /CLABELS ROWLABELS=OPPOSITE
80 /CATEGORIES VARIABLES=qn1 qn17
81 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
82 POSITION=BEFORE EMPTY=INCLUDE.
83 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
84 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
85 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
87 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
90 ╭───────────────────┬────┬────╮
92 ├───────────────────┼────┼────┤
93 │Sa1. SAMPLE SOURCE:│5392│1607│
94 ╰───────────────────┴────┴────╯
98 ╭───────────────────┬─────╮
100 ├───────────────────┼─────┤
101 │Sa1. SAMPLE SOURCE:│ 5392│
102 ╰───────────────────┴─────╯
105 ╭────────────────────────┬─────╮
107 ├────────────────────────┼─────┤
108 │Sa1. SAMPLE SOURCE: RDD │ 5392│
110 ╰────────────────────────┴─────╯
113 ╭────────────────────────┬─────╮
115 ├────────────────────────┼─────┤
116 │Sa1. SAMPLE SOURCE: RDD │ 5392│
118 ╰────────────────────────┴─────╯
122 AT_SETUP([CTABLES parsing - negative])
123 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
124 AT_DATA([ctables.sps],
127 CTABLES /FORMAT MINCOLWIDTH='foo'.
128 CTABLES /TABLE qn1 [**].
129 CTABLES /TABLE qn1 [NOTAFUNCTION].
132 CTABLES /TABLE NOTAVAR.
134 CTABLES /TABLE string[S].
135 CTABLES /TABLE qn1 [PTILE 101].
136 CTABLES /TABLE qn1 [MEAN F0.1].
137 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
138 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
139 CTABLES /TABLE qn1 [MEAN TOTALS].
140 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
155 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
156 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
157 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
158 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
159 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
160 CTABLES /PCOMPUTE &k=EXPR([LO **]).
161 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
162 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
163 CTABLES /PCOMPUTE &k=EXPR([1**]).
164 CTABLES /PCOMPUTE &k=EXPR((1x)).
165 CTABLES /PCOMPUTE **k.
166 CTABLES /PCOMPUTE &1.
167 CTABLES /PCOMPUTE &k**.
168 CTABLES /PCOMPUTE &k=**.
169 CTABLES /PCOMPUTE &k=EXPR**.
170 CTABLES /PCOMPUTE &k=EXPR(1x).
171 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
174 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
175 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
176 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
177 CTABLES /FORMAT EMPTY=**.
178 CTABLES /FORMAT MISSING=**.
180 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
182 CTABLES /VLABELS VARIABLES=NOTAVAR.
183 CTABLES /VLABELS VARIABLES=qn1 **.
184 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
186 CTABLES /MRSETS COUNTDUPLICATES=**.
187 CTABLES /SMISSING **.
189 CTABLES /WEIGHT VARIABLE=NOTAVAR.
190 CTABLES /HIDESMALLCOUNTS COUNT=1.
192 CTABLES /HIDESMALLCOUNTS COUNT=2.
193 CTABLES /TABLE qn1**.
194 CTABLES /TABLE qn1 /SLABELS POSITION=**.
195 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
196 CTABLES /TABLE qn1 /SLABELS **.
197 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
198 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
199 CTABLES /TABLE qn1 /CLABELS **.
200 CTABLES /TABLE qn1 /CRITERIA **.
201 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
202 CTABLES /TABLE qn1 /TITLES **.
203 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
204 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
205 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
206 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
207 CTABLES /TABLE qn1 /SIGTEST **.
208 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
209 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
210 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
211 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
212 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
213 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
214 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
215 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
216 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
217 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
218 CTABLES /TABLE qn1 /COMPARETEST **.
219 CTABLES /TABLE qn1 / **.
220 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
221 CTABLES /TABLE qn20 > qnd1.
222 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
223 NUMERIC datetime (DATETIME17.0).
224 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
226 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
227 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
229 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
230 negative number for MINCOLWIDTH.
232 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
235 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
236 summary function name.
238 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
240 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
243 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
245 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
247 10 | CTABLES /TABLE string[S].
250 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
251 between 0 and 100 for PTILE.
253 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
254 requires a width between 1 and 40.
256 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
257 format NEGPAREN requires width 2 or greater.
259 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
260 format NEGPAREN requires width greater than decimals.
262 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
264 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
267 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
268 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
271 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
273 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
275 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
278 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
279 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
282 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
284 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
286 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
288 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
290 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
292 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
294 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
297 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
298 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
301 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
302 between 0 and 100 for PTILE.
304 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
307 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
310 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
313 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
316 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
318 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
321 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
324 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
325 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
327 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
328 LABEL, POSITION, or EMPTY.
330 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
331 integer for SUBTOTAL.
333 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
335 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
337 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
339 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
341 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
343 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
345 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
347 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
349 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
351 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
353 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
355 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
357 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
358 the previous definition.
359 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
360 | ^~~~~~~~~~~~~~~~~~~
362 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
363 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
364 | ^~~~~~~~~~~~~~~~~~~
366 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
369 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
370 Expecting summary function name.
372 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
373 between 0 and 100 for PTILE.
375 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
377 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
380 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
381 FORMAT, or HIDESOURCECATS.
383 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
385 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
387 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
388 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
390 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
393 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
396 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
398 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
401 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
402 DEFAULT, NAME, LABEL, BOTH, or NONE.
404 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
407 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
410 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
411 VARIABLE or LISTWISE.
413 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
416 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
418 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
419 greater for HIDESMALLCOUNTS COUNT.
421 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
422 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
423 HIDESMALLCOUNTS, or TABLE.
425 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
428 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
430 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
433 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
436 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
439 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
442 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
445 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
446 ROWLABELS, or COLLABELS.
448 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
451 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
452 in @<:@0,100@:}@ for CILEVEL.
454 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
455 CAPTION, CORNER, or TITLE.
457 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
460 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
461 in @<:@0,1@:}@ for ALPHA.
463 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
466 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
467 ALLVISIBLE or SUBTOTALS.
469 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
470 ALPHA, INCLUDEMRSETS, or CATEGORIES.
472 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
475 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
478 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
481 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
482 BONFERRONI, BH, or NONE.
484 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
487 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
490 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
491 ALLVISIBLE or SUBTOTALS.
493 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
496 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
499 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
502 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
503 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
506 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
507 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
509 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
512 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
513 97 | CTABLES /TABLE qn20 > qnd1.
516 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
517 97 | CTABLES /TABLE qn20 > qnd1.
520 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
521 97 | CTABLES /TABLE qn20 > qnd1.
524 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
525 categorical variables at the innermost nesting level.
526 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
527 | ^~~~~~~~~~~~~~~~~~~~
529 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
531 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
534 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
535 specification as format DATETIME: Day (123) must be between 1 and 31..
536 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
541 AT_SETUP([CTABLES parsing - more negative])
542 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
543 AT_DATA([ctables.sps],
545 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
546 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
547 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
550 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
551 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
553 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
555 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
556 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
557 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
558 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
560 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
561 CTABLES /PCOMPUTE &x=EXPR([**]).
562 CTABLES /PCOMPUTE &x=EXPR(**).
566 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
568 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
569 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
570 category not included in the category list.
571 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
576 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
577 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
581 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
582 list of categories here.
583 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
588 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
589 category not included in the category list.
590 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
595 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
596 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
600 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
601 variable's CATEGORIES specification.
603 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
604 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
605 subtotals by position, e.g. SUBTOTAL[1].
606 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
607 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
609 ^~~~~~~~~~~~~~~~~~~~~~~~
611 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
613 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
614 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
617 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
618 applied only to string variables, but this subcommand tries to apply it to
619 numeric variable QN1.
620 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
623 ctables.sps:8.53: error: CTABLES: This category specification may be applied
624 only to numeric variables, but this subcommand tries to apply it to string
626 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
629 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
630 based on a summary function.
632 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
633 moved to be categorical, but qnd1 is a scale variable.
635 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
636 moved to have the same width, but QN1 has width 0 and string has width 8.
638 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
639 moved to have the same value labels, but QN1 and QNSA1 have different value
642 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
643 moved to have the same category specifications, but QN105BA and QN105BB have
644 different category specifications.
646 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
647 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
648 this warning, insert parentheses.
649 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
652 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
655 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
657 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
659 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
660 variable must be specified.
662 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
664 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
666 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
669 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
671 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
674 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
676 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
681 AT_SETUP([CTABLES one categorical variable])
682 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
683 AT_DATA([ctables.sps],
686 CTABLES /TABLE BY qn1.
687 CTABLES /TABLE BY BY qn1.
689 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
691 ╭────────────────────────────────────────────────────────────────────────┬─────╮
693 ├────────────────────────────────────────────────────────────────────────┼─────┤
694 │ 1. How often do you usually drive a car or other Every day │ 4667│
695 │motor vehicle? Several days a week │ 1274│
696 │ Once a week or less │ 361│
697 │ Only certain times a │ 130│
700 ╰────────────────────────────────────────────────────────────────────────┴─────╯
703 ╭──────────────────────────────────────────────────────────────────────────────╮
704 │ 1. How often do you usually drive a car or other motor vehicle? │
705 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
706 │ │ Several days a │ Once a week or │ Only certain times a │ │
707 │Every day│ week │ less │ year │Never│
708 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
709 │ Count │ Count │ Count │ Count │Count│
710 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
711 │ 4667│ 1274│ 361│ 130│ 540│
712 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
724 AT_SETUP([CTABLES one string variable])
725 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
726 AT_DATA([ctables.sps],
729 MISSING VALUES licensed('DontKnow', 'Refused').
730 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
731 CTABLES /TABLE licensed.
732 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
733 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
734 * Notice that the string matching is case-sensitive.
735 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
736 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
738 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
739 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
741 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
743 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
744 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
746 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
748 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
758 ╭─────────────────┬─────┬───────╮
760 ├─────────────────┼─────┼───────┤
761 │licensed DontKnow│ 4│ │
765 │ Total │ 6999│ 6951│
766 ╰─────────────────┴─────┴───────╯
769 ╭──────────────┬─────╮
771 ├──────────────┼─────┤
772 │licensed Yes │ 6379│
775 ╰──────────────┴─────╯
778 ╭──────────────┬─────╮
780 ├──────────────┼─────┤
781 │licensed Yes │ 6379│
784 ╰──────────────┴─────╯
787 ╭────────────────┬─────╮
789 ├────────────────┼─────┤
794 ╰────────────────┴─────╯
797 ╭────────────────┬─────╮
799 ├────────────────┼─────┤
800 │licensed Yes │ 6379│
802 ╰────────────────┴─────╯
805 ╭────────────────┬─────╮
807 ├────────────────┼─────┤
808 │licensed Yes │ 6379│
810 ╰────────────────┴─────╯
814 AT_SETUP([CTABLES one scale variable])
815 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
816 AT_DATA([ctables.sps],
818 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
819 CTABLES /TABLE BY qnd1.
820 CTABLES /TABLE BY BY qnd1.
822 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
824 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
825 │ │ │ │ │ │ Std │ │ │
826 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
827 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
828 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
829 │age? │ │ │ │ │ │ │ │
830 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
833 ╭──────────────────────────╮
834 │D1. AGE: What is your age?│
835 ├──────────────────────────┤
837 ├──────────────────────────┤
839 ╰──────────────────────────╯
842 D1. AGE: What is your age?
851 AT_SETUP([CTABLES simple stacking])
852 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
853 AT_DATA([ctables.sps],
855 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
857 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
859 ╭───────────────────────────────────────────────────────────────┬──────────────╮
866 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
867 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
868 │too much to drink to drive safely will A. Get certain │ │ │
869 │stopped by the police? Very likely │ 21%│ 22%│
870 │ Somewhat │ 38%│ 42%│
872 │ Somewhat │ 21%│ 18%│
876 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
877 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
878 │too much to drink to drive safely will B. Have an certain │ │ │
879 │accident? Very likely │ 36%│ 45%│
880 │ Somewhat │ 39%│ 32%│
886 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
887 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
888 │too much to drink to drive safely will C. Be certain │ │ │
889 │convicted for drunk driving? Very likely │ 32%│ 28%│
890 │ Somewhat │ 27%│ 32%│
892 │ Somewhat │ 15%│ 15%│
896 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
897 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
898 │too much to drink to drive safely will D. Be certain │ │ │
899 │arrested for drunk driving? Very likely │ 26%│ 27%│
900 │ Somewhat │ 32%│ 35%│
902 │ Somewhat │ 17%│ 15%│
906 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
910 AT_SETUP([CTABLES show or hide empty categories])
911 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
912 AT_DATA([ctables.sps],
914 IF (qn105ba = 2) qn105ba = 1.
915 IF (qns3a = 1) qns3a = 2.
916 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
917 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
918 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
919 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
920 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
921 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
922 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
924 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
926 ╭──────────────────────────────────────────────────────────────┬───────────────╮
933 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
934 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
935 │too much to drink to drive safely will A. Get certain │ │ │
936 │stopped by the police? Very likely│ .│ 0%│
943 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
946 ╭──────────────────────────────────────────────────────────────┬───────────────╮
953 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
954 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
955 │too much to drink to drive safely will A. Get certain │ │ │
956 │stopped by the police? Somewhat │ .│ 40%│
962 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
965 ╭────────────────────────────────────────────────────────────────────┬─────────╮
972 ├────────────────────────────────────────────────────────────────────┼─────────┤
973 │105b. How likely is it that drivers who have had too Almost │ 32%│
974 │much to drink to drive safely will A. Get stopped by certain │ │
975 │the police? Very likely │ 0%│
982 ╰────────────────────────────────────────────────────────────────────┴─────────╯
985 ╭────────────────────────────────────────────────────────────────────┬─────────╮
992 ├────────────────────────────────────────────────────────────────────┼─────────┤
993 │105b. How likely is it that drivers who have had too Almost │ 32%│
994 │much to drink to drive safely will A. Get stopped by certain │ │
995 │the police? Somewhat │ 40%│
1001 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1005 AT_SETUP([CTABLES simple nesting])
1006 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1007 AT_DATA([ctables.sps],
1009 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1010 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1011 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1012 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1013 /CLABELS ROW=OPPOSITE.
1015 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1017 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1020 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1021 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1022 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1023 │drive safely will A. Get stopped by Total │ 700│ 10%│
1024 │the police? ╶──────────────────────────┼─────┼──────┤
1025 │ Very S3a. Male │ 660│ 10%│
1026 │ likely GENDER: Female│ 842│ 12%│
1027 │ Total │ 1502│ 22%│
1028 │ ╶──────────────────────────┼─────┼──────┤
1029 │ Somewhat S3a. Male │ 1174│ 17%│
1030 │ likely GENDER: Female│ 1589│ 23%│
1031 │ Total │ 2763│ 40%│
1032 │ ╶──────────────────────────┼─────┼──────┤
1033 │ Somewhat S3a. Male │ 640│ 9%│
1034 │ unlikely GENDER: Female│ 667│ 10%│
1035 │ Total │ 1307│ 19%│
1036 │ ╶──────────────────────────┼─────┼──────┤
1037 │ Very S3a. Male │ 311│ 5%│
1038 │ unlikely GENDER: Female│ 298│ 4%│
1040 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1041 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1042 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1043 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1044 │ ╶──────────────────────────┼─────┼──────┤
1045 │ Very S3a. Male │ 1104│ 16%│
1046 │ likely GENDER: Female│ 1715│ 25%│
1047 │ Total │ 2819│ 41%│
1048 │ ╶──────────────────────────┼─────┼──────┤
1049 │ Somewhat S3a. Male │ 1203│ 17%│
1050 │ likely GENDER: Female│ 1214│ 18%│
1051 │ Total │ 2417│ 35%│
1052 │ ╶──────────────────────────┼─────┼──────┤
1053 │ Somewhat S3a. Male │ 262│ 4%│
1054 │ unlikely GENDER: Female│ 168│ 2%│
1056 │ ╶──────────────────────────┼─────┼──────┤
1057 │ Very S3a. Male │ 81│ 1%│
1058 │ unlikely GENDER: Female│ 59│ 1%│
1060 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1061 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1062 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1063 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1064 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1065 │ Very S3a. Male │ 988│ 14%│
1066 │ likely GENDER: Female│ 1049│ 15%│
1067 │ Total │ 2037│ 30%│
1068 │ ╶──────────────────────────┼─────┼──────┤
1069 │ Somewhat S3a. Male │ 822│ 12%│
1070 │ likely GENDER: Female│ 1210│ 18%│
1071 │ Total │ 2032│ 30%│
1072 │ ╶──────────────────────────┼─────┼──────┤
1073 │ Somewhat S3a. Male │ 446│ 7%│
1074 │ unlikely GENDER: Female│ 548│ 8%│
1076 │ ╶──────────────────────────┼─────┼──────┤
1077 │ Very S3a. Male │ 268│ 4%│
1078 │ unlikely GENDER: Female│ 354│ 5%│
1080 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1081 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1082 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1083 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1084 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1085 │ Very S3a. Male │ 805│ 12%│
1086 │ likely GENDER: Female│ 1029│ 15%│
1087 │ Total │ 1834│ 27%│
1088 │ ╶──────────────────────────┼─────┼──────┤
1089 │ Somewhat S3a. Male │ 975│ 14%│
1090 │ likely GENDER: Female│ 1332│ 19%│
1091 │ Total │ 2307│ 34%│
1092 │ ╶──────────────────────────┼─────┼──────┤
1093 │ Somewhat S3a. Male │ 535│ 8%│
1094 │ unlikely GENDER: Female│ 560│ 8%│
1095 │ Total │ 1095│ 16%│
1096 │ ╶──────────────────────────┼─────┼──────┤
1097 │ Very S3a. Male │ 270│ 4%│
1098 │ unlikely GENDER: Female│ 279│ 4%│
1100 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1103 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1104 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1105 │ │ certain│likely│ likely │ unlikely│unlikely│
1106 │ ├────────┼──────┼─────────┼─────────┼────────┤
1108 │ │ Table %│ % │ Table % │ Table % │ Table %│
1109 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1110 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1111 │GENDER: is it that drivers│ │ │ │ │ │
1112 │ who have had too │ │ │ │ │ │
1113 │ much to drink to │ │ │ │ │ │
1114 │ drive safely will │ │ │ │ │ │
1115 │ A. Get stopped by │ │ │ │ │ │
1116 │ the police? │ │ │ │ │ │
1117 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1118 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1119 │ is it that drivers│ │ │ │ │ │
1120 │ who have had too │ │ │ │ │ │
1121 │ much to drink to │ │ │ │ │ │
1122 │ drive safely will │ │ │ │ │ │
1123 │ A. Get stopped by │ │ │ │ │ │
1124 │ the police? │ │ │ │ │ │
1125 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1126 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1127 │ is it that drivers│ │ │ │ │ │
1128 │ who have had too │ │ │ │ │ │
1129 │ much to drink to │ │ │ │ │ │
1130 │ drive safely will │ │ │ │ │ │
1131 │ A. Get stopped by │ │ │ │ │ │
1132 │ the police? │ │ │ │ │ │
1133 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1134 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1135 │GENDER: is it that drivers│ │ │ │ │ │
1136 │ who have had too │ │ │ │ │ │
1137 │ much to drink to │ │ │ │ │ │
1138 │ drive safely will │ │ │ │ │ │
1139 │ B. Have an │ │ │ │ │ │
1140 │ accident? │ │ │ │ │ │
1141 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1142 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1143 │ is it that drivers│ │ │ │ │ │
1144 │ who have had too │ │ │ │ │ │
1145 │ much to drink to │ │ │ │ │ │
1146 │ drive safely will │ │ │ │ │ │
1147 │ B. Have an │ │ │ │ │ │
1148 │ accident? │ │ │ │ │ │
1149 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1150 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1151 │ is it that drivers│ │ │ │ │ │
1152 │ who have had too │ │ │ │ │ │
1153 │ much to drink to │ │ │ │ │ │
1154 │ drive safely will │ │ │ │ │ │
1155 │ B. Have an │ │ │ │ │ │
1156 │ accident? │ │ │ │ │ │
1157 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1158 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1159 │GENDER: is it that drivers│ │ │ │ │ │
1160 │ who have had too │ │ │ │ │ │
1161 │ much to drink to │ │ │ │ │ │
1162 │ drive safely will │ │ │ │ │ │
1163 │ C. Be convicted │ │ │ │ │ │
1164 │ for drunk driving?│ │ │ │ │ │
1165 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1166 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1167 │ is it that drivers│ │ │ │ │ │
1168 │ who have had too │ │ │ │ │ │
1169 │ much to drink to │ │ │ │ │ │
1170 │ drive safely will │ │ │ │ │ │
1171 │ C. Be convicted │ │ │ │ │ │
1172 │ for drunk driving?│ │ │ │ │ │
1173 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1174 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1175 │ is it that drivers│ │ │ │ │ │
1176 │ who have had too │ │ │ │ │ │
1177 │ much to drink to │ │ │ │ │ │
1178 │ drive safely will │ │ │ │ │ │
1179 │ C. Be convicted │ │ │ │ │ │
1180 │ for drunk driving?│ │ │ │ │ │
1181 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1182 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1183 │GENDER: is it that drivers│ │ │ │ │ │
1184 │ who have had too │ │ │ │ │ │
1185 │ much to drink to │ │ │ │ │ │
1186 │ drive safely will │ │ │ │ │ │
1187 │ D. Be arrested for│ │ │ │ │ │
1188 │ drunk driving? │ │ │ │ │ │
1189 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1190 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1191 │ is it that drivers│ │ │ │ │ │
1192 │ who have had too │ │ │ │ │ │
1193 │ much to drink to │ │ │ │ │ │
1194 │ drive safely will │ │ │ │ │ │
1195 │ D. Be arrested for│ │ │ │ │ │
1196 │ drunk driving? │ │ │ │ │ │
1197 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1198 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1199 │ is it that drivers│ │ │ │ │ │
1200 │ who have had too │ │ │ │ │ │
1201 │ much to drink to │ │ │ │ │ │
1202 │ drive safely will │ │ │ │ │ │
1203 │ D. Be arrested for│ │ │ │ │ │
1204 │ drunk driving? │ │ │ │ │ │
1205 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1209 AT_SETUP([CTABLES nesting and scale variables])
1210 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1211 AT_DATA([ctables.sps],
1213 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1214 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1215 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1216 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1217 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1219 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1221 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1227 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1228 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1229 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1231 │ Once a week or │ 44│ 54│
1233 │ Only certain │ 34│ 41│
1234 │ times a year │ │ │
1236 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1239 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1240 │ │Minimum│Maximum│Mean│
1241 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1242 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1243 │What is GENDER: months, has there been a │ │ │ │
1244 │your time when you felt you │ │ │ │
1245 │age? should cut down on your No │ 16│ 86│ 46│
1247 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1248 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1249 │ months, has there been a │ │ │ │
1250 │ time when you felt you │ │ │ │
1251 │ should cut down on your No │ 16│ 86│ 48│
1253 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1254 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1255 │What is GENDER: months, has there been a │ │ │ │
1256 │your time when people criticized No │ 16│ 86│ 46│
1257 │age? your drinking? │ │ │ │
1258 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1259 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1260 │ months, has there been a │ │ │ │
1261 │ time when people criticized No │ 16│ 86│ 48│
1262 │ your drinking? │ │ │ │
1263 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1266 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1267 │ │S1. Including yourself, how many members of this│
1268 │ │ household are age 16 or older? │
1269 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1270 │ │ │ │ │ │ │ │ 6 or │
1271 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1272 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1273 │ │Column│Column│Column│Column│Column│Column│Column│
1274 │ │ % │ % │ % │ % │ % │ % │ % │
1275 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1276 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1277 │SAMPLE How certain │ │ │ │ │ │ │ │
1278 │SOURCE: likely │ │ │ │ │ │ │ │
1279 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1280 │ that likely │ │ │ │ │ │ │ │
1281 │ drivers │ │ │ │ │ │ │ │
1282 │ who have │ │ │ │ │ │ │ │
1283 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1284 │ much to likely │ │ │ │ │ │ │ │
1285 │ drink to │ │ │ │ │ │ │ │
1286 │ drive │ │ │ │ │ │ │ │
1287 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1288 │ will A. unlikely│ │ │ │ │ │ │ │
1289 │ Get │ │ │ │ │ │ │ │
1290 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1291 │ by the unlikely│ │ │ │ │ │ │ │
1292 │ police? │ │ │ │ │ │ │ │
1293 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1296 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1299 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1300 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1301 │group typical month did you have one or more │ │ │
1302 │ alcoholic beverages to drink? │ │ │
1303 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1304 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1305 │ typical month did you have one or more │ │ │
1306 │ alcoholic beverages to drink? │ │ │
1307 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1308 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1309 │ typical month did you have one or more │ │ │
1310 │ alcoholic beverages to drink? │ │ │
1311 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1312 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1313 │ typical month did you have one or more │ │ │
1314 │ alcoholic beverages to drink? │ │ │
1315 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1316 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1317 │ typical month did you have one or more │ │ │
1318 │ alcoholic beverages to drink? │ │ │
1319 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1320 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1321 │ older typical month did you have one or more │ │ │
1322 │ alcoholic beverages to drink? │ │ │
1323 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1328 AT_SETUP([CTABLES SLABELS])
1329 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1330 AT_DATA([ctables.sps],
1332 CTABLES /TABLE qn1 [COUNT COLPCT].
1333 CTABLES /TABLE qn1 [COUNT COLPCT]
1334 /SLABELS POSITION=ROW.
1335 CTABLES /TABLE qn1 [COUNT COLPCT]
1336 /SLABELS POSITION=ROW VISIBLE=NO.
1338 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1340 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1343 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1344 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1345 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1346 │ Once a week or less│ 361│ 5.2%│
1347 │ Only certain times │ 130│ 1.9%│
1349 │ Never │ 540│ 7.7%│
1350 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1353 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1354 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1355 │other motor vehicle? Column │66.9%│
1357 │ ╶───────────────────────────┼─────┤
1358 │ Several days a week Count │ 1274│
1361 │ ╶───────────────────────────┼─────┤
1362 │ Once a week or less Count │ 361│
1365 │ ╶───────────────────────────┼─────┤
1366 │ Only certain times Count │ 130│
1367 │ a year Column │ 1.9%│
1369 │ ╶───────────────────────────┼─────┤
1370 │ Never Count │ 540│
1373 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1376 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1377 │ 1. How often do you usually drive a car or other Every day │ 4667│
1378 │motor vehicle? │66.9%│
1379 │ Several days a week │ 1274│
1381 │ Once a week or less │ 361│
1383 │ Only certain times a │ 130│
1387 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1391 AT_SETUP([CTABLES simple totals])
1392 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1393 AT_DATA([ctables.sps],
1396 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1397 DESCRIPTIVES qn18/STATISTICS=MEAN.
1398 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1399 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1401 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1403 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1405 ├────────────────────────────────────────────────────────────────────────┼─────┤
1406 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1407 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1410 │ Wine coolers │ 137│
1411 │ Hard liquor or │ 888│
1413 │ Flavored malt │ 83│
1415 │ Number responding │ 4221│
1416 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1418 Descriptive Statistics
1419 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1421 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1422 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1423 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1424 │Valid N (listwise) │6999│ │
1425 │Missing N (listwise) │2781│ │
1426 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1429 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1430 │ │ │ │ Valid│Total│
1431 │ │Mean│Count│ N │ N │
1432 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1433 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1434 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1435 │ you usually drink per sitting? │ │ │ │ │
1436 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1437 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1438 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1439 │ you usually drink per sitting? │ │ │ │ │
1440 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1441 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1442 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1443 │ you usually drink per sitting? │ │ │ │ │
1444 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1445 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1446 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1447 │ you usually drink per sitting? │ │ │ │ │
1448 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1449 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1450 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1451 │ you usually drink per sitting? │ │ │ │ │
1452 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1456 AT_SETUP([CTABLES subtotals])
1457 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1458 AT_DATA([ctables.sps],
1460 CTABLES /TABLE=qn105ba BY qns1
1461 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1462 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1463 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1464 CTABLES /TABLE=qn105ba BY qns1
1465 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1466 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1468 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1470 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1471 │ │ S1. Including yourself, how many members of this household │
1472 │ │ are age 16 or older? │
1473 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1474 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1475 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1476 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1477 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1478 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1479 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1480 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1481 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1482 │ likely │ │ │ │ │ │ │ │
1483 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1484 │ unlikely │ │ │ │ │ │ │ │
1485 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1486 │ unlikely │ │ │ │ │ │ │ │
1487 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1490 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1491 │ │ S1. Including yourself, how many members of this household │
1492 │ │ are age 16 or older? │
1493 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1494 │ │ │ │ │ │ │ │ 6 or │
1495 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1496 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1497 │ │ │ │ │ │ Column│ │ │
1498 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1499 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1500 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1501 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1502 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1503 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1504 │ likely │ │ │ │ │ │ │ │
1505 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1506 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1507 │ unlikely │ │ │ │ │ │ │ │
1508 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1509 │ unlikely │ │ │ │ │ │ │ │
1510 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1511 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1514 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1515 │ │ S1. Including yourself, how many members of this household │
1516 │ │ are age 16 or older? │
1517 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1518 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1519 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1520 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1521 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1522 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1523 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1524 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1525 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1526 │ likely │ │ │ │ │ │ │ │
1527 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1528 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1529 │ unlikely │ │ │ │ │ │ │ │
1530 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1531 │ unlikely │ │ │ │ │ │ │ │
1532 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1533 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1537 AT_SETUP([CTABLES PCOMPUTE])
1538 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1539 AT_DATA([ctables.sps],
1542 /PCOMPUTE &x=EXPR([3] + [4])
1543 /PCOMPUTE &y=EXPR([4] + [5])
1544 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1545 /PPROPERTIES &y LABEL='4+5'
1546 /TABLE=qn105ba BY qns1
1547 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1549 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1551 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1552 │ │ S1. Including yourself, how many members of this household │
1553 │ │ are age 16 or older? │
1554 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1555 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1556 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1557 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1558 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1559 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1560 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1561 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1562 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1563 │ likely │ │ │ │ │ │ │ │
1564 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1565 │ unlikely │ │ │ │ │ │ │ │
1566 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1567 │ unlikely │ │ │ │ │ │ │ │
1568 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1572 AT_SETUP([CTABLES CLABELS])
1573 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1574 AT_DATA([ctables.sps],
1576 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1577 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1579 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1581 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1583 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1585 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1586 │ │ 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 │
1587 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1588 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1589 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1590 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1591 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1592 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1593 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1596 ╭──────────────────────────────┬────────────╮
1600 ├──────────────────────────────┼────────────┤
1601 │Age group 15 or younger Male │ 0│
1603 │ ╶────────────────────┼────────────┤
1604 │ 16 to 25 Male │ 594│
1606 │ ╶────────────────────┼────────────┤
1607 │ 26 to 35 Male │ 476│
1609 │ ╶────────────────────┼────────────┤
1610 │ 36 to 45 Male │ 489│
1612 │ ╶────────────────────┼────────────┤
1613 │ 46 to 55 Male │ 526│
1615 │ ╶────────────────────┼────────────┤
1616 │ 56 to 65 Male │ 516│
1618 │ ╶────────────────────┼────────────┤
1619 │ 66 or older Male │ 531│
1621 ╰──────────────────────────────┴────────────╯
1625 AT_SETUP([CTABLES missing values])
1626 AT_DATA([ctables.sps],
1627 [[DATA LIST LIST NOTABLE/x y.
1666 MISSING VALUES x (1, 2) y (2, 3).
1667 VARIABLE LEVEL ALL (NOMINAL).
1669 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1670 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1671 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1672 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1673 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1674 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1675 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1676 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1677 /CATEGORIES VARIABLES=ALL TOTAL=YES
1678 /SLABELS POSITION=ROW.
1679 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1680 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1681 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1682 /SLABELS POSITION=ROW.
1683 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1684 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1685 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1686 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1687 /SLABELS POSITION=ROW.
1689 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1691 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1692 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1693 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1694 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1695 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1696 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1697 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1698 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1699 dnl Note that Column Total N % doesn't add up to 100 because missing
1700 dnl values are included in the total but not shown as a category and this
1701 dnl is expected behavior.
1704 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1705 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1706 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1707 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1708 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1709 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1710 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1711 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1712 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1713 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1714 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1715 dnl values are included in the total but not shown as a category and this
1716 dnl is expected behavior.
1719 ╭────────────────────────┬───────────────────────────╮
1721 │ ├──────┬──────┬──────┬──────┤
1722 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1723 ├────────────────────────┼──────┼──────┼──────┼──────┤
1724 │x 3.00 Count │ 1│ 1│ 1│ 3│
1725 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1726 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1727 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1728 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1729 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1730 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1731 │ Valid N │ │ │ │ 3│
1732 │ Total N │ │ │ │ 6│
1733 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1734 │ 4.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 │ 5.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 │ Total Count │ 3│ 3│ 3│ 9│
1755 │ Column % │100.0%│100.0%│100.0%│ .│
1756 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1757 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1758 │ Row % │ .│ .│ .│ .│
1759 │ Row Valid N % │ .│ .│ .│ .│
1760 │ Row Total N % │ .│ .│ .│ .│
1761 │ Valid N │ 3│ 3│ 3│ 9│
1762 │ Total N │ 6│ 6│ 6│ 36│
1763 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1766 ╭────────────────────────┬─────────────────────────────────────────╮
1768 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1769 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1770 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1771 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1772 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1773 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1774 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1775 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1776 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1777 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1778 │ Valid N │ │ │ │ │ │ 0│
1779 │ Total N │ │ │ │ │ │ 6│
1780 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1781 │ 2.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 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1792 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1793 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
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 % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1797 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1798 │ Valid N │ │ │ │ │ │ 3│
1799 │ Total N │ │ │ │ │ │ 6│
1800 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1801 │ 4.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 │ 5.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 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1822 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1823 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1824 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1825 │ Row % │ .│ .│ .│ .│ .│ .│
1826 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1827 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1828 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1829 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1830 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1833 ╭────────────────────────┬──────────────────────────────────╮
1835 │ ├──────┬──────┬──────┬──────┬──────┤
1836 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1837 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1838 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1839 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1840 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1841 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1842 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1843 │ Row Valid N % │ .│ .│ .│ .│ .│
1844 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1845 │ Valid N │ │ │ │ │ 0│
1846 │ Total N │ │ │ │ │ 6│
1847 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1848 │ 2.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 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1859 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1860 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.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 % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1864 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1865 │ Valid N │ │ │ │ │ 3│
1866 │ Total N │ │ │ │ │ 6│
1867 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1868 │ 4.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 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1879 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1880 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1881 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1882 │ Row % │ .│ .│ .│ .│ .│
1883 │ Row Valid N % │ .│ .│ .│ .│ .│
1884 │ Row Total N % │ .│ .│ .│ .│ .│
1885 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1886 │ Total N │ 5│ 5│ 5│ 5│ 30│
1887 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1891 AT_SETUP([CTABLES SMISSING=LISTWISE])
1892 AT_KEYWORDS([SMISSING LISTWISE])
1893 AT_DATA([ctables.sps],
1894 [[DATA LIST LIST NOTABLE/x y z.
1902 VARIABLE LEVEL x (NOMINAL).
1904 CTABLES /TABLE (y + z) > x.
1905 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1907 * The following doesn't come out as listwise because the tables are
1908 separate, not linked by an > operator.
1909 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1911 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl