3 dnl Features not yet tested:
4 dnl - Summary functions:
5 dnl * Separate summary functions for totals and subtotals.
6 dnl * U-prefix for unweighted summaries.
7 dnl * areaPCT.SUM and UareaPCT.SUM functions.
8 dnl * WEIGHT and adjustment weights.
9 dnl * details of missing value handling in summaries.
10 dnl - Definition of columns/rows when labels are rotated from one axis to another.
13 dnl - Multiple response sets
14 dnl - MRSETS subcommand.
15 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
18 dnl - Summary functions:
19 dnl * .LCL and .UCL suffixes.
21 dnl - Summary functions:
22 dnl * )CILEVEL in summary label specification
24 dnl * Data-dependent sorting.
26 AT_SETUP([CTABLES parsing])
27 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
28 AT_DATA([ctables.sps],
31 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
32 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
33 /FORMAT UNITS=CM EMPTY="(-)"
34 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
35 /VLABELS VARIABLES=qn17 DISPLAY=NAME
36 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
37 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
38 /VLABELS VARIABLES=qn20 DISPLAY=NONE
39 /MRSETS COUNTDUPLICATES=NO
40 /MRSETS COUNTDUPLICATES=YES
43 /WEIGHT VARIABLE=qns3a
45 /HIDESMALLCOUNTS COUNT=10
47 /SLABELS POSITION=COLUMN VISIBLE=YES
48 /SLABELS VISIBLE=NO POSITION=ROW
49 /SLABELS POSITION=LAYER
51 /CLABELS ROWLABELS=OPPOSITE
53 /CATEGORIES VARIABLES=qn1 qn17
54 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
55 POSITION=BEFORE EMPTY=INCLUDE.
56 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
57 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
58 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
60 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
63 ╭───────────────────┬────┬────╮
65 ├───────────────────┼────┼────┤
66 │Sa1. SAMPLE SOURCE:│5392│1607│
67 ╰───────────────────┴────┴────╯
71 ╭───────────────────┬─────╮
73 ├───────────────────┼─────┤
74 │Sa1. SAMPLE SOURCE:│ 5392│
75 ╰───────────────────┴─────╯
78 ╭────────────────────────┬─────╮
80 ├────────────────────────┼─────┤
81 │Sa1. SAMPLE SOURCE: RDD │ 5392│
83 ╰────────────────────────┴─────╯
86 ╭────────────────────────┬─────╮
88 ├────────────────────────┼─────┤
89 │Sa1. SAMPLE SOURCE: RDD │ 5392│
91 ╰────────────────────────┴─────╯
95 AT_SETUP([CTABLES parsing - negative])
96 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
97 AT_DATA([ctables.sps],
100 CTABLES /FORMAT MINCOLWIDTH='foo'.
101 CTABLES /TABLE qn1 [**].
102 CTABLES /TABLE qn1 [NOTAFUNCTION].
105 CTABLES /TABLE NOTAVAR.
107 CTABLES /TABLE string[S].
108 CTABLES /TABLE qn1 [PTILE 101].
109 CTABLES /TABLE qn1 [MEAN F0.1].
110 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
111 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
112 CTABLES /TABLE qn1 [MEAN TOTALS].
113 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
114 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
115 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
116 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
117 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
118 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
119 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
120 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
121 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
122 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
123 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
124 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
125 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
127 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
128 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
129 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
130 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
131 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
132 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
133 CTABLES /PCOMPUTE &k=EXPR([LO **]).
134 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
135 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
136 CTABLES /PCOMPUTE &k=EXPR([1**]).
137 CTABLES /PCOMPUTE &k=EXPR((1x)).
138 CTABLES /PCOMPUTE **k.
139 CTABLES /PCOMPUTE &1.
140 CTABLES /PCOMPUTE &k**.
141 CTABLES /PCOMPUTE &k=**.
142 CTABLES /PCOMPUTE &k=EXPR**.
143 CTABLES /PCOMPUTE &k=EXPR(1x).
144 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
145 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
146 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
147 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
148 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
149 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
150 CTABLES /FORMAT EMPTY=**.
151 CTABLES /FORMAT MISSING=**.
153 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
155 CTABLES /VLABELS VARIABLES=NOTAVAR.
156 CTABLES /VLABELS VARIABLES=qn1 **.
157 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
159 CTABLES /MRSETS COUNTDUPLICATES=**.
160 CTABLES /SMISSING **.
162 CTABLES /WEIGHT VARIABLE=NOTAVAR.
163 CTABLES /HIDESMALLCOUNTS COUNT=1.
165 CTABLES /HIDESMALLCOUNTS COUNT=2.
166 CTABLES /TABLE qn1**.
167 CTABLES /TABLE qn1 /SLABELS POSITION=**.
168 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
169 CTABLES /TABLE qn1 /SLABELS **.
170 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
171 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
172 CTABLES /TABLE qn1 /CLABELS **.
173 CTABLES /TABLE qn1 /CRITERIA **.
174 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
175 CTABLES /TABLE qn1 /TITLES **.
176 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
177 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
178 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
179 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
180 CTABLES /TABLE qn1 /SIGTEST **.
181 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
182 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
183 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
184 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
185 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
186 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
187 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
188 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
189 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
190 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
191 CTABLES /TABLE qn1 /COMPARETEST **.
192 CTABLES /TABLE qn1 / **.
193 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
194 CTABLES /TABLE qn20 > qnd1.
195 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
196 NUMERIC datetime (DATETIME17.0).
197 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
199 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
200 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
202 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
203 negative number for MINCOLWIDTH.
205 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
208 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
209 summary function name.
211 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
213 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
216 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
218 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
220 10 | CTABLES /TABLE string[S].
223 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
224 between 0 and 100 for PTILE.
226 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
227 requires a width between 1 and 40.
229 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
230 format NEGPAREN requires width 2 or greater.
232 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
233 format NEGPAREN requires width greater than decimals.
235 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
237 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
240 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
241 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
244 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
246 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
248 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
251 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
252 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
255 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
257 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
259 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
261 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
263 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
265 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
267 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
270 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
271 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
274 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
275 between 0 and 100 for PTILE.
277 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
280 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
283 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
286 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
289 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
291 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
294 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
297 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
298 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
300 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
301 LABEL, POSITION, or EMPTY.
303 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
304 integer for SUBTOTAL.
306 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
308 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
310 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
312 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
314 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
316 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
318 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
320 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
322 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
324 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
326 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
328 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
330 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
331 the previous definition.
332 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
333 | ^~~~~~~~~~~~~~~~~~~
335 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
336 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
337 | ^~~~~~~~~~~~~~~~~~~
339 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
342 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
343 Expecting summary function name.
345 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
346 between 0 and 100 for PTILE.
348 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
350 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
353 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
354 FORMAT, or HIDESOURCECATS.
356 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
358 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
360 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
361 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
363 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
366 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
369 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
371 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
374 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
375 DEFAULT, NAME, LABEL, BOTH, or NONE.
377 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
380 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
383 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
384 VARIABLE or LISTWISE.
386 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
389 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
391 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
392 greater for HIDESMALLCOUNTS COUNT.
394 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
395 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
396 HIDESMALLCOUNTS, or TABLE.
398 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
401 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
403 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
406 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
409 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
412 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
415 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
418 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
419 ROWLABELS, or COLLABELS.
421 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
424 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
425 in @<:@0,100@:}@ for CILEVEL.
427 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
428 CAPTION, CORNER, or TITLE.
430 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
433 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
434 in @<:@0,1@:}@ for ALPHA.
436 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
439 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
440 ALLVISIBLE or SUBTOTALS.
442 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
443 ALPHA, INCLUDEMRSETS, or CATEGORIES.
445 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
448 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
451 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
454 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
455 BONFERRONI, BH, or NONE.
457 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
460 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
463 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
464 ALLVISIBLE or SUBTOTALS.
466 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
469 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
472 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
475 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
476 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
479 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
480 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
482 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
485 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
486 97 | CTABLES /TABLE qn20 > qnd1.
489 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
490 97 | CTABLES /TABLE qn20 > qnd1.
493 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
494 97 | CTABLES /TABLE qn20 > qnd1.
497 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
498 categorical variables at the innermost nesting level.
499 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
500 | ^~~~~~~~~~~~~~~~~~~~
502 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
504 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
507 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
508 specification as format DATETIME: Day (123) must be between 1 and 31..
509 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
514 AT_SETUP([CTABLES parsing - more negative])
515 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
516 AT_DATA([ctables.sps],
518 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
519 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
520 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
523 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
524 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
526 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
528 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
529 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
530 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
531 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
533 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
534 CTABLES /PCOMPUTE &x=EXPR([**]).
535 CTABLES /PCOMPUTE &x=EXPR(**).
539 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
541 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
542 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
543 category not included in the category list.
544 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
549 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
550 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
554 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
555 list of categories here.
556 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
561 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
562 category not included in the category list.
563 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
568 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
569 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
573 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
574 variable's CATEGORIES specification.
576 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
577 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
578 subtotals by position, e.g. SUBTOTAL[1].
579 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
580 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
582 ^~~~~~~~~~~~~~~~~~~~~~~~
584 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
586 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
587 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
590 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
591 applied only to string variables, but this subcommand tries to apply it to
592 numeric variable QN1.
593 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
596 ctables.sps:8.53: error: CTABLES: This category specification may be applied
597 only to numeric variables, but this subcommand tries to apply it to string
599 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
602 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
603 based on a summary function.
605 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
606 moved to be categorical, but qnd1 is a scale variable.
608 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
609 moved to have the same width, but QN1 has width 0 and string has width 8.
611 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
612 moved to have the same value labels, but QN1 and QNSA1 have different value
615 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
616 moved to have the same category specifications, but QN105BA and QN105BB have
617 different category specifications.
619 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
620 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
621 this warning, insert parentheses.
622 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
625 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
628 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
630 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
632 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
633 variable must be specified.
635 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
637 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
639 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
642 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
644 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
647 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
649 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
652 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
653 has a summary even if the syntax does not explicitly specify one.
654 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
659 AT_SETUP([CTABLES one categorical variable])
660 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
661 AT_DATA([ctables.sps],
664 CTABLES /TABLE BY qn1.
665 CTABLES /TABLE BY BY qn1.
667 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
669 ╭────────────────────────────────────────────────────────────────────────┬─────╮
671 ├────────────────────────────────────────────────────────────────────────┼─────┤
672 │ 1. How often do you usually drive a car or other Every day │ 4667│
673 │motor vehicle? Several days a week │ 1274│
674 │ Once a week or less │ 361│
675 │ Only certain times a │ 130│
678 ╰────────────────────────────────────────────────────────────────────────┴─────╯
681 ╭──────────────────────────────────────────────────────────────────────────────╮
682 │ 1. How often do you usually drive a car or other motor vehicle? │
683 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
684 │ │ Several days a │ Once a week or │ Only certain times a │ │
685 │Every day│ week │ less │ year │Never│
686 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
687 │ Count │ Count │ Count │ Count │Count│
688 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
689 │ 4667│ 1274│ 361│ 130│ 540│
690 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
702 AT_SETUP([CTABLES one string variable])
703 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
704 AT_DATA([ctables.sps],
707 MISSING VALUES licensed('DontKnow', 'Refused').
708 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
709 CTABLES /TABLE licensed.
710 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
711 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
712 * Notice that the string matching is case-sensitive.
713 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
714 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
716 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
717 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
719 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
721 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
722 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
724 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
726 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
736 ╭─────────────────┬─────┬───────╮
738 ├─────────────────┼─────┼───────┤
739 │licensed DontKnow│ 4│ │
743 │ Total │ 6999│ 6951│
744 ╰─────────────────┴─────┴───────╯
747 ╭──────────────┬─────╮
749 ├──────────────┼─────┤
750 │licensed Yes │ 6379│
753 ╰──────────────┴─────╯
756 ╭──────────────┬─────╮
758 ├──────────────┼─────┤
759 │licensed Yes │ 6379│
762 ╰──────────────┴─────╯
765 ╭────────────────┬─────╮
767 ├────────────────┼─────┤
772 ╰────────────────┴─────╯
775 ╭────────────────┬─────╮
777 ├────────────────┼─────┤
778 │licensed Yes │ 6379│
780 ╰────────────────┴─────╯
783 ╭────────────────┬─────╮
785 ├────────────────┼─────┤
786 │licensed Yes │ 6379│
788 ╰────────────────┴─────╯
792 AT_SETUP([CTABLES one scale variable])
793 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
794 AT_DATA([ctables.sps],
796 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
797 CTABLES /TABLE BY qnd1.
798 CTABLES /TABLE BY BY qnd1.
800 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
802 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
803 │ │ │ │ │ │ Std │ │ │
804 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
805 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
806 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
807 │age? │ │ │ │ │ │ │ │
808 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
811 ╭──────────────────────────╮
812 │D1. AGE: What is your age?│
813 ├──────────────────────────┤
815 ├──────────────────────────┤
817 ╰──────────────────────────╯
820 D1. AGE: What is your age?
829 AT_SETUP([CTABLES simple stacking])
830 AT_KEYWORDS([stack stacked])
831 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
832 AT_DATA([ctables.sps],
834 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
836 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
838 ╭───────────────────────────────────────────────────────────────┬──────────────╮
845 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
846 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
847 │too much to drink to drive safely will A. Get certain │ │ │
848 │stopped by the police? Very likely │ 21%│ 22%│
849 │ Somewhat │ 38%│ 42%│
851 │ Somewhat │ 21%│ 18%│
855 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
856 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
857 │too much to drink to drive safely will B. Have an certain │ │ │
858 │accident? Very likely │ 36%│ 45%│
859 │ Somewhat │ 39%│ 32%│
865 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
866 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
867 │too much to drink to drive safely will C. Be certain │ │ │
868 │convicted for drunk driving? Very likely │ 32%│ 28%│
869 │ Somewhat │ 27%│ 32%│
871 │ Somewhat │ 15%│ 15%│
875 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
876 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
877 │too much to drink to drive safely will D. Be certain │ │ │
878 │arrested for drunk driving? Very likely │ 26%│ 27%│
879 │ Somewhat │ 32%│ 35%│
881 │ Somewhat │ 17%│ 15%│
885 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
889 AT_SETUP([CTABLES show or hide empty categories])
890 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
891 AT_DATA([ctables.sps],
893 IF (qn105ba = 2) qn105ba = 1.
894 IF (qns3a = 1) qns3a = 2.
895 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
896 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
897 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
898 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
899 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
900 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
901 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
903 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
905 ╭──────────────────────────────────────────────────────────────┬───────────────╮
912 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
913 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
914 │too much to drink to drive safely will A. Get certain │ │ │
915 │stopped by the police? Very likely│ .│ 0%│
922 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
925 ╭──────────────────────────────────────────────────────────────┬───────────────╮
932 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
933 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
934 │too much to drink to drive safely will A. Get certain │ │ │
935 │stopped by the police? Somewhat │ .│ 40%│
941 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
944 ╭────────────────────────────────────────────────────────────────────┬─────────╮
951 ├────────────────────────────────────────────────────────────────────┼─────────┤
952 │105b. How likely is it that drivers who have had too Almost │ 32%│
953 │much to drink to drive safely will A. Get stopped by certain │ │
954 │the police? Very likely │ 0%│
961 ╰────────────────────────────────────────────────────────────────────┴─────────╯
964 ╭────────────────────────────────────────────────────────────────────┬─────────╮
971 ├────────────────────────────────────────────────────────────────────┼─────────┤
972 │105b. How likely is it that drivers who have had too Almost │ 32%│
973 │much to drink to drive safely will A. Get stopped by certain │ │
974 │the police? Somewhat │ 40%│
980 ╰────────────────────────────────────────────────────────────────────┴─────────╯
984 AT_SETUP([CTABLES sorting categories])
985 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
986 AT_DATA([ctables.sps],
988 IF (QND5A=6) QND5A=-1.
989 IF (QND5A=5) QND5A=-2.
990 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
991 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
992 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
993 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
995 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
997 ╭────────────────────────────────────────────────────────────────────────┬─────╮
999 ├────────────────────────────────────────────────────────────────────────┼─────┤
1000 │D5a. What would you say is your primary ethnic -2.00 │ 52│
1001 │background? -1.00 │ 78│
1005 │ South American │ 34│
1006 │ Central American │ 0│
1007 │ Puerto Rican, OR │ 0│
1008 │ Something else │ 68│
1009 │ Multiple - cannot choose│ 7│
1011 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1014 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1016 ├────────────────────────────────────────────────────────────────────────┼─────┤
1017 │D5a. What would you say is your primary ethnic Multiple - cannot choose│ 7│
1018 │background? one │ │
1019 │ Something else │ 68│
1020 │ Puerto Rican, OR │ 0│
1021 │ Central American │ 0│
1022 │ South American │ 34│
1028 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1031 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1033 ├────────────────────────────────────────────────────────────────────────┼─────┤
1034 │D5a. What would you say is your primary ethnic Central American │ 0│
1035 │background? Cuban │ 20│
1037 │ Multiple - cannot choose│ 7│
1039 │ Puerto Rican, OR │ 0│
1040 │ Something else │ 68│
1041 │ South American │ 34│
1045 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1048 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1050 ├────────────────────────────────────────────────────────────────────────┼─────┤
1051 │D5a. What would you say is your primary ethnic Spanish │ 48│
1052 │background? South American │ 34│
1053 │ Something else │ 68│
1054 │ Puerto Rican, OR │ 0│
1055 │ Multiple - cannot choose│ 7│
1059 │ Central American │ 0│
1062 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1066 AT_SETUP([CTABLES simple nesting])
1067 AT_KEYWORDS([nest nested])
1068 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1069 AT_DATA([ctables.sps],
1071 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1072 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1073 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1074 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1075 /CLABELS ROW=OPPOSITE.
1077 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1079 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1082 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1083 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1084 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1085 │drive safely will A. Get stopped by Total │ 700│ 10%│
1086 │the police? ╶──────────────────────────┼─────┼──────┤
1087 │ Very S3a. Male │ 660│ 10%│
1088 │ likely GENDER: Female│ 842│ 12%│
1089 │ Total │ 1502│ 22%│
1090 │ ╶──────────────────────────┼─────┼──────┤
1091 │ Somewhat S3a. Male │ 1174│ 17%│
1092 │ likely GENDER: Female│ 1589│ 23%│
1093 │ Total │ 2763│ 40%│
1094 │ ╶──────────────────────────┼─────┼──────┤
1095 │ Somewhat S3a. Male │ 640│ 9%│
1096 │ unlikely GENDER: Female│ 667│ 10%│
1097 │ Total │ 1307│ 19%│
1098 │ ╶──────────────────────────┼─────┼──────┤
1099 │ Very S3a. Male │ 311│ 5%│
1100 │ unlikely GENDER: Female│ 298│ 4%│
1102 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1103 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1104 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1105 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1106 │ ╶──────────────────────────┼─────┼──────┤
1107 │ Very S3a. Male │ 1104│ 16%│
1108 │ likely GENDER: Female│ 1715│ 25%│
1109 │ Total │ 2819│ 41%│
1110 │ ╶──────────────────────────┼─────┼──────┤
1111 │ Somewhat S3a. Male │ 1203│ 17%│
1112 │ likely GENDER: Female│ 1214│ 18%│
1113 │ Total │ 2417│ 35%│
1114 │ ╶──────────────────────────┼─────┼──────┤
1115 │ Somewhat S3a. Male │ 262│ 4%│
1116 │ unlikely GENDER: Female│ 168│ 2%│
1118 │ ╶──────────────────────────┼─────┼──────┤
1119 │ Very S3a. Male │ 81│ 1%│
1120 │ unlikely GENDER: Female│ 59│ 1%│
1122 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1123 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1124 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1125 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1126 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1127 │ Very S3a. Male │ 988│ 14%│
1128 │ likely GENDER: Female│ 1049│ 15%│
1129 │ Total │ 2037│ 30%│
1130 │ ╶──────────────────────────┼─────┼──────┤
1131 │ Somewhat S3a. Male │ 822│ 12%│
1132 │ likely GENDER: Female│ 1210│ 18%│
1133 │ Total │ 2032│ 30%│
1134 │ ╶──────────────────────────┼─────┼──────┤
1135 │ Somewhat S3a. Male │ 446│ 7%│
1136 │ unlikely GENDER: Female│ 548│ 8%│
1138 │ ╶──────────────────────────┼─────┼──────┤
1139 │ Very S3a. Male │ 268│ 4%│
1140 │ unlikely GENDER: Female│ 354│ 5%│
1142 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1143 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1144 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1145 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1146 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1147 │ Very S3a. Male │ 805│ 12%│
1148 │ likely GENDER: Female│ 1029│ 15%│
1149 │ Total │ 1834│ 27%│
1150 │ ╶──────────────────────────┼─────┼──────┤
1151 │ Somewhat S3a. Male │ 975│ 14%│
1152 │ likely GENDER: Female│ 1332│ 19%│
1153 │ Total │ 2307│ 34%│
1154 │ ╶──────────────────────────┼─────┼──────┤
1155 │ Somewhat S3a. Male │ 535│ 8%│
1156 │ unlikely GENDER: Female│ 560│ 8%│
1157 │ Total │ 1095│ 16%│
1158 │ ╶──────────────────────────┼─────┼──────┤
1159 │ Very S3a. Male │ 270│ 4%│
1160 │ unlikely GENDER: Female│ 279│ 4%│
1162 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1165 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1166 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1167 │ │ certain│likely│ likely │ unlikely│unlikely│
1168 │ ├────────┼──────┼─────────┼─────────┼────────┤
1170 │ │ Table %│ % │ Table % │ Table % │ Table %│
1171 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1172 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1173 │GENDER: is it that drivers│ │ │ │ │ │
1174 │ who have had too │ │ │ │ │ │
1175 │ much to drink to │ │ │ │ │ │
1176 │ drive safely will │ │ │ │ │ │
1177 │ A. Get stopped by │ │ │ │ │ │
1178 │ the police? │ │ │ │ │ │
1179 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1180 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1181 │ is it that drivers│ │ │ │ │ │
1182 │ who have had too │ │ │ │ │ │
1183 │ much to drink to │ │ │ │ │ │
1184 │ drive safely will │ │ │ │ │ │
1185 │ A. Get stopped by │ │ │ │ │ │
1186 │ the police? │ │ │ │ │ │
1187 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1188 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1189 │ is it that drivers│ │ │ │ │ │
1190 │ who have had too │ │ │ │ │ │
1191 │ much to drink to │ │ │ │ │ │
1192 │ drive safely will │ │ │ │ │ │
1193 │ A. Get stopped by │ │ │ │ │ │
1194 │ the police? │ │ │ │ │ │
1195 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1196 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1197 │GENDER: is it that drivers│ │ │ │ │ │
1198 │ who have had too │ │ │ │ │ │
1199 │ much to drink to │ │ │ │ │ │
1200 │ drive safely will │ │ │ │ │ │
1201 │ B. Have an │ │ │ │ │ │
1202 │ accident? │ │ │ │ │ │
1203 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1204 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1205 │ is it that drivers│ │ │ │ │ │
1206 │ who have had too │ │ │ │ │ │
1207 │ much to drink to │ │ │ │ │ │
1208 │ drive safely will │ │ │ │ │ │
1209 │ B. Have an │ │ │ │ │ │
1210 │ accident? │ │ │ │ │ │
1211 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1212 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1213 │ is it that drivers│ │ │ │ │ │
1214 │ who have had too │ │ │ │ │ │
1215 │ much to drink to │ │ │ │ │ │
1216 │ drive safely will │ │ │ │ │ │
1217 │ B. Have an │ │ │ │ │ │
1218 │ accident? │ │ │ │ │ │
1219 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1220 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1221 │GENDER: is it that drivers│ │ │ │ │ │
1222 │ who have had too │ │ │ │ │ │
1223 │ much to drink to │ │ │ │ │ │
1224 │ drive safely will │ │ │ │ │ │
1225 │ C. Be convicted │ │ │ │ │ │
1226 │ for drunk driving?│ │ │ │ │ │
1227 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1228 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1229 │ is it that drivers│ │ │ │ │ │
1230 │ who have had too │ │ │ │ │ │
1231 │ much to drink to │ │ │ │ │ │
1232 │ drive safely will │ │ │ │ │ │
1233 │ C. Be convicted │ │ │ │ │ │
1234 │ for drunk driving?│ │ │ │ │ │
1235 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1236 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1237 │ is it that drivers│ │ │ │ │ │
1238 │ who have had too │ │ │ │ │ │
1239 │ much to drink to │ │ │ │ │ │
1240 │ drive safely will │ │ │ │ │ │
1241 │ C. Be convicted │ │ │ │ │ │
1242 │ for drunk driving?│ │ │ │ │ │
1243 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1244 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1245 │GENDER: is it that drivers│ │ │ │ │ │
1246 │ who have had too │ │ │ │ │ │
1247 │ much to drink to │ │ │ │ │ │
1248 │ drive safely will │ │ │ │ │ │
1249 │ D. Be arrested for│ │ │ │ │ │
1250 │ drunk driving? │ │ │ │ │ │
1251 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1252 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1253 │ is it that drivers│ │ │ │ │ │
1254 │ who have had too │ │ │ │ │ │
1255 │ much to drink to │ │ │ │ │ │
1256 │ drive safely will │ │ │ │ │ │
1257 │ D. Be arrested for│ │ │ │ │ │
1258 │ drunk driving? │ │ │ │ │ │
1259 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1260 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1261 │ is it that drivers│ │ │ │ │ │
1262 │ who have had too │ │ │ │ │ │
1263 │ much to drink to │ │ │ │ │ │
1264 │ drive safely will │ │ │ │ │ │
1265 │ D. Be arrested for│ │ │ │ │ │
1266 │ drunk driving? │ │ │ │ │ │
1267 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1271 AT_SETUP([CTABLES nesting and scale variables])
1272 AT_KEYWORDS([nest nested])
1273 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1274 AT_DATA([ctables.sps],
1276 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1277 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1278 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1279 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1280 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1282 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1284 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1290 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1291 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1292 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1294 │ Once a week or │ 44│ 54│
1296 │ Only certain │ 34│ 41│
1297 │ times a year │ │ │
1299 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1302 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1303 │ │Minimum│Maximum│Mean│
1304 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1305 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1306 │What is GENDER: months, has there been a │ │ │ │
1307 │your time when you felt you │ │ │ │
1308 │age? should cut down on your No │ 16│ 86│ 46│
1310 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1311 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1312 │ months, has there been a │ │ │ │
1313 │ time when you felt you │ │ │ │
1314 │ should cut down on your No │ 16│ 86│ 48│
1316 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1317 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1318 │What is GENDER: months, has there been a │ │ │ │
1319 │your time when people criticized No │ 16│ 86│ 46│
1320 │age? your drinking? │ │ │ │
1321 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1322 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1323 │ months, has there been a │ │ │ │
1324 │ time when people criticized No │ 16│ 86│ 48│
1325 │ your drinking? │ │ │ │
1326 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1329 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1330 │ │S1. Including yourself, how many members of this│
1331 │ │ household are age 16 or older? │
1332 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1333 │ │ │ │ │ │ │ │ 6 or │
1334 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1335 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1336 │ │Column│Column│Column│Column│Column│Column│Column│
1337 │ │ % │ % │ % │ % │ % │ % │ % │
1338 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1339 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1340 │SAMPLE How certain │ │ │ │ │ │ │ │
1341 │SOURCE: likely │ │ │ │ │ │ │ │
1342 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1343 │ that likely │ │ │ │ │ │ │ │
1344 │ drivers │ │ │ │ │ │ │ │
1345 │ who have │ │ │ │ │ │ │ │
1346 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1347 │ much to likely │ │ │ │ │ │ │ │
1348 │ drink to │ │ │ │ │ │ │ │
1349 │ drive │ │ │ │ │ │ │ │
1350 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1351 │ will A. unlikely│ │ │ │ │ │ │ │
1352 │ Get │ │ │ │ │ │ │ │
1353 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1354 │ by the unlikely│ │ │ │ │ │ │ │
1355 │ police? │ │ │ │ │ │ │ │
1356 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1359 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1362 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1363 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1364 │group typical month did you have one or more │ │ │
1365 │ alcoholic beverages to drink? │ │ │
1366 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1367 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1368 │ typical month did you have one or more │ │ │
1369 │ alcoholic beverages to drink? │ │ │
1370 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1371 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1372 │ typical month did you have one or more │ │ │
1373 │ alcoholic beverages to drink? │ │ │
1374 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1375 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1376 │ typical month did you have one or more │ │ │
1377 │ alcoholic beverages to drink? │ │ │
1378 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1379 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1380 │ typical month did you have one or more │ │ │
1381 │ alcoholic beverages to drink? │ │ │
1382 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1383 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1384 │ older typical month did you have one or more │ │ │
1385 │ alcoholic beverages to drink? │ │ │
1386 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1391 AT_SETUP([CTABLES SLABELS])
1392 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1393 AT_DATA([ctables.sps],
1395 CTABLES /TABLE qn1 [COUNT COLPCT].
1396 CTABLES /TABLE qn1 [COUNT COLPCT]
1397 /SLABELS POSITION=ROW.
1398 CTABLES /TABLE qn1 [COUNT COLPCT]
1399 /SLABELS POSITION=ROW VISIBLE=NO.
1401 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1403 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1406 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1407 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1408 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1409 │ Once a week or less│ 361│ 5.2%│
1410 │ Only certain times │ 130│ 1.9%│
1412 │ Never │ 540│ 7.7%│
1413 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1416 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1417 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1418 │other motor vehicle? Column │66.9%│
1420 │ ╶───────────────────────────┼─────┤
1421 │ Several days a week Count │ 1274│
1424 │ ╶───────────────────────────┼─────┤
1425 │ Once a week or less Count │ 361│
1428 │ ╶───────────────────────────┼─────┤
1429 │ Only certain times Count │ 130│
1430 │ a year Column │ 1.9%│
1432 │ ╶───────────────────────────┼─────┤
1433 │ Never Count │ 540│
1436 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1439 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1440 │ 1. How often do you usually drive a car or other Every day │ 4667│
1441 │motor vehicle? │66.9%│
1442 │ Several days a week │ 1274│
1444 │ Once a week or less │ 361│
1446 │ Only certain times a │ 130│
1450 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1454 AT_SETUP([CTABLES simple totals])
1455 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1456 AT_DATA([ctables.sps],
1459 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1460 DESCRIPTIVES qn18/STATISTICS=MEAN.
1461 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1462 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1464 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1466 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1468 ├────────────────────────────────────────────────────────────────────────┼─────┤
1469 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1470 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1473 │ Wine coolers │ 137│
1474 │ Hard liquor or │ 888│
1476 │ Flavored malt │ 83│
1478 │ Number responding │ 4221│
1479 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1481 Descriptive Statistics
1482 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1484 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1485 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1486 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1487 │Valid N (listwise) │6999│ │
1488 │Missing N (listwise) │2781│ │
1489 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1492 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1493 │ │ │ │ Valid│Total│
1494 │ │Mean│Count│ N │ N │
1495 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1496 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1497 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1498 │ you usually drink per sitting? │ │ │ │ │
1499 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1500 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1501 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1502 │ you usually drink per sitting? │ │ │ │ │
1503 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1504 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1505 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1506 │ you usually drink per sitting? │ │ │ │ │
1507 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1508 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1509 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1510 │ you usually drink per sitting? │ │ │ │ │
1511 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1512 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1513 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1514 │ you usually drink per sitting? │ │ │ │ │
1515 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1519 AT_SETUP([CTABLES subtotals])
1520 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1521 AT_DATA([ctables.sps],
1523 CTABLES /TABLE=qn105ba BY qns1
1524 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1525 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1526 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1527 CTABLES /TABLE=qn105ba BY qns1
1528 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1529 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1531 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1533 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1534 │ │ S1. Including yourself, how many members of this household │
1535 │ │ are age 16 or older? │
1536 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1537 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1538 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1539 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1540 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1541 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1542 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1543 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1544 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1545 │ likely │ │ │ │ │ │ │ │
1546 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1547 │ unlikely │ │ │ │ │ │ │ │
1548 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1549 │ unlikely │ │ │ │ │ │ │ │
1550 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1553 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1554 │ │ S1. Including yourself, how many members of this household │
1555 │ │ are age 16 or older? │
1556 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1557 │ │ │ │ │ │ │ │ 6 or │
1558 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1559 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1560 │ │ │ │ │ │ Column│ │ │
1561 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1562 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1563 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1564 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1565 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1566 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1567 │ likely │ │ │ │ │ │ │ │
1568 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1569 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1570 │ unlikely │ │ │ │ │ │ │ │
1571 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1572 │ unlikely │ │ │ │ │ │ │ │
1573 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1574 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1577 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1578 │ │ S1. Including yourself, how many members of this household │
1579 │ │ are age 16 or older? │
1580 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1581 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1582 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1583 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1584 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1585 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1586 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1587 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1588 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1589 │ likely │ │ │ │ │ │ │ │
1590 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1591 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1592 │ unlikely │ │ │ │ │ │ │ │
1593 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1594 │ unlikely │ │ │ │ │ │ │ │
1595 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1596 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1600 AT_SETUP([CTABLES PCOMPUTE])
1601 AT_KEYWORDS([postcompute])
1602 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1603 AT_DATA([ctables.sps],
1606 /PCOMPUTE &x=EXPR([3] + [4])
1607 /PCOMPUTE &y=EXPR([4] + [5])
1608 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1609 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1610 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1611 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1613 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1615 /PCOMPUTE &x=EXPR([3] + [4])
1616 /PCOMPUTE &y=EXPR([4] + [5])
1617 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1618 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1619 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1620 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1622 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1624 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1625 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1626 │ ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1627 │ │ 1 │ 2 │ Subtotal │ 3 │ 4 │ 5 │ 3+4 │ 4+5 │ Subtotal │ Total │
1628 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1629 │ │ │ │ │ │ │ │ │ │ │ Row│ │ Row│ │ │ │ Row│ │ │ │ │
1630 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│ % │Count│ % │ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1631 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1632 │105b. How Almost │ 147│30.3%│ 246│50.7%│ 393│81.0%│ 62│12.8%│ 19│3.9%│ 11│2.3%│ 81.00│16.7%│ 30│6.2%│ 92│19.0%│ 485│100.0%│
1633 │likely is certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1634 │it that │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1635 │drivers Very │ 384│34.3%│ 552│49.2%│ 936│83.5%│ 120│10.7%│ 51│4.5%│ 14│1.2%│171.00│15.3%│ 65│5.8%│ 185│16.5%│ 1121│100.0%│
1636 │who have likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1637 │had too │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1638 │much to Somewhat│ 590│27.8%│ 1249│58.8%│ 1839│86.6%│ 193│ 9.1%│ 72│3.4%│ 20│ .9%│265.00│12.5%│ 92│4.3%│ 285│13.4%│ 2124│100.0%│
1639 │drink to likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1640 │drive │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1641 │safely Somewhat│ 278│26.6%│ 647│61.8%│ 925│88.3%│ 84│ 8.0%│ 32│3.1%│ 6│ .6%│116.00│11.1%│ 38│3.6%│ 122│11.7%│ 1047│100.0%│
1642 │will A. unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1643 │Get │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1644 │stopped by Very │ 141│28.5%│ 290│58.7%│ 431│87.2%│ 41│ 8.3%│ 18│3.6%│ 4│ .8%│ 59.00│11.9%│ 22│4.5%│ 63│12.8%│ 494│100.0%│
1645 │the unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1646 │police? │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1647 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1650 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1651 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1652 │ ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1653 │ │ 1 │ 2 │ Subtotal │ 3 │ 3+4 │ 4+5 │ Subtotal │ Total │
1654 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1655 │ │ │ │ │ │ │ │ │ │ │ │ │ Row│ │ │ │ │
1656 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1657 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1658 │105b. How likely is it that Almost │ 147│30.3%│ 246│50.7%│ 393│81.0%│ 62│12.8%│ 81.00│16.7%│ 30│6.2%│ 92│19.0%│ 485│100.0%│
1659 │drivers who have had too much certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1660 │to drink to drive safely will Very │ 384│34.3%│ 552│49.2%│ 936│83.5%│ 120│10.7%│171.00│15.3%│ 65│5.8%│ 185│16.5%│ 1121│100.0%│
1661 │A. Get stopped by the police? likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1662 │ Somewhat │ 590│27.8%│ 1249│58.8%│ 1839│86.6%│ 193│ 9.1%│265.00│12.5%│ 92│4.3%│ 285│13.4%│ 2124│100.0%│
1663 │ likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1664 │ Somewhat │ 278│26.6%│ 647│61.8%│ 925│88.3%│ 84│ 8.0%│116.00│11.1%│ 38│3.6%│ 122│11.7%│ 1047│100.0%│
1665 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1666 │ Very │ 141│28.5%│ 290│58.7%│ 431│87.2%│ 41│ 8.3%│ 59.00│11.9%│ 22│4.5%│ 63│12.8%│ 494│100.0%│
1667 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1668 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1672 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1673 AT_KEYWORDS([postcompute])
1674 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1675 AT_DATA([ctables.sps],
1678 /PCOMPUTE &x=EXPR(OTHERNM)
1679 /PCOMPUTE &y=EXPR(MISSING)
1680 /PPROPERTIES &x LABEL='Drivers'
1681 /PPROPERTIES &y LABEL='Missing Values 2'
1683 /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1685 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1687 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1693 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1694 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1695 │ Several days a week │ 440│ 834│
1696 │ Once a week or less │ 125│ 236│
1697 │ Only certain times a year│ 58│ 72│
1699 │ Drivers │ 2928│ 3504│
1700 │ Valid Values │ 3120│ 3852│
1701 │ Don't know │ 3│ 5│
1703 │ Missing Values │ 12│ 15│
1704 │ Missing Values 2 │ 12│ 15│
1705 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1709 AT_SETUP([CTABLES PCOMPUTE - THRU])
1710 AT_KEYWORDS([postcompute])
1711 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1712 AT_DATA([ctables.sps],
1715 /PCOMPUTE &x=EXPR([1 THRU 2])
1716 /PCOMPUTE &y=EXPR([3 THRU 4])
1717 /PCOMPUTE &z=EXPR([5] + MISSING)
1718 /PPROPERTIES &x LABEL='Frequent Drivers'
1719 /PPROPERTIES &y LABEL='Infrequent Drivers'
1720 /PPROPERTIES &z LABEL='Not Drivers or Missing'
1722 /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
1724 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1726 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1732 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1733 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1734 │ Several days a week │ 440│ 834│
1735 │ Frequent Drivers │ 2745│ 3196│
1736 │ Once a week or less │ 125│ 236│
1737 │ Only certain times a year│ 58│ 72│
1738 │ Infrequent Drivers │ 183│ 308│
1739 │ Drivers │ 2928│ 3504│
1741 │ Don't know │ 3│ 5│
1743 │ Not Drivers or Missing │ 204│ 363│
1744 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1748 dnl I'm not sure that this is the correct behavior (see
1749 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
1750 dnl but at least this test will notify us if the behavior changes.
1751 AT_SETUP([CTABLES intersecting PCOMPUTEs])
1752 AT_KEYWORDS([PCOMPUTE postcompute])
1753 AT_DATA([ctables.sps],
1754 [[DATA LIST LIST NOTABLE/x y z.
1757 VARIABLE LEVEL x y (NOMINAL).
1771 /PCOMPUTE &a = EXPR([1] + [2])
1772 /PCOMPUTE &b = EXPR([2] + [3])
1773 /PCOMPUTE &c = EXPR([4] * [5])
1774 /PCOMPUTE &d = EXPR([5] * [6])
1776 /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
1777 /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
1779 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
1781 ╭───────────┬─────────────────────────────────────╮
1783 │ ├─────┬─────────┬─────┬─────────┬─────┤
1784 │ │ 4 │[4] * [5]│ 5 │[5] * [6]│ 6 │
1785 │ ├─────┼─────────┼─────┼─────────┼─────┤
1786 │ │Count│ Count │Count│ Count │Count│
1787 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
1788 │x 1 │ 5│ 10│ 2│ 18│ 9│
1789 │ [1] + [2]│ 7│ .│ 5│ .│ 13│
1790 │ 2 │ 2│ 6│ 3│ 12│ 4│
1791 │ [2] + [3]│ 3│ .│ 9│ .│ 5│
1792 │ 3 │ 1│ 6│ 6│ 6│ 1│
1793 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
1797 AT_SETUP([CTABLES string and date and time])
1800 for gender in F M; do
1801 for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
1802 for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
1803 printf "$weight $gender $month $wkday\n"
1804 weight=$(expr \( $weight + 3 \) % 7 + 2)
1809 AT_DATA([ctables.sps],
1810 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
1811 /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
1813 VARIABLE LEVEL w (SCALE).
1814 VARIABLE LEVEL gender fmon fday (NOMINAL).
1817 fmon 'Favorite month'
1818 fday 'Favorite day of the week'.
1819 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
1821 /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
1822 /PPROPERTIES &q2 LABEL='Q2'
1823 /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
1824 /PPROPERTIES &weekend LABEL='Weekend'
1825 /TABLE fmon BY gender > fday
1826 /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
1828 'JUL' THRU 'sep', SUBTOTAL="Q3",
1829 OTHERNM, SUBTOTAL='Q4']
1830 /CATEGORIES VARIABLES=gender ['M', 'F']
1831 /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
1832 /SLABELS VISIBLE=NO.
1834 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1836 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
1838 │ ├─────────────────────────────────────────┬─────────────────────────────────────────┤
1840 │ ├─────────────────────────────────────────┼─────────────────────────────────────────┤
1841 │ │ Favorite day of the week │ Favorite day of the week │
1842 │ ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
1843 │ │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
1844 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
1845 │Favorite month JAN│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 9│ 6│ 4│ 2│ 7│ 5│ 3│ 12│ 36│
1846 │ FEB│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1847 │ MAR│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1848 │ Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│ │ │ 29│ 12│ 13│ 14│ 15│ 16│ 17│ │ │
1849 │ APR│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1850 │ MAY│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1851 │ JUN│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│
1852 │ Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│ .│ │ 28│ 15│ 16│ 17│ 18│ 12│ 13│ .│ │
1853 │ JUL│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│
1854 │ AUG│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│
1855 │ SEP│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1856 │ Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│ │ │ 62│ 33│ 28│ 30│ 32│ 27│ 29│ │ │
1857 │ OCT│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1858 │ NOV│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1859 │ DEC│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1860 │ Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│ │ │ 26│ 14│ 15│ 16│ 17│ 18│ 12│ │ │
1861 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
1865 AT_SETUP([CTABLES CLABELS])
1866 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1867 AT_DATA([ctables.sps],
1869 CTABLES /TABLE AgeGroup BY qns3a.
1870 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1871 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1872 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1873 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1875 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1877 ╭───────────────────────┬────────────╮
1883 ├───────────────────────┼─────┼──────┤
1884 │Age group 15 or younger│ 0│ 0│
1885 │ 16 to 25 │ 594│ 505│
1886 │ 26 to 35 │ 476│ 491│
1887 │ 36 to 45 │ 489│ 548│
1888 │ 46 to 55 │ 526│ 649│
1889 │ 56 to 65 │ 516│ 731│
1890 │ 66 or older │ 531│ 943│
1891 ╰───────────────────────┴─────┴──────╯
1894 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1896 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1898 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1899 │ │ 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 │
1900 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1901 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1902 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1903 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1904 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1905 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1906 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1909 ╭──────────────────────────────┬────────────╮
1913 ├──────────────────────────────┼────────────┤
1914 │Age group 15 or younger Male │ 0│
1916 │ ╶────────────────────┼────────────┤
1917 │ 16 to 25 Male │ 594│
1919 │ ╶────────────────────┼────────────┤
1920 │ 26 to 35 Male │ 476│
1922 │ ╶────────────────────┼────────────┤
1923 │ 36 to 45 Male │ 489│
1925 │ ╶────────────────────┼────────────┤
1926 │ 46 to 55 Male │ 526│
1928 │ ╶────────────────────┼────────────┤
1929 │ 56 to 65 Male │ 516│
1931 │ ╶────────────────────┼────────────┤
1932 │ 66 or older Male │ 531│
1934 ╰──────────────────────────────┴────────────╯
1938 ╭─────────┬────────────╮
1944 ├─────────┼─────┼──────┤
1946 ╰─────────┴─────┴──────╯
1950 ╭─────────┬────────────╮
1956 ├─────────┼─────┼──────┤
1957 │Age group│ 594│ 505│
1958 ╰─────────┴─────┴──────╯
1962 ╭─────────┬────────────╮
1968 ├─────────┼─────┼──────┤
1969 │Age group│ 476│ 491│
1970 ╰─────────┴─────┴──────╯
1974 ╭─────────┬────────────╮
1980 ├─────────┼─────┼──────┤
1981 │Age group│ 489│ 548│
1982 ╰─────────┴─────┴──────╯
1986 ╭─────────┬────────────╮
1992 ├─────────┼─────┼──────┤
1993 │Age group│ 526│ 649│
1994 ╰─────────┴─────┴──────╯
1998 ╭─────────┬────────────╮
2004 ├─────────┼─────┼──────┤
2005 │Age group│ 516│ 731│
2006 ╰─────────┴─────┴──────╯
2010 ╭─────────┬────────────╮
2016 ├─────────┼─────┼──────┤
2017 │Age group│ 531│ 943│
2018 ╰─────────┴─────┴──────╯
2022 ╭───────────────────────┬────────────╮
2026 ├───────────────────────┼────────────┤
2027 │Age group 15 or younger│ 0│
2033 │ 66 or older │ 531│
2034 ╰───────────────────────┴────────────╯
2038 ╭───────────────────────┬────────────╮
2042 ├───────────────────────┼────────────┤
2043 │Age group 15 or younger│ 0│
2049 │ 66 or older │ 943│
2050 ╰───────────────────────┴────────────╯
2054 AT_SETUP([CTABLES missing values])
2055 AT_DATA([ctables.sps],
2056 [[DATA LIST LIST NOTABLE/x y.
2095 MISSING VALUES x (1, 2) y (2, 3).
2096 VARIABLE LEVEL ALL (NOMINAL).
2098 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2099 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2100 /CATEGORIES VARIABLES=ALL TOTAL=YES.
2101 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2102 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2103 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2104 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2105 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2106 /CATEGORIES VARIABLES=ALL TOTAL=YES
2107 /SLABELS POSITION=ROW.
2108 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2109 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2110 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
2111 /SLABELS POSITION=ROW.
2112 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2113 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2114 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
2115 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
2116 /SLABELS POSITION=ROW.
2118 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2120 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2121 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2122 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2123 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2124 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2125 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2126 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2127 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2128 dnl Note that Column Total N % doesn't add up to 100 because missing
2129 dnl values are included in the total but not shown as a category and this
2130 dnl is expected behavior.
2133 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2134 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2135 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2136 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2137 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2138 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2139 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2140 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2141 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2142 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2143 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2144 dnl values are included in the total but not shown as a category and this
2145 dnl is expected behavior.
2148 ╭────────────────────────┬───────────────────────────╮
2150 │ ├──────┬──────┬──────┬──────┤
2151 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
2152 ├────────────────────────┼──────┼──────┼──────┼──────┤
2153 │x 3.00 Count │ 1│ 1│ 1│ 3│
2154 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2155 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2156 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2157 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2158 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2159 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2160 │ Valid N │ │ │ │ 3│
2161 │ Total N │ │ │ │ 6│
2162 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2163 │ 4.00 Count │ 1│ 1│ 1│ 3│
2164 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2165 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2166 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2167 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2168 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2169 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2170 │ Valid N │ │ │ │ 3│
2171 │ Total N │ │ │ │ 6│
2172 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2173 │ 5.00 Count │ 1│ 1│ 1│ 3│
2174 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2175 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2176 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2177 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2178 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2179 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2180 │ Valid N │ │ │ │ 3│
2181 │ Total N │ │ │ │ 6│
2182 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2183 │ Total Count │ 3│ 3│ 3│ 9│
2184 │ Column % │100.0%│100.0%│100.0%│ .│
2185 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
2186 │ Column Total N %│100.0%│100.0%│100.0%│ .│
2187 │ Row % │ .│ .│ .│ .│
2188 │ Row Valid N % │ .│ .│ .│ .│
2189 │ Row Total N % │ .│ .│ .│ .│
2190 │ Valid N │ 3│ 3│ 3│ 9│
2191 │ Total N │ 6│ 6│ 6│ 36│
2192 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2195 ╭────────────────────────┬─────────────────────────────────────────╮
2197 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
2198 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2199 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2200 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2201 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2202 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2203 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2204 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2205 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2206 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2207 │ Valid N │ │ │ │ │ │ 0│
2208 │ Total N │ │ │ │ │ │ 6│
2209 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2210 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2211 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2212 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2213 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2214 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2215 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2216 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2217 │ Valid N │ │ │ │ │ │ 0│
2218 │ Total N │ │ │ │ │ │ 6│
2219 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2220 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2221 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2222 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2223 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2224 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2225 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2226 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2227 │ Valid N │ │ │ │ │ │ 3│
2228 │ Total N │ │ │ │ │ │ 6│
2229 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2230 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2231 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2232 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2233 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2234 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2235 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2236 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2237 │ Valid N │ │ │ │ │ │ 3│
2238 │ Total N │ │ │ │ │ │ 6│
2239 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2240 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2241 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2242 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2243 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2244 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2245 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2246 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2247 │ Valid N │ │ │ │ │ │ 3│
2248 │ Total N │ │ │ │ │ │ 6│
2249 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2250 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
2251 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2252 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
2253 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2254 │ Row % │ .│ .│ .│ .│ .│ .│
2255 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2256 │ Row Total N % │ .│ .│ .│ .│ .│ .│
2257 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
2258 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
2259 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2262 ╭────────────────────────┬──────────────────────────────────╮
2264 │ ├──────┬──────┬──────┬──────┬──────┤
2265 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2266 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2267 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
2268 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2269 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2270 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2271 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2272 │ Row Valid N % │ .│ .│ .│ .│ .│
2273 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2274 │ Valid N │ │ │ │ │ 0│
2275 │ Total N │ │ │ │ │ 6│
2276 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2277 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
2278 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2279 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2280 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2281 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2282 │ Row Valid N % │ .│ .│ .│ .│ .│
2283 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2284 │ Valid N │ │ │ │ │ 0│
2285 │ Total N │ │ │ │ │ 6│
2286 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2287 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
2288 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2289 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2290 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2291 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2292 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2293 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2294 │ Valid N │ │ │ │ │ 3│
2295 │ Total N │ │ │ │ │ 6│
2296 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2297 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2298 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2299 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2300 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2301 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2302 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2303 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2304 │ Valid N │ │ │ │ │ 3│
2305 │ Total N │ │ │ │ │ 6│
2306 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2307 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2308 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2309 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2310 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2311 │ Row % │ .│ .│ .│ .│ .│
2312 │ Row Valid N % │ .│ .│ .│ .│ .│
2313 │ Row Total N % │ .│ .│ .│ .│ .│
2314 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2315 │ Total N │ 5│ 5│ 5│ 5│ 30│
2316 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2320 AT_SETUP([CTABLES SMISSING=LISTWISE])
2321 AT_KEYWORDS([SMISSING LISTWISE])
2322 AT_DATA([ctables.sps],
2323 [[DATA LIST LIST NOTABLE/x y z.
2331 VARIABLE LEVEL x (NOMINAL).
2333 CTABLES /TABLE (y + z) > x.
2334 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2336 * The following doesn't come out as listwise because the tables are
2337 separate, not linked by an > operator.
2338 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2340 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2370 AT_SETUP([CTABLES VLABELS - variables on different axes])
2371 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2372 AT_DATA([ctables.sps],
2374 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2375 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2376 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2377 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2378 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2380 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2382 ╭────────────────────────────────────────────────────────────────┬────────────╮
2388 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2389 │D5a. What would you say is your primary Cuban │ 13│ 7│
2390 │ethnic background? Mexican │ 175│ 136│
2392 │ South American │ 21│ 13│
2393 │ Central American │ 27│ 25│
2394 │ Puerto Rican, OR │ 37│ 41│
2395 │ Something else │ 35│ 33│
2396 │ Multiple - cannot │ 2│ 5│
2398 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2401 ╭──────────────────────────────────┬────────────╮
2407 ├──────────────────────────────────┼─────┼──────┤
2408 │QND5A Cuban │ 13│ 7│
2409 │ Mexican │ 175│ 136│
2411 │ South American │ 21│ 13│
2412 │ Central American │ 27│ 25│
2413 │ Puerto Rican, OR │ 37│ 41│
2414 │ Something else │ 35│ 33│
2415 │ Multiple - cannot choose one│ 2│ 5│
2416 ╰──────────────────────────────────┴─────┴──────╯
2419 ╭────────────────────────────────────────────────────────────────┬────────────╮
2425 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2426 │D5a. What would you say is your primary Cuban │ 13│ 7│
2427 │ethnic background? Mexican │ 175│ 136│
2429 │ South American │ 21│ 13│
2430 │ Central American │ 27│ 25│
2431 │ Puerto Rican, OR │ 37│ 41│
2432 │ Something else │ 35│ 33│
2433 │ Multiple - cannot │ 2│ 5│
2435 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2438 ╭────────────────────────────────────────────────────────────┬────────────────╮
2441 │ ├───────┬────────┤
2443 │ ├───────┼────────┤
2445 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2446 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2447 │primary ethnic background? Mexican │ 175│ 136│
2449 │ South American │ 21│ 13│
2450 │ Central American │ 27│ 25│
2451 │ Puerto Rican, OR │ 37│ 41│
2452 │ Something else │ 35│ 33│
2453 │ Multiple - cannot │ 2│ 5│
2455 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2458 ╭────────────────────────────┬─────┬──────╮
2462 ├────────────────────────────┼─────┼──────┤
2464 │Mexican │ 175│ 136│
2466 │South American │ 21│ 13│
2467 │Central American │ 27│ 25│
2468 │Puerto Rican, OR │ 37│ 41│
2469 │Something else │ 35│ 33│
2470 │Multiple - cannot choose one│ 2│ 5│
2471 ╰────────────────────────────┴─────┴──────╯
2475 AT_SETUP([CTABLES VLABELS - stacked variables])
2476 AT_KEYWORDS([stack stacking])
2477 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2478 AT_DATA([ctables.sps],
2480 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2481 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2482 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2483 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2484 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2486 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2488 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2490 ├───────────────────────────────────────────────────────────────────────┼─────┤
2491 │D5a. What would you say is your primary ethnic Cuban │ 20│
2492 │background? Mexican │ 311│
2494 │ South American │ 34│
2495 │ Central American │ 52│
2496 │ Puerto Rican, OR │ 78│
2497 │ Something else │ 68│
2498 │ Multiple - cannot │ 7│
2500 ├───────────────────────────────────────────────────────────────────────┼─────┤
2503 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2506 ╭─────────────────────────────────────────┬─────╮
2508 ├─────────────────────────────────────────┼─────┤
2512 │ South American │ 34│
2513 │ Central American │ 52│
2514 │ Puerto Rican, OR │ 78│
2515 │ Something else │ 68│
2516 │ Multiple - cannot choose one│ 7│
2517 ├─────────────────────────────────────────┼─────┤
2518 │S3a. GENDER: Male │ 3132│
2520 ╰─────────────────────────────────────────┴─────╯
2523 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2525 ├───────────────────────────────────────────────────────────────────────┼─────┤
2526 │D5a. What would you say is your primary ethnic Cuban │ 20│
2527 │background? Mexican │ 311│
2529 │ South American │ 34│
2530 │ Central American │ 52│
2531 │ Puerto Rican, OR │ 78│
2532 │ Something else │ 68│
2533 │ Multiple - cannot │ 7│
2535 ├───────────────────────────────────────────────────────────────────────┼─────┤
2537 ├───────────────────────────────────────────────────────────────────────┼─────┤
2539 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2542 ╭─────────────────────────────┬─────╮
2544 ├─────────────────────────────┼─────┤
2546 ├─────────────────────────────┼─────┤
2548 ├─────────────────────────────┼─────┤
2550 ├─────────────────────────────┼─────┤
2551 │South American │ 34│
2552 ├─────────────────────────────┼─────┤
2553 │Central American │ 52│
2554 ├─────────────────────────────┼─────┤
2555 │Puerto Rican, OR │ 78│
2556 ├─────────────────────────────┼─────┤
2557 │Something else │ 68│
2558 ├─────────────────────────────┼─────┤
2559 │Multiple - cannot choose one │ 7│
2560 ├─────────────────────────────┼─────┤
2561 │S3a. GENDER: Male │ 3132│
2563 ╰─────────────────────────────┴─────╯
2566 ╭────────────────────────────┬─────╮
2568 ├────────────────────────────┼─────┤
2572 │South American │ 34│
2573 │Central American │ 52│
2574 │Puerto Rican, OR │ 78│
2575 │Something else │ 68│
2576 │Multiple - cannot choose one│ 7│
2579 ╰────────────────────────────┴─────╯
2583 AT_SETUP([CTABLES VLABELS - nested variables])
2584 AT_KEYWORDS([nest nesting])
2585 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2586 AT_DATA([ctables.sps],
2588 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2589 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2590 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2591 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2592 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2594 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2596 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2598 ├───────────────────────────────────────────────────────────────────────┼─────┤
2599 │D5a. What would you say is your Cuban QNS3A Male │ 13│
2600 │primary ethnic background? Female│ 7│
2601 │ ╶─────────────────────────────────┼─────┤
2602 │ Mexican QNS3A Male │ 175│
2604 │ ╶─────────────────────────────────┼─────┤
2605 │ Spanish QNS3A Male │ 20│
2607 │ ╶─────────────────────────────────┼─────┤
2608 │ South American QNS3A Male │ 21│
2610 │ ╶─────────────────────────────────┼─────┤
2611 │ Central American QNS3A Male │ 27│
2613 │ ╶─────────────────────────────────┼─────┤
2614 │ Puerto Rican, OR QNS3A Male │ 37│
2616 │ ╶─────────────────────────────────┼─────┤
2617 │ Something else QNS3A Male │ 35│
2619 │ ╶─────────────────────────────────┼─────┤
2620 │ Multiple - cannot QNS3A Male │ 2│
2621 │ choose one Female│ 5│
2622 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2625 ╭──────────────────────────────────────────────────────┬─────╮
2627 ├──────────────────────────────────────────────────────┼─────┤
2628 │QND5A Cuban S3a. GENDER: Male │ 13│
2630 │ ╶────────────────────────────────────────────────┼─────┤
2631 │ Mexican S3a. GENDER: Male │ 175│
2633 │ ╶────────────────────────────────────────────────┼─────┤
2634 │ Spanish S3a. GENDER: Male │ 20│
2636 │ ╶────────────────────────────────────────────────┼─────┤
2637 │ South American S3a. GENDER: Male │ 21│
2639 │ ╶────────────────────────────────────────────────┼─────┤
2640 │ Central American S3a. GENDER: Male │ 27│
2642 │ ╶────────────────────────────────────────────────┼─────┤
2643 │ Puerto Rican, OR S3a. GENDER: Male │ 37│
2645 │ ╶────────────────────────────────────────────────┼─────┤
2646 │ Something else S3a. GENDER: Male │ 35│
2648 │ ╶────────────────────────────────────────────────┼─────┤
2649 │ Multiple - cannot choose one S3a. GENDER: Male │ 2│
2651 ╰──────────────────────────────────────────────────────┴─────╯
2654 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2656 ├───────────────────────────────────────────────────────────────────────┼─────┤
2657 │D5a. What would you say is your primary Cuban Male │ 13│
2658 │ethnic background? Female│ 7│
2659 │ ╶────────────────────────────┼─────┤
2660 │ Mexican Male │ 175│
2662 │ ╶────────────────────────────┼─────┤
2663 │ Spanish Male │ 20│
2665 │ ╶────────────────────────────┼─────┤
2666 │ South American Male │ 21│
2668 │ ╶────────────────────────────┼─────┤
2669 │ Central American Male │ 27│
2671 │ ╶────────────────────────────┼─────┤
2672 │ Puerto Rican, OR Male │ 37│
2674 │ ╶────────────────────────────┼─────┤
2675 │ Something else Male │ 35│
2677 │ ╶────────────────────────────┼─────┤
2678 │ Multiple - cannot Male │ 2│
2679 │ choose one Female│ 5│
2680 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2683 ╭────────────────────────────────────────────────┬─────╮
2685 ├────────────────────────────────────────────────┼─────┤
2686 │Cuban S3a. GENDER: Male │ 13│
2688 ├────────────────────────────────────────────────┼─────┤
2689 │Mexican S3a. GENDER: Male │ 175│
2691 ├────────────────────────────────────────────────┼─────┤
2692 │Spanish S3a. GENDER: Male │ 20│
2694 ├────────────────────────────────────────────────┼─────┤
2695 │South American S3a. GENDER: Male │ 21│
2697 ├────────────────────────────────────────────────┼─────┤
2698 │Central American S3a. GENDER: Male │ 27│
2700 ├────────────────────────────────────────────────┼─────┤
2701 │Puerto Rican, OR S3a. GENDER: Male │ 37│
2703 ├────────────────────────────────────────────────┼─────┤
2704 │Something else S3a. GENDER: Male │ 35│
2706 ├────────────────────────────────────────────────┼─────┤
2707 │Multiple - cannot choose one S3a. GENDER: Male │ 2│
2709 ╰────────────────────────────────────────────────┴─────╯
2712 ╭───────────────────────────────────┬─────╮
2714 ├───────────────────────────────────┼─────┤
2717 ├───────────────────────────────────┼─────┤
2718 │Mexican Male │ 175│
2720 ├───────────────────────────────────┼─────┤
2723 ├───────────────────────────────────┼─────┤
2724 │South American Male │ 21│
2726 ├───────────────────────────────────┼─────┤
2727 │Central American Male │ 27│
2729 ├───────────────────────────────────┼─────┤
2730 │Puerto Rican, OR Male │ 37│
2732 ├───────────────────────────────────┼─────┤
2733 │Something else Male │ 35│
2735 ├───────────────────────────────────┼─────┤
2736 │Multiple - cannot choose one Male │ 2│
2738 ╰───────────────────────────────────┴─────╯
2742 AT_SETUP([CTABLES FORMAT EMPTY])
2743 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2744 AT_DATA([ctables.sps],
2746 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2747 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2748 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2750 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2752 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2753 │ │ D5. ETHNICITY: Are you of │
2754 │ │ Hispanic or Latino origin or │
2756 │ ├───────────────┬───────────────┤
2758 │ ├───────────────┼───────────────┤
2760 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2761 │D5a. What would you say is Cuban │ 20│ 0│
2762 │your primary ethnic Mexican │ 311│ 0│
2763 │background? Spanish │ 48│ 0│
2764 │ South American │ 34│ 0│
2765 │ Central American│ 52│ 0│
2766 │ Puerto Rican, OR│ 78│ 0│
2767 │ Something else │ 68│ 0│
2768 │ Multiple - │ 7│ 0│
2769 │ cannot choose │ │ │
2771 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2774 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2775 │ │ D5. ETHNICITY: Are you of │
2776 │ │ Hispanic or Latino origin or │
2778 │ ├───────────────┬───────────────┤
2780 │ ├───────────────┼───────────────┤
2782 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2783 │D5a. What would you say is Cuban │ 20│ │
2784 │your primary ethnic Mexican │ 311│ │
2785 │background? Spanish │ 48│ │
2786 │ South American │ 34│ │
2787 │ Central American│ 52│ │
2788 │ Puerto Rican, OR│ 78│ │
2789 │ Something else │ 68│ │
2791 │ cannot choose │ │ │
2793 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2796 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2797 │ │ D5. ETHNICITY: Are you of │
2798 │ │ Hispanic or Latino origin or │
2800 │ ├───────────────┬───────────────┤
2802 │ ├───────────────┼───────────────┤
2804 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2805 │D5a. What would you say is Cuban │ 20│n/a │
2806 │your primary ethnic Mexican │ 311│n/a │
2807 │background? Spanish │ 48│n/a │
2808 │ South American │ 34│n/a │
2809 │ Central American│ 52│n/a │
2810 │ Puerto Rican, OR│ 78│n/a │
2811 │ Something else │ 68│n/a │
2812 │ Multiple - │ 7│n/a │
2813 │ cannot choose │ │ │
2815 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2819 AT_SETUP([CTABLES FORMAT MISSING])
2820 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2821 AT_DATA([ctables.sps],
2823 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2825 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2827 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2828 │ │ D5. ETHNICITY: Are you of │
2829 │ │ Hispanic or Latino origin or │
2831 │ ├───────────────┬───────────────┤
2833 │ ├───────────────┼───────────────┤
2834 │ │ Column % │ Column % │
2835 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2836 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2837 │your primary ethnic Mexican │ 50.3%│(no data) │
2838 │background? Spanish │ 7.8%│(no data) │
2839 │ South American │ 5.5%│(no data) │
2840 │ Central American│ 8.4%│(no data) │
2841 │ Puerto Rican, OR│ 12.6%│(no data) │
2842 │ Something else │ 11.0%│(no data) │
2843 │ Multiple - │ 1.1%│(no data) │
2844 │ cannot choose │ │ │
2846 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2850 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2851 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2852 AT_DATA([ctables.sps],
2854 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2855 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2856 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2858 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2860 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2862 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2863 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2864 │occasion? 1 │ 491│ 34.9%│
2884 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2887 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2889 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2890 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2891 │occasion? 1 │ 491│ 34.9%│
2911 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2914 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2916 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2917 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2918 │occasion? 1 │ 491│ 34.9%│
2938 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2942 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2943 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2944 AT_DATA([ctables.sps],
2946 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2948 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2960 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2961 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2962 maximumColumnWidth="192"
2963 minimumColumnWidth="96"
2967 AT_SETUP([CTABLES special formats])
2968 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2969 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2970 AT_DATA([ctables.sps],
2972 COMPUTE x = qnd3 - 4.
2973 CTABLES /TABLE x[MINIMUM NEGPAREN8.1, MINIMUM NEQUAL8.1, MINIMUM PAREN8.1, MINIMUM PCTPAREN8.1, MAXIMUM NEGPAREN8.1, MAXIMUM NEQUAL8.1, MAXIMUM PAREN8.1, MAXIMUM PCTPAREN8.1].
2975 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2977 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2978 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2979 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2980 │x│(3.0) │N=-3.0 │(-3.0) │(-3.0%)│8.0 │N=8.0 │(8.0) │(8.0%) │
2981 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2985 AT_SETUP([CTABLES TITLES])
2986 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2987 AT_DATA([ctables.sps],
2990 /VLABELS VARIABLES=qn1 DISPLAY=NONE
2991 /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2992 /TITLES TITLE='How often do you drive?'
2993 CAPTION='Generated )TIME on )DATE'
2996 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
2997 s&../../..&MM/DD/YY&'], [0], [dnl
2998 How often do you drive?
2999 ╭───────────────────────────────────┬─────────────────────────────────────────╮
3001 │ ├────────────────────┬────────────────────┤
3003 │ ├────────────────────┼────────────────────┤
3004 │ │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3005 │ │ you of Hispanic or │ you of Hispanic or │
3006 │ │ Latino origin or │ Latino origin or │
3007 │( ( 1. How often do you usually │ descent? │ descent? │
3008 │drive a car or other motor ├─────────┬──────────┼─────────┬──────────┤
3009 │vehicle?) ) BY S3a. GENDER: > D5. │ Yes │ No │ Yes │ No │
3010 │ETHNICITY: Are you of Hispanic or ├─────────┼──────────┼─────────┼──────────┤
3011 │Latino origin or descent? │ Count │ Count │ Count │ Count │
3012 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3013 │Every day │ 218│ 2066│ 166│ 2175│
3014 │Several days a week │ 44│ 391│ 45│ 782│
3015 │Once a week or less │ 16│ 109│ 12│ 223│
3016 │Only certain times a year │ 15│ 41│ 11│ 61│
3017 │Never │ 39│ 150│ 56│ 278│
3018 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3019 Generated HH:MM:SS on MM/DD/YY
3023 AT_SETUP([CTABLES area definitions])
3024 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3025 AT_DATA([ctables.sps],
3028 /VLABELS VARIABLES=ALL DISPLAY=NAME
3029 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3030 /SLABELS POSITION=ROW
3031 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROWID, LAYERROWID]
3032 /SLABELS POSITION=ROW
3033 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COLID, LAYERCOLID]
3034 /SLABELS POSITION=ROW.
3036 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3039 ╭─────────────────────────────┬─────────────┬──────╮
3041 │ ├──────┬──────┼───┬──┤
3043 │ ├──────┼──────┤ │ │
3044 │ │ QN86 │ QN86 │ │ │
3045 │ ├───┬──┼───┬──┤ │ │
3046 │ │Yes│No│Yes│No│Yes│No│
3047 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3048 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3049 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3050 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
3051 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3052 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3053 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3054 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
3055 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3056 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3057 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3058 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
3059 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3060 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3061 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3062 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
3063 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3067 ╭─────────────────────────────┬─────────────┬──────╮
3069 │ ├──────┬──────┼───┬──┤
3071 │ ├──────┼──────┤ │ │
3072 │ │ QN86 │ QN86 │ │ │
3073 │ ├───┬──┼───┬──┤ │ │
3074 │ │Yes│No│Yes│No│Yes│No│
3075 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3076 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3077 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3078 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
3079 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3080 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3081 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3082 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
3083 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3084 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3085 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3086 │ Subtable ID│ 10│10│ 11│11│ 12│12│
3087 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3088 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3089 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3090 │ Subtable ID│ 10│10│ 11│11│ 12│12│
3091 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3095 ╭──────────────────────────────┬─────────────┬──────╮
3097 │ ├──────┬──────┼───┬──┤
3099 │ ├──────┼──────┤ │ │
3100 │ │ QN86 │ QN86 │ │ │
3101 │ ├───┬──┼───┬──┤ │ │
3102 │ │Yes│No│Yes│No│Yes│No│
3103 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3104 │QN61 Yes QN57 Yes Row ID │ 1│ 1│ 2│ 2│ 3│ 3│
3105 │ Layer Row ID│ 1│ 1│ 1│ 1│ 2│ 2│
3106 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3107 │ No Row ID │ 4│ 4│ 5│ 5│ 6│ 6│
3108 │ Layer Row ID│ 3│ 3│ 3│ 3│ 4│ 4│
3109 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3110 │ No QN57 Yes Row ID │ 7│ 7│ 8│ 8│ 9│ 9│
3111 │ Layer Row ID│ 5│ 5│ 5│ 5│ 6│ 6│
3112 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3113 │ No Row ID │ 10│10│ 11│11│ 12│12│
3114 │ Layer Row ID│ 7│ 7│ 7│ 7│ 8│ 8│
3115 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3119 ╭──────────────────────────────┬─────────────┬──────╮
3121 │ ├──────┬──────┼───┬──┤
3123 │ ├──────┼──────┤ │ │
3124 │ │ QN86 │ QN86 │ │ │
3125 │ ├───┬──┼───┬──┤ │ │
3126 │ │Yes│No│Yes│No│Yes│No│
3127 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3128 │QN61 Yes QN57 Yes Row ID │ 13│13│ 14│14│ 15│15│
3129 │ Layer Row ID│ 9│ 9│ 9│ 9│ 10│10│
3130 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3131 │ No Row ID │ 16│16│ 17│17│ 18│18│
3132 │ Layer Row ID│ 11│11│ 11│11│ 12│12│
3133 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3134 │ No QN57 Yes Row ID │ 19│19│ 20│20│ 21│21│
3135 │ Layer Row ID│ 13│13│ 13│13│ 14│14│
3136 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3137 │ No Row ID │ 22│22│ 23│23│ 24│24│
3138 │ Layer Row ID│ 15│15│ 15│15│ 16│16│
3139 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3143 ╭─────────────────────────────────┬─────────────┬──────╮
3145 │ ├──────┬──────┼───┬──┤
3147 │ ├──────┼──────┤ │ │
3148 │ │ QN86 │ QN86 │ │ │
3149 │ ├───┬──┼───┬──┤ │ │
3150 │ │Yes│No│Yes│No│Yes│No│
3151 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3152 │QN61 Yes QN57 Yes Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3153 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3154 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3155 │ No Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3156 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3157 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3158 │ No QN57 Yes Column ID │ 7│ 8│ 9│10│ 11│12│
3159 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3160 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3161 │ No Column ID │ 7│ 8│ 9│10│ 11│12│
3162 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3163 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3167 ╭─────────────────────────────────┬─────────────┬──────╮
3169 │ ├──────┬──────┼───┬──┤
3171 │ ├──────┼──────┤ │ │
3172 │ │ QN86 │ QN86 │ │ │
3173 │ ├───┬──┼───┬──┤ │ │
3174 │ │Yes│No│Yes│No│Yes│No│
3175 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3176 │QN61 Yes QN57 Yes Column ID │ 13│14│ 15│16│ 17│18│
3177 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3178 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3179 │ No Column ID │ 13│14│ 15│16│ 17│18│
3180 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3181 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3182 │ No QN57 Yes Column ID │ 19│20│ 21│22│ 23│24│
3183 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3184 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3185 │ No Column ID │ 19│20│ 21│22│ 23│24│
3186 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3187 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3191 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=OPPOSITE])
3192 AT_KEYWORDS([ROWLABELS OPPOSITE])
3193 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3194 AT_DATA([ctables.sps],
3197 /VLABELS VARIABLES=ALL DISPLAY=NAME
3198 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3199 /SLABELS POSITION=ROW
3200 /CLABELS ROWLABELS=OPPOSITE
3201 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3202 /SLABELS POSITION=ROW
3203 /CLABELS ROWLABELS=OPPOSITE
3204 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3205 /SLABELS POSITION=ROW
3206 /CLABELS ROWLABELS=OPPOSITE.
3208 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3211 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3213 │ ├───────────────────────────┬───────────────────────────┤
3215 │ ├───────────────────────────┼───────────────────────────┤
3217 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3218 │ │ Yes │ No │ Yes │ No │
3219 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3220 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3221 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3222 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3223 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3224 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3225 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3226 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3227 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3228 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│ 4│ 4│ 5│ 5│ 6│ 6│ 7│ 7│ 8│ 8│
3229 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3230 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3231 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3232 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│ 4│ 4│ 5│ 5│ 6│ 6│ 7│ 7│ 8│ 8│
3233 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3234 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3235 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3236 │ Subtable ID│ 9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3237 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3238 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3239 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3240 │ Subtable ID│ 9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3241 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3245 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3247 │ ├───────────────────────────┬───────────────────────────┤
3249 │ ├───────────────────────────┼───────────────────────────┤
3251 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3252 │ │ Yes │ No │ Yes │ No │
3253 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3254 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3255 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3256 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3257 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3258 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3259 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3260 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3261 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3262 │ Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3263 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3264 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3265 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3266 │ Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3267 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3268 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3269 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3270 │ Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3271 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3272 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3273 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3274 │ Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3275 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3279 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3281 │ ├───────────────────────────┬───────────────────────────┤
3283 │ ├───────────────────────────┼───────────────────────────┤
3285 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3286 │ │ Yes │ No │ Yes │ No │
3287 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3288 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3289 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3290 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3291 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3292 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3293 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3294 │QN26 Yes QN61 Yes QN57 Row ID │ 1│ 1│ 2│ 2│ 3│ 3│ 4│ 4│ 5│ 5│ 6│ 6│ 7│ 7│ 8│ 8│
3295 │ Layer Row ID│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3296 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3297 │ No QN57 Row ID │ 9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3298 │ Layer Row ID│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3299 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3300 │ No QN61 Yes QN57 Row ID │ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3301 │ Layer Row ID│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3302 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3303 │ No QN57 Row ID │ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3304 │ Layer Row ID│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3305 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3309 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3311 │ ├───────────────────────────┬───────────────────────────┤
3313 │ ├───────────────────────────┼───────────────────────────┤
3315 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3316 │ │ Yes │ No │ Yes │ No │
3317 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3318 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3319 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3320 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3321 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3322 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3323 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3324 │QN26 Yes QN61 Yes QN57 Row ID │ 33│33│ 34│34│ 35│35│ 36│36│ 37│37│ 38│38│ 39│39│ 40│40│
3325 │ Layer Row ID│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│
3326 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3327 │ No QN57 Row ID │ 41│41│ 42│42│ 43│43│ 44│44│ 45│45│ 46│46│ 47│47│ 48│48│
3328 │ Layer Row ID│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│
3329 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3330 │ No QN61 Yes QN57 Row ID │ 49│49│ 50│50│ 51│51│ 52│52│ 53│53│ 54│54│ 55│55│ 56│56│
3331 │ Layer Row ID│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│
3332 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3333 │ No QN57 Row ID │ 57│57│ 58│58│ 59│59│ 60│60│ 61│61│ 62│62│ 63│63│ 64│64│
3334 │ Layer Row ID│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│
3335 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3339 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3341 │ ├───────────────────────────┬───────────────────────────┤
3343 │ ├───────────────────────────┼───────────────────────────┤
3345 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3346 │ │ Yes │ No │ Yes │ No │
3347 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3348 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3349 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3350 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3351 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3352 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3353 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3354 │QN26 Yes QN61 Yes QN57 Column ID │ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3355 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3356 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3357 │ No QN57 Column ID │ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3358 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3359 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3360 │ No QN61 Yes QN57 Column ID │ 18│17│ 19│20│ 22│21│ 23│24│ 25│26│ 27│28│ 29│30│ 32│31│
3361 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3362 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3363 │ No QN57 Column ID │ 18│17│ 19│20│ 22│21│ 23│24│ 25│26│ 27│28│ 29│30│ 32│31│
3364 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3365 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3369 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3371 │ ├───────────────────────────┬───────────────────────────┤
3373 │ ├───────────────────────────┼───────────────────────────┤
3375 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3376 │ │ Yes │ No │ Yes │ No │
3377 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3378 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3379 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3380 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3381 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3382 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3383 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3384 │QN26 Yes QN61 Yes QN57 Column ID │ 33│34│ 36│35│ 37│38│ 39│40│ 42│41│ 44│43│ 45│46│ 47│48│
3385 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3386 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3387 │ No QN57 Column ID │ 33│34│ 36│35│ 37│38│ 39│40│ 42│41│ 44│43│ 45│46│ 47│48│
3388 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3389 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3390 │ No QN61 Yes QN57 Column ID │ 49│50│ 51│52│ 54│53│ 56│55│ 57│58│ 60│59│ 62│61│ 64│63│
3391 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3392 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3393 │ No QN57 Column ID │ 49│50│ 51│52│ 54│53│ 56│55│ 57│58│ 60│59│ 62│61│ 64│63│
3394 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3395 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3399 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=OPPOSITE])
3400 AT_KEYWORDS([COLLABELS OPPOSITE])
3401 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3402 AT_DATA([ctables.sps],
3405 /VLABELS VARIABLES=ALL DISPLAY=NAME
3406 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3407 /SLABELS POSITION=ROW
3408 /CLABELS COLLABELS=OPPOSITE
3409 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3410 /SLABELS POSITION=ROW
3411 /CLABELS COLLABELS=OPPOSITE
3412 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3413 /SLABELS POSITION=ROW
3414 /CLABELS COLLABELS=OPPOSITE.
3416 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3419 ╭──────────────────────────────────────────┬───────────────────╮
3421 │ ├─────────┬─────────┤
3423 │ ├─────────┼─────────┤
3425 │ ├────┬────┼────┬────┤
3426 │ │ Yes│ No │ Yes│ No │
3427 │ ├────┼────┼────┼────┤
3428 │ │QN86│QN86│QN86│QN86│
3429 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3430 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3431 │ Layer ID │ 1│ 1│ 1│ 1│
3432 │ Subtable ID│ 1│ 1│ 2│ 2│
3433 │ ╶───────────────┼────┼────┼────┼────┤
3434 │ No Table ID │ 1│ 1│ 1│ 1│
3435 │ Layer ID │ 1│ 1│ 1│ 1│
3436 │ Subtable ID│ 1│ 1│ 2│ 2│
3437 │ ╶───────────────────┼────┼────┼────┼────┤
3438 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3439 │ Layer ID │ 1│ 1│ 1│ 1│
3440 │ Subtable ID│ 3│ 3│ 4│ 4│
3441 │ ╶───────────────┼────┼────┼────┼────┤
3442 │ No Table ID │ 1│ 1│ 1│ 1│
3443 │ Layer ID │ 1│ 1│ 1│ 1│
3444 │ Subtable ID│ 3│ 3│ 4│ 4│
3445 │ ╶────────────────────────────┼────┼────┼────┼────┤
3446 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3447 │ Layer ID │ 1│ 1│ 1│ 1│
3448 │ Subtable ID│ 5│ 5│ 6│ 6│
3449 │ ╶───────────────┼────┼────┼────┼────┤
3450 │ No Table ID │ 1│ 1│ 1│ 1│
3451 │ Layer ID │ 1│ 1│ 1│ 1│
3452 │ Subtable ID│ 5│ 5│ 6│ 6│
3453 │ ╶───────────────────┼────┼────┼────┼────┤
3454 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3455 │ Layer ID │ 1│ 1│ 1│ 1│
3456 │ Subtable ID│ 7│ 7│ 8│ 8│
3457 │ ╶───────────────┼────┼────┼────┼────┤
3458 │ No Table ID │ 1│ 1│ 1│ 1│
3459 │ Layer ID │ 1│ 1│ 1│ 1│
3460 │ Subtable ID│ 7│ 7│ 8│ 8│
3461 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
3462 │ No QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3463 │ Layer ID │ 1│ 1│ 1│ 1│
3464 │ Subtable ID│ 9│ 9│ 10│ 10│
3465 │ ╶───────────────┼────┼────┼────┼────┤
3466 │ No Table ID │ 1│ 1│ 1│ 1│
3467 │ Layer ID │ 1│ 1│ 1│ 1│
3468 │ Subtable ID│ 9│ 9│ 10│ 10│
3469 │ ╶───────────────────┼────┼────┼────┼────┤
3470 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3471 │ Layer ID │ 1│ 1│ 1│ 1│
3472 │ Subtable ID│ 11│ 11│ 12│ 12│
3473 │ ╶───────────────┼────┼────┼────┼────┤
3474 │ No Table ID │ 1│ 1│ 1│ 1│
3475 │ Layer ID │ 1│ 1│ 1│ 1│
3476 │ Subtable ID│ 11│ 11│ 12│ 12│
3477 │ ╶────────────────────────────┼────┼────┼────┼────┤
3478 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3479 │ Layer ID │ 1│ 1│ 1│ 1│
3480 │ Subtable ID│ 13│ 13│ 14│ 14│
3481 │ ╶───────────────┼────┼────┼────┼────┤
3482 │ No Table ID │ 1│ 1│ 1│ 1│
3483 │ Layer ID │ 1│ 1│ 1│ 1│
3484 │ Subtable ID│ 13│ 13│ 14│ 14│
3485 │ ╶───────────────────┼────┼────┼────┼────┤
3486 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3487 │ Layer ID │ 1│ 1│ 1│ 1│
3488 │ Subtable ID│ 15│ 15│ 16│ 16│
3489 │ ╶───────────────┼────┼────┼────┼────┤
3490 │ No Table ID │ 1│ 1│ 1│ 1│
3491 │ Layer ID │ 1│ 1│ 1│ 1│
3492 │ Subtable ID│ 15│ 15│ 16│ 16│
3493 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3497 ╭──────────────────────────────────────────┬───────────────────╮
3499 │ ├─────────┬─────────┤
3501 │ ├─────────┼─────────┤
3503 │ ├────┬────┼────┬────┤
3504 │ │ Yes│ No │ Yes│ No │
3505 │ ├────┼────┼────┼────┤
3506 │ │QN86│QN86│QN86│QN86│
3507 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3508 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3509 │ Layer ID │ 2│ 2│ 2│ 2│
3510 │ Subtable ID│ 17│ 17│ 18│ 18│
3511 │ ╶───────────────┼────┼────┼────┼────┤
3512 │ No Table ID │ 1│ 1│ 1│ 1│
3513 │ Layer ID │ 2│ 2│ 2│ 2│
3514 │ Subtable ID│ 17│ 17│ 18│ 18│
3515 │ ╶───────────────────┼────┼────┼────┼────┤
3516 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3517 │ Layer ID │ 2│ 2│ 2│ 2│
3518 │ Subtable ID│ 19│ 19│ 20│ 20│
3519 │ ╶───────────────┼────┼────┼────┼────┤
3520 │ No Table ID │ 1│ 1│ 1│ 1│
3521 │ Layer ID │ 2│ 2│ 2│ 2│
3522 │ Subtable ID│ 19│ 19│ 20│ 20│
3523 │ ╶────────────────────────────┼────┼────┼────┼────┤
3524 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3525 │ Layer ID │ 2│ 2│ 2│ 2│
3526 │ Subtable ID│ 21│ 21│ 22│ 22│
3527 │ ╶───────────────┼────┼────┼────┼────┤
3528 │ No Table ID │ 1│ 1│ 1│ 1│
3529 │ Layer ID │ 2│ 2│ 2│ 2│
3530 │ Subtable ID│ 21│ 21│ 22│ 22│
3531 │ ╶───────────────────┼────┼────┼────┼────┤
3532 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3533 │ Layer ID │ 2│ 2│ 2│ 2│
3534 │ Subtable ID│ 23│ 23│ 24│ 24│
3535 │ ╶───────────────┼────┼────┼────┼────┤
3536 │ No Table ID │ 1│ 1│ 1│ 1│
3537 │ Layer ID │ 2│ 2│ 2│ 2│
3538 │ Subtable ID│ 23│ 23│ 24│ 24│
3539 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
3540 │ No QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3541 │ Layer ID │ 2│ 2│ 2│ 2│
3542 │ Subtable ID│ 25│ 25│ 26│ 26│
3543 │ ╶───────────────┼────┼────┼────┼────┤
3544 │ No Table ID │ 1│ 1│ 1│ 1│
3545 │ Layer ID │ 2│ 2│ 2│ 2│
3546 │ Subtable ID│ 25│ 25│ 26│ 26│
3547 │ ╶───────────────────┼────┼────┼────┼────┤
3548 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3549 │ Layer ID │ 2│ 2│ 2│ 2│
3550 │ Subtable ID│ 27│ 27│ 28│ 28│
3551 │ ╶───────────────┼────┼────┼────┼────┤
3552 │ No Table ID │ 1│ 1│ 1│ 1│
3553 │ Layer ID │ 2│ 2│ 2│ 2│
3554 │ Subtable ID│ 27│ 27│ 28│ 28│
3555 │ ╶────────────────────────────┼────┼────┼────┼────┤
3556 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3557 │ Layer ID │ 2│ 2│ 2│ 2│
3558 │ Subtable ID│ 29│ 29│ 30│ 30│
3559 │ ╶───────────────┼────┼────┼────┼────┤
3560 │ No Table ID │ 1│ 1│ 1│ 1│
3561 │ Layer ID │ 2│ 2│ 2│ 2│
3562 │ Subtable ID│ 29│ 29│ 30│ 30│
3563 │ ╶───────────────────┼────┼────┼────┼────┤
3564 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3565 │ Layer ID │ 2│ 2│ 2│ 2│
3566 │ Subtable ID│ 31│ 31│ 32│ 32│
3567 │ ╶───────────────┼────┼────┼────┼────┤
3568 │ No Table ID │ 1│ 1│ 1│ 1│
3569 │ Layer ID │ 2│ 2│ 2│ 2│
3570 │ Subtable ID│ 31│ 31│ 32│ 32│
3571 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3575 ╭───────────────────────────────────────────┬───────────────────╮
3577 │ ├─────────┬─────────┤
3579 │ ├─────────┼─────────┤
3581 │ ├────┬────┼────┬────┤
3582 │ │ Yes│ No │ Yes│ No │
3583 │ ├────┼────┼────┼────┤
3584 │ │QN86│QN86│QN86│QN86│
3585 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3586 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID │ 1│ 1│ 3│ 3│
3587 │ Layer Row ID│ 1│ 1│ 1│ 1│
3588 │ ╶────────────────┼────┼────┼────┼────┤
3589 │ No Row ID │ 2│ 2│ 4│ 4│
3590 │ Layer Row ID│ 2│ 2│ 2│ 2│
3591 │ ╶────────────────────┼────┼────┼────┼────┤
3592 │ No Yes Row ID │ 6│ 6│ 7│ 7│
3593 │ Layer Row ID│ 4│ 4│ 4│ 4│
3594 │ ╶────────────────┼────┼────┼────┼────┤
3595 │ No Row ID │ 5│ 5│ 8│ 8│
3596 │ Layer Row ID│ 3│ 3│ 3│ 3│
3597 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3598 │ No QN57 Yes Yes Row ID │ 10│ 10│ 11│ 11│
3599 │ Layer Row ID│ 6│ 6│ 6│ 6│
3600 │ ╶────────────────┼────┼────┼────┼────┤
3601 │ No Row ID │ 9│ 9│ 12│ 12│
3602 │ Layer Row ID│ 5│ 5│ 5│ 5│
3603 │ ╶────────────────────┼────┼────┼────┼────┤
3604 │ No Yes Row ID │ 13│ 13│ 15│ 15│
3605 │ Layer Row ID│ 7│ 7│ 7│ 7│
3606 │ ╶────────────────┼────┼────┼────┼────┤
3607 │ No Row ID │ 14│ 14│ 16│ 16│
3608 │ Layer Row ID│ 8│ 8│ 8│ 8│
3609 │ ╶──────────────────────────────────────┼────┼────┼────┼────┤
3610 │ No QN61 Yes QN57 Yes Yes Row ID │ 17│ 17│ 20│ 20│
3611 │ Layer Row ID│ 9│ 9│ 9│ 9│
3612 │ ╶────────────────┼────┼────┼────┼────┤
3613 │ No Row ID │ 18│ 18│ 19│ 19│
3614 │ Layer Row ID│ 10│ 10│ 10│ 10│
3615 │ ╶────────────────────┼────┼────┼────┼────┤
3616 │ No Yes Row ID │ 21│ 21│ 24│ 24│
3617 │ Layer Row ID│ 11│ 11│ 11│ 11│
3618 │ ╶────────────────┼────┼────┼────┼────┤
3619 │ No Row ID │ 22│ 22│ 23│ 23│
3620 │ Layer Row ID│ 12│ 12│ 12│ 12│
3621 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3622 │ No QN57 Yes Yes Row ID │ 25│ 25│ 27│ 27│
3623 │ Layer Row ID│ 13│ 13│ 13│ 13│
3624 │ ╶────────────────┼────┼────┼────┼────┤
3625 │ No Row ID │ 26│ 26│ 28│ 28│
3626 │ Layer Row ID│ 14│ 14│ 14│ 14│
3627 │ ╶────────────────────┼────┼────┼────┼────┤
3628 │ No Yes Row ID │ 30│ 30│ 32│ 32│
3629 │ Layer Row ID│ 16│ 16│ 16│ 16│
3630 │ ╶────────────────┼────┼────┼────┼────┤
3631 │ No Row ID │ 29│ 29│ 31│ 31│
3632 │ Layer Row ID│ 15│ 15│ 15│ 15│
3633 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3637 ╭───────────────────────────────────────────┬───────────────────╮
3639 │ ├─────────┬─────────┤
3641 │ ├─────────┼─────────┤
3643 │ ├────┬────┼────┬────┤
3644 │ │ Yes│ No │ Yes│ No │
3645 │ ├────┼────┼────┼────┤
3646 │ │QN86│QN86│QN86│QN86│
3647 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3648 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID │ 34│ 34│ 35│ 35│
3649 │ Layer Row ID│ 18│ 18│ 18│ 18│
3650 │ ╶────────────────┼────┼────┼────┼────┤
3651 │ No Row ID │ 33│ 33│ 36│ 36│
3652 │ Layer Row ID│ 17│ 17│ 17│ 17│
3653 │ ╶────────────────────┼────┼────┼────┼────┤
3654 │ No Yes Row ID │ 38│ 38│ 39│ 39│
3655 │ Layer Row ID│ 20│ 20│ 20│ 20│
3656 │ ╶────────────────┼────┼────┼────┼────┤
3657 │ No Row ID │ 37│ 37│ 40│ 40│
3658 │ Layer Row ID│ 19│ 19│ 19│ 19│
3659 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3660 │ No QN57 Yes Yes Row ID │ 42│ 42│ 43│ 43│
3661 │ Layer Row ID│ 22│ 22│ 22│ 22│
3662 │ ╶────────────────┼────┼────┼────┼────┤
3663 │ No Row ID │ 41│ 41│ 44│ 44│
3664 │ Layer Row ID│ 21│ 21│ 21│ 21│
3665 │ ╶────────────────────┼────┼────┼────┼────┤
3666 │ No Yes Row ID │ 45│ 45│ 47│ 47│
3667 │ Layer Row ID│ 23│ 23│ 23│ 23│
3668 │ ╶────────────────┼────┼────┼────┼────┤
3669 │ No Row ID │ 46│ 46│ 48│ 48│
3670 │ Layer Row ID│ 24│ 24│ 24│ 24│
3671 │ ╶──────────────────────────────────────┼────┼────┼────┼────┤
3672 │ No QN61 Yes QN57 Yes Yes Row ID │ 50│ 50│ 51│ 51│
3673 │ Layer Row ID│ 26│ 26│ 26│ 26│
3674 │ ╶────────────────┼────┼────┼────┼────┤
3675 │ No Row ID │ 49│ 49│ 52│ 52│
3676 │ Layer Row ID│ 25│ 25│ 25│ 25│
3677 │ ╶────────────────────┼────┼────┼────┼────┤
3678 │ No Yes Row ID │ 53│ 53│ 55│ 55│
3679 │ Layer Row ID│ 27│ 27│ 27│ 27│
3680 │ ╶────────────────┼────┼────┼────┼────┤
3681 │ No Row ID │ 54│ 54│ 56│ 56│
3682 │ Layer Row ID│ 28│ 28│ 28│ 28│
3683 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3684 │ No QN57 Yes Yes Row ID │ 57│ 57│ 59│ 59│
3685 │ Layer Row ID│ 29│ 29│ 29│ 29│
3686 │ ╶────────────────┼────┼────┼────┼────┤
3687 │ No Row ID │ 58│ 58│ 60│ 60│
3688 │ Layer Row ID│ 30│ 30│ 30│ 30│
3689 │ ╶────────────────────┼────┼────┼────┼────┤
3690 │ No Yes Row ID │ 62│ 62│ 64│ 64│
3691 │ Layer Row ID│ 32│ 32│ 32│ 32│
3692 │ ╶────────────────┼────┼────┼────┼────┤
3693 │ No Row ID │ 61│ 61│ 63│ 63│
3694 │ Layer Row ID│ 31│ 31│ 31│ 31│
3695 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3699 ╭──────────────────────────────────────────────┬───────────────────╮
3701 │ ├─────────┬─────────┤
3703 │ ├─────────┼─────────┤
3705 │ ├────┬────┼────┬────┤
3706 │ │ Yes│ No │ Yes│ No │
3707 │ ├────┼────┼────┼────┤
3708 │ │QN86│QN86│QN86│QN86│
3709 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3710 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID │ 1│ 2│ 3│ 4│
3711 │ Layer Column ID│ 1│ 2│ 3│ 4│
3712 │ ╶───────────────────┼────┼────┼────┼────┤
3713 │ No Column ID │ 1│ 2│ 3│ 4│
3714 │ Layer Column ID│ 1│ 2│ 3│ 4│
3715 │ ╶───────────────────────┼────┼────┼────┼────┤
3716 │ No Yes Column ID │ 5│ 6│ 7│ 8│
3717 │ Layer Column ID│ 1│ 2│ 3│ 4│
3718 │ ╶───────────────────┼────┼────┼────┼────┤
3719 │ No Column ID │ 5│ 6│ 7│ 8│
3720 │ Layer Column ID│ 1│ 2│ 3│ 4│
3721 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3722 │ No QN57 Yes Yes Column ID │ 9│ 10│ 11│ 12│
3723 │ Layer Column ID│ 1│ 2│ 3│ 4│
3724 │ ╶───────────────────┼────┼────┼────┼────┤
3725 │ No Column ID │ 9│ 10│ 11│ 12│
3726 │ Layer Column ID│ 1│ 2│ 3│ 4│
3727 │ ╶───────────────────────┼────┼────┼────┼────┤
3728 │ No Yes Column ID │ 13│ 14│ 15│ 16│
3729 │ Layer Column ID│ 1│ 2│ 3│ 4│
3730 │ ╶───────────────────┼────┼────┼────┼────┤
3731 │ No Column ID │ 13│ 14│ 15│ 16│
3732 │ Layer Column ID│ 1│ 2│ 3│ 4│
3733 │ ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3734 │ No QN61 Yes QN57 Yes Yes Column ID │ 17│ 18│ 19│ 20│
3735 │ Layer Column ID│ 1│ 2│ 3│ 4│
3736 │ ╶───────────────────┼────┼────┼────┼────┤
3737 │ No Column ID │ 17│ 18│ 19│ 20│
3738 │ Layer Column ID│ 1│ 2│ 3│ 4│
3739 │ ╶───────────────────────┼────┼────┼────┼────┤
3740 │ No Yes Column ID │ 21│ 22│ 23│ 24│
3741 │ Layer Column ID│ 1│ 2│ 3│ 4│
3742 │ ╶───────────────────┼────┼────┼────┼────┤
3743 │ No Column ID │ 21│ 22│ 23│ 24│
3744 │ Layer Column ID│ 1│ 2│ 3│ 4│
3745 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3746 │ No QN57 Yes Yes Column ID │ 25│ 26│ 27│ 28│
3747 │ Layer Column ID│ 1│ 2│ 3│ 4│
3748 │ ╶───────────────────┼────┼────┼────┼────┤
3749 │ No Column ID │ 25│ 26│ 27│ 28│
3750 │ Layer Column ID│ 1│ 2│ 3│ 4│
3751 │ ╶───────────────────────┼────┼────┼────┼────┤
3752 │ No Yes Column ID │ 29│ 30│ 31│ 32│
3753 │ Layer Column ID│ 1│ 2│ 3│ 4│
3754 │ ╶───────────────────┼────┼────┼────┼────┤
3755 │ No Column ID │ 29│ 30│ 31│ 32│
3756 │ Layer Column ID│ 1│ 2│ 3│ 4│
3757 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3761 ╭──────────────────────────────────────────────┬───────────────────╮
3763 │ ├─────────┬─────────┤
3765 │ ├─────────┼─────────┤
3767 │ ├────┬────┼────┬────┤
3768 │ │ Yes│ No │ Yes│ No │
3769 │ ├────┼────┼────┼────┤
3770 │ │QN86│QN86│QN86│QN86│
3771 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3772 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID │ 33│ 34│ 35│ 36│
3773 │ Layer Column ID│ 5│ 6│ 7│ 8│
3774 │ ╶───────────────────┼────┼────┼────┼────┤
3775 │ No Column ID │ 33│ 34│ 35│ 36│
3776 │ Layer Column ID│ 5│ 6│ 7│ 8│
3777 │ ╶───────────────────────┼────┼────┼────┼────┤
3778 │ No Yes Column ID │ 37│ 38│ 39│ 40│
3779 │ Layer Column ID│ 5│ 6│ 7│ 8│
3780 │ ╶───────────────────┼────┼────┼────┼────┤
3781 │ No Column ID │ 37│ 38│ 39│ 40│
3782 │ Layer Column ID│ 5│ 6│ 7│ 8│
3783 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3784 │ No QN57 Yes Yes Column ID │ 41│ 42│ 43│ 44│
3785 │ Layer Column ID│ 5│ 6│ 7│ 8│
3786 │ ╶───────────────────┼────┼────┼────┼────┤
3787 │ No Column ID │ 41│ 42│ 43│ 44│
3788 │ Layer Column ID│ 5│ 6│ 7│ 8│
3789 │ ╶───────────────────────┼────┼────┼────┼────┤
3790 │ No Yes Column ID │ 45│ 46│ 47│ 48│
3791 │ Layer Column ID│ 5│ 6│ 7│ 8│
3792 │ ╶───────────────────┼────┼────┼────┼────┤
3793 │ No Column ID │ 45│ 46│ 47│ 48│
3794 │ Layer Column ID│ 5│ 6│ 7│ 8│
3795 │ ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3796 │ No QN61 Yes QN57 Yes Yes Column ID │ 49│ 50│ 51│ 52│
3797 │ Layer Column ID│ 5│ 6│ 7│ 8│
3798 │ ╶───────────────────┼────┼────┼────┼────┤
3799 │ No Column ID │ 49│ 50│ 51│ 52│
3800 │ Layer Column ID│ 5│ 6│ 7│ 8│
3801 │ ╶───────────────────────┼────┼────┼────┼────┤
3802 │ No Yes Column ID │ 53│ 54│ 55│ 56│
3803 │ Layer Column ID│ 5│ 6│ 7│ 8│
3804 │ ╶───────────────────┼────┼────┼────┼────┤
3805 │ No Column ID │ 53│ 54│ 55│ 56│
3806 │ Layer Column ID│ 5│ 6│ 7│ 8│
3807 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3808 │ No QN57 Yes Yes Column ID │ 57│ 58│ 59│ 60│
3809 │ Layer Column ID│ 5│ 6│ 7│ 8│
3810 │ ╶───────────────────┼────┼────┼────┼────┤
3811 │ No Column ID │ 57│ 58│ 59│ 60│
3812 │ Layer Column ID│ 5│ 6│ 7│ 8│
3813 │ ╶───────────────────────┼────┼────┼────┼────┤
3814 │ No Yes Column ID │ 61│ 62│ 63│ 64│
3815 │ Layer Column ID│ 5│ 6│ 7│ 8│
3816 │ ╶───────────────────┼────┼────┼────┼────┤
3817 │ No Column ID │ 61│ 62│ 63│ 64│
3818 │ Layer Column ID│ 5│ 6│ 7│ 8│
3819 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3823 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=LAYER])
3824 AT_KEYWORDS([ROWLABELS LAYER])
3825 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3826 AT_DATA([ctables.sps],
3829 /VLABELS VARIABLES=ALL DISPLAY=NAME
3830 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3831 /SLABELS POSITION=ROW
3832 /CLABELS ROWLABELS=LAYER
3833 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3834 /SLABELS POSITION=ROW
3835 /CLABELS ROWLABELS=LAYER
3836 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3837 /SLABELS POSITION=ROW
3838 /CLABELS ROWLABELS=LAYER.
3840 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3844 ╭──────────────────────────────────┬───────────────────────────╮
3846 │ ├─────────────┬─────────────┤
3848 │ ├─────────────┼─────────────┤
3850 │ ├──────┬──────┼──────┬──────┤
3851 │ │ Yes │ No │ Yes │ No │
3852 │ ├──────┼──────┼──────┼──────┤
3853 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3854 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3855 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3856 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3857 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3858 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3859 │ Subtable ID│ 2│ 2│ 4│ 4│ 6│ 6│ 7│ 7│
3860 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3861 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3862 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3863 │ Subtable ID│ 2│ 2│ 4│ 4│ 6│ 6│ 7│ 7│
3864 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3865 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3866 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3867 │ Subtable ID│ 10│10│ 12│12│ 13│13│ 15│15│
3868 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3869 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3870 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3871 │ Subtable ID│ 10│10│ 12│12│ 13│13│ 15│15│
3872 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3877 ╭──────────────────────────────────┬───────────────────────────╮
3879 │ ├─────────────┬─────────────┤
3881 │ ├─────────────┼─────────────┤
3883 │ ├──────┬──────┼──────┬──────┤
3884 │ │ Yes │ No │ Yes │ No │
3885 │ ├──────┼──────┼──────┼──────┤
3886 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3887 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3888 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3889 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3890 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3891 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3892 │ Subtable ID│ 1│ 1│ 3│ 3│ 5│ 5│ 8│ 8│
3893 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3894 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3895 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3896 │ Subtable ID│ 1│ 1│ 3│ 3│ 5│ 5│ 8│ 8│
3897 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3898 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3899 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3900 │ Subtable ID│ 9│ 9│ 11│11│ 14│14│ 16│16│
3901 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3902 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3903 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3904 │ Subtable ID│ 9│ 9│ 11│11│ 14│14│ 16│16│
3905 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3910 ╭──────────────────────────────────┬───────────────────────────╮
3912 │ ├─────────────┬─────────────┤
3914 │ ├─────────────┼─────────────┤
3916 │ ├──────┬──────┼──────┬──────┤
3917 │ │ Yes │ No │ Yes │ No │
3918 │ ├──────┼──────┼──────┼──────┤
3919 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3920 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3921 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3922 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3923 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3924 │ Layer ID │ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3925 │ Subtable ID│ 18│18│ 20│20│ 21│21│ 23│23│
3926 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3927 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3928 │ Layer ID │ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3929 │ Subtable ID│ 18│18│ 20│20│ 21│21│ 23│23│
3930 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3931 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3932 │ Layer ID │ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3933 │ Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3934 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3935 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3936 │ Layer ID │ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3937 │ Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3938 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3943 ╭──────────────────────────────────┬───────────────────────────╮
3945 │ ├─────────────┬─────────────┤
3947 │ ├─────────────┼─────────────┤
3949 │ ├──────┬──────┼──────┬──────┤
3950 │ │ Yes │ No │ Yes │ No │
3951 │ ├──────┼──────┼──────┼──────┤
3952 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3953 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3954 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3955 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3956 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3957 │ Layer ID │ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3958 │ Subtable ID│ 17│17│ 19│19│ 22│22│ 24│24│
3959 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3960 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3961 │ Layer ID │ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3962 │ Subtable ID│ 17│17│ 19│19│ 22│22│ 24│24│
3963 │ ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3964 │ No QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3965 │ Layer ID │ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3966 │ Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3967 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3968 │ No QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3969 │ Layer ID │ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3970 │ Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3971 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3976 ╭───────────────────────────────────┬───────────────────────────╮
3978 │ ├─────────────┬─────────────┤
3980 │ ├─────────────┼─────────────┤
3982 │ ├──────┬──────┼──────┬──────┤
3983 │ │ Yes │ No │ Yes │ No │
3984 │ ├──────┼──────┼──────┼──────┤
3985 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3986 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3987 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3988 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3989 │QN26 Yes QN61 Yes QN57 Row ID │ 1│ 1│ 3│ 3│ 6│ 6│ 7│ 7│
3990 │ Layer Row ID│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3991 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3992 │ No QN57 Row ID │ 10│10│ 11│11│ 13│13│ 15│15│
3993 │ Layer Row ID│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3994 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3995 │ No QN61 Yes QN57 Row ID │ 17│17│ 20│20│ 21│21│ 24│24│
3996 │ Layer Row ID│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│
3997 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3998 │ No QN57 Row ID │ 25│25│ 28│28│ 30│30│ 31│31│
3999 │ Layer Row ID│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│
4000 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4005 ╭───────────────────────────────────┬───────────────────────────╮
4007 │ ├─────────────┬─────────────┤
4009 │ ├─────────────┼─────────────┤
4011 │ ├──────┬──────┼──────┬──────┤
4012 │ │ Yes │ No │ Yes │ No │
4013 │ ├──────┼──────┼──────┼──────┤
4014 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4015 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4016 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4017 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4018 │QN26 Yes QN61 Yes QN57 Row ID │ 2│ 2│ 4│ 4│ 5│ 5│ 8│ 8│
4019 │ Layer Row ID│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
4020 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4021 │ No QN57 Row ID │ 9│ 9│ 12│12│ 14│14│ 16│16│
4022 │ Layer Row ID│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
4023 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4024 │ No QN61 Yes QN57 Row ID │ 18│18│ 19│19│ 22│22│ 23│23│
4025 │ Layer Row ID│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│
4026 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4027 │ No QN57 Row ID │ 26│26│ 27│27│ 29│29│ 32│32│
4028 │ Layer Row ID│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│
4029 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4034 ╭───────────────────────────────────┬───────────────────────────╮
4036 │ ├─────────────┬─────────────┤
4038 │ ├─────────────┼─────────────┤
4040 │ ├──────┬──────┼──────┬──────┤
4041 │ │ Yes │ No │ Yes │ No │
4042 │ ├──────┼──────┼──────┼──────┤
4043 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4044 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4045 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4046 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4047 │QN26 Yes QN61 Yes QN57 Row ID │ 34│34│ 36│36│ 38│38│ 39│39│
4048 │ Layer Row ID│ 10│10│ 10│10│ 10│10│ 10│10│
4049 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4050 │ No QN57 Row ID │ 41│41│ 43│43│ 46│46│ 47│47│
4051 │ Layer Row ID│ 11│11│ 11│11│ 11│11│ 11│11│
4052 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4053 │ No QN61 Yes QN57 Row ID │ 50│50│ 51│51│ 53│53│ 56│56│
4054 │ Layer Row ID│ 14│14│ 14│14│ 14│14│ 14│14│
4055 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4056 │ No QN57 Row ID │ 58│58│ 59│59│ 62│62│ 63│63│
4057 │ Layer Row ID│ 16│16│ 16│16│ 16│16│ 16│16│
4058 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4063 ╭───────────────────────────────────┬───────────────────────────╮
4065 │ ├─────────────┬─────────────┤
4067 │ ├─────────────┼─────────────┤
4069 │ ├──────┬──────┼──────┬──────┤
4070 │ │ Yes │ No │ Yes │ No │
4071 │ ├──────┼──────┼──────┼──────┤
4072 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4073 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4074 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4075 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4076 │QN26 Yes QN61 Yes QN57 Row ID │ 33│33│ 35│35│ 37│37│ 40│40│
4077 │ Layer Row ID│ 9│ 9│ 9│ 9│ 9│ 9│ 9│ 9│
4078 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4079 │ No QN57 Row ID │ 42│42│ 44│44│ 45│45│ 48│48│
4080 │ Layer Row ID│ 12│12│ 12│12│ 12│12│ 12│12│
4081 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4082 │ No QN61 Yes QN57 Row ID │ 49│49│ 52│52│ 54│54│ 55│55│
4083 │ Layer Row ID│ 13│13│ 13│13│ 13│13│ 13│13│
4084 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4085 │ No QN57 Row ID │ 57│57│ 60│60│ 61│61│ 64│64│
4086 │ Layer Row ID│ 15│15│ 15│15│ 15│15│ 15│15│
4087 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4092 ╭──────────────────────────────────────┬───────────────────────────╮
4094 │ ├─────────────┬─────────────┤
4096 │ ├─────────────┼─────────────┤
4098 │ ├──────┬──────┼──────┬──────┤
4099 │ │ Yes │ No │ Yes │ No │
4100 │ ├──────┼──────┼──────┼──────┤
4101 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4102 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4103 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4104 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4105 │QN26 Yes QN61 Yes QN57 Column ID │ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4106 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4107 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4108 │ No QN57 Column ID │ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4109 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4110 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4111 │ No QN61 Yes QN57 Column ID │ 18│19│ 22│23│ 25│27│ 29│32│
4112 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4113 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4114 │ No QN57 Column ID │ 18│19│ 22│23│ 25│27│ 29│32│
4115 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4116 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4121 ╭──────────────────────────────────────┬───────────────────────────╮
4123 │ ├─────────────┬─────────────┤
4125 │ ├─────────────┼─────────────┤
4127 │ ├──────┬──────┼──────┬──────┤
4128 │ │ Yes │ No │ Yes │ No │
4129 │ ├──────┼──────┼──────┼──────┤
4130 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4131 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4132 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4133 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4134 │QN26 Yes QN61 Yes QN57 Column ID │ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4135 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4136 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4137 │ No QN57 Column ID │ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4138 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4139 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4140 │ No QN61 Yes QN57 Column ID │ 17│20│ 21│24│ 26│28│ 30│31│
4141 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4142 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4143 │ No QN57 Column ID │ 17│20│ 21│24│ 26│28│ 30│31│
4144 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4145 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4150 ╭──────────────────────────────────────┬───────────────────────────╮
4152 │ ├─────────────┬─────────────┤
4154 │ ├─────────────┼─────────────┤
4156 │ ├──────┬──────┼──────┬──────┤
4157 │ │ Yes │ No │ Yes │ No │
4158 │ ├──────┼──────┼──────┼──────┤
4159 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4160 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4161 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4162 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4163 │QN26 Yes QN61 Yes QN57 Column ID │ 33│36│ 37│39│ 42│44│ 45│47│
4164 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4165 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4166 │ No QN57 Column ID │ 33│36│ 37│39│ 42│44│ 45│47│
4167 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4168 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4169 │ No QN61 Yes QN57 Column ID │ 49│51│ 54│56│ 57│60│ 62│64│
4170 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4171 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4172 │ No QN57 Column ID │ 49│51│ 54│56│ 57│60│ 62│64│
4173 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4174 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4179 ╭──────────────────────────────────────┬───────────────────────────╮
4181 │ ├─────────────┬─────────────┤
4183 │ ├─────────────┼─────────────┤
4185 │ ├──────┬──────┼──────┬──────┤
4186 │ │ Yes │ No │ Yes │ No │
4187 │ ├──────┼──────┼──────┼──────┤
4188 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4189 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4190 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4191 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4192 │QN26 Yes QN61 Yes QN57 Column ID │ 34│35│ 38│40│ 41│43│ 46│48│
4193 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4194 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4195 │ No QN57 Column ID │ 34│35│ 38│40│ 41│43│ 46│48│
4196 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4197 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4198 │ No QN61 Yes QN57 Column ID │ 50│52│ 53│55│ 58│59│ 61│63│
4199 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4200 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4201 │ No QN57 Column ID │ 50│52│ 53│55│ 58│59│ 61│63│
4202 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4203 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4207 AT_SETUP([CTABLES categorical summary functions])
4208 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4209 AT_DATA([ctables.sps],
4212 /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
4213 /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
4214 /SLABELS POSITION=ROW.
4216 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4218 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
4219 │ │ D5a. What would you say is your primary ethnic background? │
4220 │ ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
4221 │ │ │ │ │ │ │ │ │ Multiple - │ │ │ │
4222 │ │ │ │ │ South │ Central │ Puerto │ Something│ cannot choose│ Don't│ │ │
4223 │ │Cuban│Mexican│Spanish│ American │ American │Rican, OR│ else │ one │ know │Refused│Total│
4224 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4225 │Region NE Count │ 6│ 8│ 8│ 11│ 7│ 39│ 23│ 2│ 0│ 1│ 105│
4226 │ Row % │ 5.7%│ 7.6%│ 7.6%│ 10.5%│ 6.7%│ 37.1%│ 21.9%│ 1.9%│ .0%│ 1.0%│ │
4227 │ Row │ 5.8%│ 7.7%│ 7.7%│ 10.6%│ 6.7%│ 37.5%│ 22.1%│ 1.9%│ .0%│ .0%│ │
4228 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4229 │ % │ │ │ │ │ │ │ │ │ │ │ │
4230 │ Row │ .4%│ .6%│ .6%│ .8%│ .5%│ 2.8%│ 1.6%│ .1%│ .0%│ .1%│ │
4231 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4232 │ % │ │ │ │ │ │ │ │ │ │ │ │
4233 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 104│
4234 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1409│
4235 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4236 │ MW Count │ 3│ 24│ 1│ 4│ 5│ 9│ 6│ 0│ 0│ 1│ 53│
4237 │ Row % │ 5.7%│ 45.3%│ 1.9%│ 7.5%│ 9.4%│ 17.0%│ 11.3%│ .0%│ .0%│ 1.9%│ │
4238 │ Row │ 5.8%│ 46.2%│ 1.9%│ 7.7%│ 9.6%│ 17.3%│ 11.5%│ .0%│ .0%│ .0%│ │
4239 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4240 │ % │ │ │ │ │ │ │ │ │ │ │ │
4241 │ Row │ .2%│ 1.5%│ .1%│ .2%│ .3%│ .5%│ .4%│ .0%│ .0%│ .1%│ │
4242 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4243 │ % │ │ │ │ │ │ │ │ │ │ │ │
4244 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 52│
4245 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1654│
4246 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4247 │ S Count │ 10│ 113│ 11│ 14│ 25│ 23│ 20│ 2│ 3│ 2│ 223│
4248 │ Row % │ 4.5%│ 50.7%│ 4.9%│ 6.3%│ 11.2%│ 10.3%│ 9.0%│ .9%│ 1.3%│ .9%│ │
4249 │ Row │ 4.6%│ 51.8%│ 5.0%│ 6.4%│ 11.5%│ 10.6%│ 9.2%│ .9%│ .0%│ .0%│ │
4250 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4251 │ % │ │ │ │ │ │ │ │ │ │ │ │
4252 │ Row │ .4%│ 4.7%│ .5%│ .6%│ 1.0%│ 1.0%│ .8%│ .1%│ .1%│ .1%│ │
4253 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4254 │ % │ │ │ │ │ │ │ │ │ │ │ │
4255 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 218│
4256 │ Total N│ │ │ │ │ │ │ │ │ │ │ 2390│
4257 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4258 │ W Count │ 1│ 166│ 28│ 5│ 15│ 7│ 19│ 3│ 0│ 1│ 245│
4259 │ Row % │ .4%│ 67.8%│ 11.4%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .4%│ │
4260 │ Row │ .4%│ 68.0%│ 11.5%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .0%│ │
4261 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4262 │ % │ │ │ │ │ │ │ │ │ │ │ │
4263 │ Row │ .1%│ 10.7%│ 1.8%│ .3%│ 1.0%│ .5%│ 1.2%│ .2%│ .0%│ .1%│ │
4264 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4265 │ % │ │ │ │ │ │ │ │ │ │ │ │
4266 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 244│
4267 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1546│
4268 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
4272 AT_SETUP([CTABLES scale summary functions])
4273 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4274 AT_DATA([ctables.sps],
4278 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4279 CTABLES later, to make the results easier to verify.
4280 SPLIT FILE BY REGION.
4283 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4284 /FORMAT NOTABLE /MISSING=INCLUDE.
4288 /VLABELS VARIABLE=qn19a DISPLAY=NAME /*XXX NONE yields an assertion failure
4289 /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, COLPCT.SUM]
4290 /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
4291 /SLABELS POSITION=ROW.
4293 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4295 ╭────────────────┬────────╮
4297 ├────────────────┼────────┤
4300 │ ╶─────────┼────────┤
4302 │ ╶─────────┼────────┤
4304 │ ╶─────────┼────────┤
4306 │ ╶─────────┼────────┤
4308 │ ╶─────────┼────────┤
4310 │ ╶─────────┼────────┤
4312 │ ╶─────────┼────────┤
4314 │ ╶─────────┼────────┤
4316 │ ╶─────────┼────────┤
4318 │ ╶─────────┼────────┤
4320 ├────────────────┼────────┤
4323 │ ╶─────────┼────────┤
4325 │ ╶─────────┼────────┤
4327 │ ╶─────────┼────────┤
4329 │ ╶─────────┼────────┤
4331 │ ╶─────────┼────────┤
4333 │ ╶─────────┼────────┤
4335 │ ╶─────────┼────────┤
4337 │ ╶─────────┼────────┤
4339 │ ╶─────────┼────────┤
4341 │ ╶─────────┼────────┤
4343 ├────────────────┼────────┤
4346 │ ╶─────────┼────────┤
4348 │ ╶─────────┼────────┤
4350 │ ╶─────────┼────────┤
4352 │ ╶─────────┼────────┤
4354 │ ╶─────────┼────────┤
4356 │ ╶─────────┼────────┤
4358 │ ╶─────────┼────────┤
4360 │ ╶─────────┼────────┤
4362 │ ╶─────────┼────────┤
4364 │ ╶─────────┼────────┤
4366 ├────────────────┼────────┤
4369 │ ╶─────────┼────────┤
4371 │ ╶─────────┼────────┤
4373 │ ╶─────────┼────────┤
4375 │ ╶─────────┼────────┤
4377 │ ╶─────────┼────────┤
4379 │ ╶─────────┼────────┤
4381 │ ╶─────────┼────────┤
4383 │ ╶─────────┼────────┤
4385 │ ╶─────────┼────────┤
4387 │ ╶─────────┼────────┤
4389 ╰────────────────┴────────╯
4392 ╭───────────────────────────┬────────╮
4394 ├───────────────────────────┼────────┤
4395 │REGION NE Valid N │ 936│
4398 │ Std Error of Mean│ .14│
4401 │ Std Deviation │ 4.41│
4409 │ Column Sum % │ 21.8%│
4410 │ ╶────────────────────┼────────┤
4411 │ MW Valid N │ 1019│
4414 │ Std Error of Mean│ .16│
4417 │ Std Deviation │ 5.15│
4425 │ Column Sum % │ 24.3%│
4426 │ ╶────────────────────┼────────┤
4428 │ Missing │ 1114.00│
4430 │ Std Error of Mean│ .18│
4433 │ Std Deviation │ 6.44│
4441 │ Column Sum % │ 31.2%│
4442 │ ╶────────────────────┼────────┤
4446 │ Std Error of Mean│ .17│
4449 │ Std Deviation │ 5.25│
4457 │ Column Sum % │ 22.7%│
4458 ╰───────────────────────────┴────────╯
4463 AT_SETUP([CTABLES hidden scale VLABELS])
4464 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4465 AT_DATA([ctables.sps],
4468 /TABLE region BY qn19a + qn35
4469 /SLABELS POSITION=ROW.
4471 /VLABELS VARIABLE=qn19a DISPLAY=NONE
4472 /TABLE region BY qn19a + qn35
4473 /SLABELS POSITION=ROW.
4475 /VLABELS VARIABLE=qn35 DISPLAY=NONE
4476 /TABLE region BY qn19a + qn35
4477 /SLABELS POSITION=ROW.
4479 * This one in particular caused a crash because no categories were
4480 created on the column axis, so passing in 0 for the index was still
4481 too big for that number of categories. It was fixed by creating a
4482 name-only category for each variable despite the "NONE" request,
4483 then hiding the entire dimension's labels if all its labels were
4486 /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
4487 /TABLE region BY qn19a + qn35
4488 /SLABELS POSITION=ROW.
4490 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
4492 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
4493 │ │ 19a. About how old were you│ 35. In the past thirty days, how│
4494 │ │ when you first starting │ many times have you driven a │
4495 │ │ drinking alcohol, not │ motor vehicle WITHIN TWO HOURS │
4496 │ │ counting small tastes or │ AFTER drinking alcoholic │
4497 │ │ sips of alcohol. │ beverages? │
4498 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
4499 │Region NE Mean│ 19.33│ 2│
4500 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
4501 │ MW Mean│ 19.83│ 2│
4502 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
4504 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
4506 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
4509 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
4510 │ │ │ 35. In the past thirty days, how many times have you │
4511 │ │ │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
4512 │ │QN19A│ alcoholic beverages? │
4513 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
4514 │Region NE Mean│19.33│ 2│
4515 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
4517 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
4519 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
4521 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
4524 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
4525 │ │ 19a. About how old were you when you first starting │ │
4526 │ │ drinking alcohol, not counting small tastes or sips of │ │
4528 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
4529 │Region NE Mean│ 19.33│ 2│
4530 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
4531 │ MW Mean│ 19.83│ 2│
4532 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
4534 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
4536 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
4539 ╭──────────────┬───────╮
4540 │Region NE Mean│19.33 2│
4547 ╰──────────────┴───────╯
4551 AT_SETUP([CTABLES with SPLIT FILE])
4552 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4553 AT_DATA([ctables.sps],
4556 SORT CASES BY qns3a.
4558 CTABLES /TABLE qn105ba.
4560 * Layered split has no effect on output.
4561 SPLIT FILE BY qns3a.
4562 CTABLES /TABLE qn105ba.
4564 * Add column variable qns3a to compare against separate splits.
4565 CTABLES /TABLE qn105ba BY qns3a.
4567 * Separate splits are truly output separately.
4568 SPLIT FILE SEPARATE BY qns3a.
4569 CTABLES /TABLE qn105ba.
4571 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
4573 ╭────────────────────────────────────────────────────────────────────────┬─────╮
4575 ├────────────────────────────────────────────────────────────────────────┼─────┤
4576 │105b. How likely is it that drivers who have had too much Almost │ 700│
4577 │to drink to drive safely will A. Get stopped by the police? certain │ │
4578 │ Very likely │ 1502│
4585 ╰────────────────────────────────────────────────────────────────────────┴─────╯
4588 ╭────────────────────────────────────────────────────────────────────────┬─────╮
4590 ├────────────────────────────────────────────────────────────────────────┼─────┤
4591 │105b. How likely is it that drivers who have had too much Almost │ 700│
4592 │to drink to drive safely will A. Get stopped by the police? certain │ │
4593 │ Very likely │ 1502│
4600 ╰────────────────────────────────────────────────────────────────────────┴─────╯
4603 ╭─────────────────────────────────────────────────────────────────┬────────────╮
4609 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
4610 │105b. How likely is it that drivers who have had too Almost │ 297│ 403│
4611 │much to drink to drive safely will A. Get stopped by certain │ │ │
4612 │the police? Very likely │ 660│ 842│
4613 │ Somewhat │ 1174│ 1589│
4615 │ Somewhat │ 640│ 667│
4619 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
4622 ╭────────────┬─────╮
4624 ├────────────┼─────┤
4625 │S3a. GENDER:│Male │
4626 ╰────────────┴─────╯
4629 ╭────────────────────────────────────────────────────────────────────────┬─────╮
4631 ├────────────────────────────────────────────────────────────────────────┼─────┤
4632 │105b. How likely is it that drivers who have had too much Almost │ 297│
4633 │to drink to drive safely will A. Get stopped by the police? certain │ │
4634 │ Very likely │ 660│
4641 ╰────────────────────────────────────────────────────────────────────────┴─────╯
4644 ╭────────────┬──────╮
4646 ├────────────┼──────┤
4647 │S3a. GENDER:│Female│
4648 ╰────────────┴──────╯
4651 ╭────────────────────────────────────────────────────────────────────────┬─────╮
4653 ├────────────────────────────────────────────────────────────────────────┼─────┤
4654 │105b. How likely is it that drivers who have had too much Almost │ 403│
4655 │to drink to drive safely will A. Get stopped by the police? certain │ │
4656 │ Very likely │ 842│
4663 ╰────────────────────────────────────────────────────────────────────────┴─────╯
4667 AT_SETUP([CTABLES variable level inference])
4668 AT_DATA([data.txt], [dnl
4669 dnl n1 has 10 unique small values -> nominal.
4670 dnl n2 has 23 unique small values -> nominal.
4671 dnl n3 is all missing -> nominal.
4672 dnl s1 has 24 unique small values -> scale.
4673 dnl s2 has one negative value -> scale.
4674 dnl s3 has one non-integer value -> scale.
4675 dnl s4 has no valid values less than 10 -> scale.
4676 dnl s5 has no valid values less than 10,000 -> scale.
4677 1 1 . 1 1 1 10 10001
4678 2 2 . 2 2 2 11 10002
4679 3 3 . 3 3 3 12 10003
4680 4 4 . 4 4 4 13 10004
4681 5 5 . 5 5 5 14 10005
4682 6 6 . 6 6 6 15 10006
4683 7 7 . 7 7 7 16 10007
4684 8 8 . 8 8 8 17 10008
4685 9 9 . 9 9 9 18 10009
4686 10 10 . 10 10 10.5 19 110000
4687 1 11 . 11 -1 1 11 10001
4688 2 12 . 12 2 2 12 10002
4689 3 13 . 13 3 3 13 10003
4690 4 14 . 14 4 4 14 10004
4691 5 15 . 15 5 5 15 10005
4692 6 16 . 16 6 6 16 10006
4693 7 17 . 17 7 7 17 10007
4694 8 18 . 18 8 8 18 10008
4695 9 19 . 19 9 9 19 10009
4696 1 20 . 20 1 1 20 10001
4697 2 21 . 21 2 2 21 10002
4698 3 22 . 22 3 3 22 10003
4699 4 23 . 23 4 4 23 10004
4700 5 23 . 24 5 5 24 10005
4701 6 23 . 24 6 6 25 10006
4704 AT_DATA([ctables.sps], [dnl
4705 DATA LIST LIST file='data.txt' NOTABLE /n1 to n3 s1 to s5.
4707 * Nominal formats (copied from data that will default to scale).
4710 FORMATS n4(WKDAY5) n5(MONTH5).
4712 * Scale formats (copied from data that will default to nominal).
4716 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
4721 CTABLES /TABLE n1 + n2 + n3 + string + s1 + s2 + s3 + s4 + s5.
4725 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
4727 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
4728 │ │ │ Measurement │ │ │ │ │ │
4729 │Name │Position│ Level │ Role│Width│Alignment│Print Format│Write Format│
4730 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
4731 │n1 │ 1│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4732 │n2 │ 2│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4733 │n3 │ 3│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4734 │s1 │ 4│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4735 │s2 │ 5│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4736 │s3 │ 6│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4737 │s4 │ 7│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4738 │s5 │ 8│Unknown │Input│ 8│Right │F8.2 │F8.2 │
4739 │n4 │ 9│Unknown │Input│ 8│Right │WKDAY5 │WKDAY5 │
4740 │n5 │ 10│Unknown │Input│ 8│Right │MONTH5 │MONTH5 │
4741 │s6 │ 11│Unknown │Input│ 8│Right │DOLLAR6.2 │DOLLAR6.2 │
4742 │s7 │ 12│Unknown │Input│ 8│Right │CCA8.2 │CCA8.2 │
4743 │s8 │ 13│Unknown │Input│ 8│Right │DATETIME17.0│DATETIME17.0│
4744 │string│ 14│Nominal │Input│ 8│Left │A8 │A8 │
4745 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
4748 ╭────────────┬─────┬────────╮
4750 ├────────────┼─────┼────────┤
4761 ├────────────┼─────┼────────┤
4785 ├────────────┼─────┼────────┤
4787 ├────────────┼─────┼────────┤
4789 ├────────────┼─────┼────────┤
4791 ├────────────┼─────┼────────┤
4793 ├────────────┼─────┼────────┤
4795 ├────────────┼─────┼────────┤
4797 ╰────────────┴─────┴────────╯
4800 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
4801 │ │ │ Measurement │ │ │ │ │ │
4802 │Name │Position│ Level │ Role│Width│Alignment│Print Format│Write Format│
4803 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
4804 │n1 │ 1│Nominal │Input│ 8│Right │F8.2 │F8.2 │
4805 │n2 │ 2│Nominal │Input│ 8│Right │F8.2 │F8.2 │
4806 │n3 │ 3│Nominal │Input│ 8│Right │F8.2 │F8.2 │
4807 │s1 │ 4│Scale │Input│ 8│Right │F8.2 │F8.2 │
4808 │s2 │ 5│Scale │Input│ 8│Right │F8.2 │F8.2 │
4809 │s3 │ 6│Scale │Input│ 8│Right │F8.2 │F8.2 │
4810 │s4 │ 7│Scale │Input│ 8│Right │F8.2 │F8.2 │
4811 │s5 │ 8│Scale │Input│ 8│Right │F8.2 │F8.2 │
4812 │n4 │ 9│Nominal │Input│ 8│Right │WKDAY5 │WKDAY5 │
4813 │n5 │ 10│Nominal │Input│ 8│Right │MONTH5 │MONTH5 │
4814 │s6 │ 11│Scale │Input│ 8│Right │DOLLAR6.2 │DOLLAR6.2 │
4815 │s7 │ 12│Scale │Input│ 8│Right │CCA8.2 │CCA8.2 │
4816 │s8 │ 13│Scale │Input│ 8│Right │DATETIME17.0│DATETIME17.0│
4817 │string│ 14│Nominal │Input│ 8│Left │A8 │A8 │
4818 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯