3 dnl Features not yet tested:
4 dnl - Summary functions:
5 dnl * WEIGHT and adjustment weights.
6 dnl * details of missing value handling in summaries.
9 dnl - Multiple response sets
10 dnl - MRSETS subcommand.
11 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
14 dnl - Summary functions:
15 dnl * .LCL and .UCL suffixes.
17 dnl - Summary functions:
18 dnl * )CILEVEL in summary label specification
20 dnl * Data-dependent sorting.
22 AT_SETUP([CTABLES parsing])
23 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
24 AT_DATA([ctables.sps],
27 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
28 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
29 /FORMAT UNITS=CM EMPTY="(-)"
30 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
31 /VLABELS VARIABLES=qn17 DISPLAY=NAME
32 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
33 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
34 /VLABELS VARIABLES=qn20 DISPLAY=NONE
35 /MRSETS COUNTDUPLICATES=NO
36 /MRSETS COUNTDUPLICATES=YES
39 /WEIGHT VARIABLE=qns3a
41 /HIDESMALLCOUNTS COUNT=10
43 /SLABELS POSITION=COLUMN VISIBLE=YES
44 /SLABELS VISIBLE=NO POSITION=ROW
45 /SLABELS POSITION=LAYER
47 /CLABELS ROWLABELS=OPPOSITE
49 /CATEGORIES VARIABLES=qn1 qn17
50 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
51 POSITION=BEFORE EMPTY=INCLUDE.
52 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
53 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
54 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
56 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
59 ╭───────────────────┬────┬────╮
61 ├───────────────────┼────┼────┤
62 │Sa1. SAMPLE SOURCE:│5392│1607│
63 ╰───────────────────┴────┴────╯
67 ╭───────────────────┬─────╮
69 ├───────────────────┼─────┤
70 │Sa1. SAMPLE SOURCE:│ 5392│
71 ╰───────────────────┴─────╯
74 ╭────────────────────────┬─────╮
76 ├────────────────────────┼─────┤
77 │Sa1. SAMPLE SOURCE: RDD │ 5392│
79 ╰────────────────────────┴─────╯
82 ╭────────────────────────┬─────╮
84 ├────────────────────────┼─────┤
85 │Sa1. SAMPLE SOURCE: RDD │ 5392│
87 ╰────────────────────────┴─────╯
91 AT_SETUP([CTABLES parsing - negative])
92 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
93 AT_DATA([ctables.sps],
96 CTABLES /FORMAT MINCOLWIDTH='foo'.
97 CTABLES /TABLE qn1 [**].
98 CTABLES /TABLE qn1 [NOTAFUNCTION].
101 CTABLES /TABLE NOTAVAR.
103 CTABLES /TABLE string[S].
104 CTABLES /TABLE qn1 [PTILE 101].
105 CTABLES /TABLE qn1 [MEAN F0.1].
106 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
107 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
108 CTABLES /TABLE qn1 [MEAN TOTALS].
109 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
110 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
111 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
112 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
113 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
114 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
115 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
116 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
117 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
118 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
119 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
120 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
121 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
122 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
123 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
124 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
125 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
127 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
128 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
129 CTABLES /PCOMPUTE &k=EXPR([LO **]).
130 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
131 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
132 CTABLES /PCOMPUTE &k=EXPR([1**]).
133 CTABLES /PCOMPUTE &k=EXPR((1x)).
134 CTABLES /PCOMPUTE **k.
135 CTABLES /PCOMPUTE &1.
136 CTABLES /PCOMPUTE &k**.
137 CTABLES /PCOMPUTE &k=**.
138 CTABLES /PCOMPUTE &k=EXPR**.
139 CTABLES /PCOMPUTE &k=EXPR(1x).
140 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
141 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
142 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
143 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
144 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
145 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
146 CTABLES /FORMAT EMPTY=**.
147 CTABLES /FORMAT MISSING=**.
149 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
151 CTABLES /VLABELS VARIABLES=NOTAVAR.
152 CTABLES /VLABELS VARIABLES=qn1 **.
153 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
155 CTABLES /MRSETS COUNTDUPLICATES=**.
156 CTABLES /SMISSING **.
158 CTABLES /WEIGHT VARIABLE=NOTAVAR.
159 CTABLES /HIDESMALLCOUNTS COUNT=1.
161 CTABLES /HIDESMALLCOUNTS COUNT=2.
162 CTABLES /TABLE qn1**.
163 CTABLES /TABLE qn1 /SLABELS POSITION=**.
164 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
165 CTABLES /TABLE qn1 /SLABELS **.
166 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
167 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
168 CTABLES /TABLE qn1 /CLABELS **.
169 CTABLES /TABLE qn1 /CRITERIA **.
170 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
171 CTABLES /TABLE qn1 /TITLES **.
172 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
173 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
174 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
175 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
176 CTABLES /TABLE qn1 /SIGTEST **.
177 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
178 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
179 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
180 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
181 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
182 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
183 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
184 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
185 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
186 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
187 CTABLES /TABLE qn1 /COMPARETEST **.
188 CTABLES /TABLE qn1 / **.
189 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
190 CTABLES /TABLE qn20 > qnd1.
191 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
192 NUMERIC datetime (DATETIME17.0).
193 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
195 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
196 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
198 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
199 negative number for MINCOLWIDTH.
201 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
204 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
205 summary function name.
207 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
209 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
212 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
214 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
216 10 | CTABLES /TABLE string[S].
219 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
220 between 0 and 100 for PTILE.
222 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
223 requires a width between 1 and 40.
225 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
226 format NEGPAREN requires width 2 or greater.
228 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
229 format NEGPAREN requires width greater than decimals.
231 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
233 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
236 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
237 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
240 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
242 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
244 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
247 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
248 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
251 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
253 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
255 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
257 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
259 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
261 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
263 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
266 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
267 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
270 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
271 between 0 and 100 for PTILE.
273 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
276 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
279 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
282 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
285 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
287 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
290 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
293 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
294 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
296 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
297 LABEL, POSITION, or EMPTY.
299 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
300 integer for SUBTOTAL.
302 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
304 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
306 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
308 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
310 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
312 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
314 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
316 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
318 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
320 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
322 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
324 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
326 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
327 the previous definition.
328 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
329 | ^~~~~~~~~~~~~~~~~~~
331 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
332 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
333 | ^~~~~~~~~~~~~~~~~~~
335 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
338 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
339 Expecting summary function name.
341 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
342 between 0 and 100 for PTILE.
344 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
346 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
349 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
350 FORMAT, or HIDESOURCECATS.
352 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
354 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
356 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
357 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
359 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
362 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
365 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
367 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
370 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
371 DEFAULT, NAME, LABEL, BOTH, or NONE.
373 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
376 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
379 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
380 VARIABLE or LISTWISE.
382 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
385 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
387 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
388 greater for HIDESMALLCOUNTS COUNT.
390 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
391 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
392 HIDESMALLCOUNTS, or TABLE.
394 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
397 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
399 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
402 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
405 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
408 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
411 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
414 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
415 ROWLABELS, or COLLABELS.
417 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
420 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
421 in @<:@0,100@:}@ for CILEVEL.
423 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
424 CAPTION, CORNER, or TITLE.
426 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
429 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
430 in @<:@0,1@:}@ for ALPHA.
432 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
435 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
436 ALLVISIBLE or SUBTOTALS.
438 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
439 ALPHA, INCLUDEMRSETS, or CATEGORIES.
441 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
444 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
447 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
450 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
451 BONFERRONI, BH, or NONE.
453 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
456 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
459 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
460 ALLVISIBLE or SUBTOTALS.
462 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
465 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
468 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
471 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
472 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
475 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
476 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
478 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
481 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
482 97 | CTABLES /TABLE qn20 > qnd1.
485 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
486 97 | CTABLES /TABLE qn20 > qnd1.
489 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
490 97 | CTABLES /TABLE qn20 > qnd1.
493 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
494 categorical variables at the innermost nesting level.
495 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
496 | ^~~~~~~~~~~~~~~~~~~~
498 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
500 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
503 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
504 specification as format DATETIME: Day (123) must be between 1 and 31..
505 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
510 AT_SETUP([CTABLES parsing - more negative])
511 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
512 AT_DATA([ctables.sps],
514 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
515 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
516 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
519 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
520 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
522 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
524 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
525 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
526 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
527 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
529 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
530 CTABLES /PCOMPUTE &x=EXPR([**]).
531 CTABLES /PCOMPUTE &x=EXPR(**).
535 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
537 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
538 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
539 category not included in the category list.
540 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
545 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
546 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
550 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
551 list of categories here.
552 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
557 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
558 category not included in the category list.
559 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
564 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
565 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
569 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
570 variable's CATEGORIES specification.
572 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
573 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
574 subtotals by position, e.g. SUBTOTAL[1].
575 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
576 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
578 ^~~~~~~~~~~~~~~~~~~~~~~~
580 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
582 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
583 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
586 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
587 applied only to string variables, but this subcommand tries to apply it to
588 numeric variable QN1.
589 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
592 ctables.sps:8.53: error: CTABLES: This category specification may be applied
593 only to numeric variables, but this subcommand tries to apply it to string
595 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
598 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
599 based on a summary function.
601 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
602 moved to be categorical, but qnd1 is a scale variable.
604 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
605 moved to have the same width, but QN1 has width 0 and string has width 8.
607 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
608 moved to have the same value labels, but QN1 and QNSA1 have different value
611 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
612 moved to have the same category specifications, but QN105BA and QN105BB have
613 different category specifications.
615 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
616 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
617 this warning, insert parentheses.
618 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
621 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
624 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
626 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
628 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
629 variable must be specified.
631 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
633 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
635 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
638 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
640 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
643 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
645 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
648 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
649 has a summary even if the syntax does not explicitly specify one.
650 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
655 AT_SETUP([CTABLES one categorical variable])
656 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
657 AT_DATA([ctables.sps],
660 CTABLES /TABLE BY qn1.
661 CTABLES /TABLE BY BY qn1.
663 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
665 ╭────────────────────────────────────────────────────────────────────────┬─────╮
667 ├────────────────────────────────────────────────────────────────────────┼─────┤
668 │ 1. How often do you usually drive a car or other Every day │ 4667│
669 │motor vehicle? Several days a week │ 1274│
670 │ Once a week or less │ 361│
671 │ Only certain times a │ 130│
674 ╰────────────────────────────────────────────────────────────────────────┴─────╯
677 ╭──────────────────────────────────────────────────────────────────────────────╮
678 │ 1. How often do you usually drive a car or other motor vehicle? │
679 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
680 │ │ Several days a │ Once a week or │ Only certain times a │ │
681 │Every day│ week │ less │ year │Never│
682 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
683 │ Count │ Count │ Count │ Count │Count│
684 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
685 │ 4667│ 1274│ 361│ 130│ 540│
686 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
698 AT_SETUP([CTABLES one string variable])
699 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
700 AT_DATA([ctables.sps],
703 MISSING VALUES licensed('DontKnow', 'Refused').
704 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
705 CTABLES /TABLE licensed.
706 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
707 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
708 * Notice that the string matching is case-sensitive.
709 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
710 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
712 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
713 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
715 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
717 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
718 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
720 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
722 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
732 ╭─────────────────┬─────┬───────╮
734 ├─────────────────┼─────┼───────┤
735 │licensed DontKnow│ 4│ │
739 │ Total │ 6999│ 6951│
740 ╰─────────────────┴─────┴───────╯
743 ╭──────────────┬─────╮
745 ├──────────────┼─────┤
746 │licensed Yes │ 6379│
749 ╰──────────────┴─────╯
752 ╭──────────────┬─────╮
754 ├──────────────┼─────┤
755 │licensed Yes │ 6379│
758 ╰──────────────┴─────╯
761 ╭────────────────┬─────╮
763 ├────────────────┼─────┤
768 ╰────────────────┴─────╯
771 ╭────────────────┬─────╮
773 ├────────────────┼─────┤
774 │licensed Yes │ 6379│
776 ╰────────────────┴─────╯
779 ╭────────────────┬─────╮
781 ├────────────────┼─────┤
782 │licensed Yes │ 6379│
784 ╰────────────────┴─────╯
788 AT_SETUP([CTABLES one scale variable])
789 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
790 AT_DATA([ctables.sps],
792 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
793 CTABLES /TABLE BY qnd1.
794 CTABLES /TABLE BY BY qnd1.
796 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
798 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
799 │ │ │ │ │ │ Std │ │ │
800 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
801 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
802 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
803 │age? │ │ │ │ │ │ │ │
804 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
807 ╭──────────────────────────╮
808 │D1. AGE: What is your age?│
809 ├──────────────────────────┤
811 ├──────────────────────────┤
813 ╰──────────────────────────╯
816 D1. AGE: What is your age?
825 AT_SETUP([CTABLES simple stacking])
826 AT_KEYWORDS([stack stacked])
827 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
828 AT_DATA([ctables.sps],
830 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
832 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
834 ╭───────────────────────────────────────────────────────────────┬──────────────╮
841 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
842 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
843 │too much to drink to drive safely will A. Get certain │ │ │
844 │stopped by the police? Very likely │ 21%│ 22%│
845 │ Somewhat │ 38%│ 42%│
847 │ Somewhat │ 21%│ 18%│
851 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
852 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
853 │too much to drink to drive safely will B. Have an certain │ │ │
854 │accident? Very likely │ 36%│ 45%│
855 │ Somewhat │ 39%│ 32%│
861 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
862 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
863 │too much to drink to drive safely will C. Be certain │ │ │
864 │convicted for drunk driving? Very likely │ 32%│ 28%│
865 │ Somewhat │ 27%│ 32%│
867 │ Somewhat │ 15%│ 15%│
871 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
872 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
873 │too much to drink to drive safely will D. Be certain │ │ │
874 │arrested for drunk driving? Very likely │ 26%│ 27%│
875 │ Somewhat │ 32%│ 35%│
877 │ Somewhat │ 17%│ 15%│
881 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
885 AT_SETUP([CTABLES show or hide empty categories])
886 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
887 AT_DATA([ctables.sps],
889 IF (qn105ba = 2) qn105ba = 1.
890 IF (qns3a = 1) qns3a = 2.
891 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
892 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
893 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
894 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
895 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
896 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
897 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
899 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
901 ╭──────────────────────────────────────────────────────────────┬───────────────╮
908 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
909 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
910 │too much to drink to drive safely will A. Get certain │ │ │
911 │stopped by the police? Very likely│ .│ 0%│
918 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
921 ╭──────────────────────────────────────────────────────────────┬───────────────╮
928 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
929 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
930 │too much to drink to drive safely will A. Get certain │ │ │
931 │stopped by the police? Somewhat │ .│ 40%│
937 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
940 ╭────────────────────────────────────────────────────────────────────┬─────────╮
947 ├────────────────────────────────────────────────────────────────────┼─────────┤
948 │105b. How likely is it that drivers who have had too Almost │ 32%│
949 │much to drink to drive safely will A. Get stopped by certain │ │
950 │the police? Very likely │ 0%│
957 ╰────────────────────────────────────────────────────────────────────┴─────────╯
960 ╭────────────────────────────────────────────────────────────────────┬─────────╮
967 ├────────────────────────────────────────────────────────────────────┼─────────┤
968 │105b. How likely is it that drivers who have had too Almost │ 32%│
969 │much to drink to drive safely will A. Get stopped by certain │ │
970 │the police? Somewhat │ 40%│
976 ╰────────────────────────────────────────────────────────────────────┴─────────╯
980 AT_SETUP([CTABLES sorting categories])
981 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
982 AT_DATA([ctables.sps],
984 IF (QND5A=6) QND5A=-1.
985 IF (QND5A=5) QND5A=-2.
986 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
987 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
988 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
989 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
991 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
993 ╭────────────────────────────────────────────────────────────────────────┬─────╮
995 ├────────────────────────────────────────────────────────────────────────┼─────┤
996 │D5a. What would you say is your primary ethnic -2.00 │ 52│
997 │background? -1.00 │ 78│
1001 │ South American │ 34│
1002 │ Central American │ 0│
1003 │ Puerto Rican, OR │ 0│
1004 │ Something else │ 68│
1005 │ Multiple - cannot choose│ 7│
1007 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1010 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1012 ├────────────────────────────────────────────────────────────────────────┼─────┤
1013 │D5a. What would you say is your primary ethnic Multiple - cannot choose│ 7│
1014 │background? one │ │
1015 │ Something else │ 68│
1016 │ Puerto Rican, OR │ 0│
1017 │ Central American │ 0│
1018 │ South American │ 34│
1024 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1027 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1029 ├────────────────────────────────────────────────────────────────────────┼─────┤
1030 │D5a. What would you say is your primary ethnic Central American │ 0│
1031 │background? Cuban │ 20│
1033 │ Multiple - cannot choose│ 7│
1035 │ Puerto Rican, OR │ 0│
1036 │ Something else │ 68│
1037 │ South American │ 34│
1041 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1044 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1046 ├────────────────────────────────────────────────────────────────────────┼─────┤
1047 │D5a. What would you say is your primary ethnic Spanish │ 48│
1048 │background? South American │ 34│
1049 │ Something else │ 68│
1050 │ Puerto Rican, OR │ 0│
1051 │ Multiple - cannot choose│ 7│
1055 │ Central American │ 0│
1058 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1062 AT_SETUP([CTABLES simple nesting])
1063 AT_KEYWORDS([nest nested])
1064 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1065 AT_DATA([ctables.sps],
1067 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1068 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1069 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1070 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1071 /CLABELS ROW=OPPOSITE.
1073 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1075 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1078 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1079 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1080 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1081 │drive safely will A. Get stopped by Total │ 700│ 10%│
1082 │the police? ╶──────────────────────────┼─────┼──────┤
1083 │ Very S3a. Male │ 660│ 10%│
1084 │ likely GENDER: Female│ 842│ 12%│
1085 │ Total │ 1502│ 22%│
1086 │ ╶──────────────────────────┼─────┼──────┤
1087 │ Somewhat S3a. Male │ 1174│ 17%│
1088 │ likely GENDER: Female│ 1589│ 23%│
1089 │ Total │ 2763│ 40%│
1090 │ ╶──────────────────────────┼─────┼──────┤
1091 │ Somewhat S3a. Male │ 640│ 9%│
1092 │ unlikely GENDER: Female│ 667│ 10%│
1093 │ Total │ 1307│ 19%│
1094 │ ╶──────────────────────────┼─────┼──────┤
1095 │ Very S3a. Male │ 311│ 5%│
1096 │ unlikely GENDER: Female│ 298│ 4%│
1098 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1099 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1100 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1101 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1102 │ ╶──────────────────────────┼─────┼──────┤
1103 │ Very S3a. Male │ 1104│ 16%│
1104 │ likely GENDER: Female│ 1715│ 25%│
1105 │ Total │ 2819│ 41%│
1106 │ ╶──────────────────────────┼─────┼──────┤
1107 │ Somewhat S3a. Male │ 1203│ 17%│
1108 │ likely GENDER: Female│ 1214│ 18%│
1109 │ Total │ 2417│ 35%│
1110 │ ╶──────────────────────────┼─────┼──────┤
1111 │ Somewhat S3a. Male │ 262│ 4%│
1112 │ unlikely GENDER: Female│ 168│ 2%│
1114 │ ╶──────────────────────────┼─────┼──────┤
1115 │ Very S3a. Male │ 81│ 1%│
1116 │ unlikely GENDER: Female│ 59│ 1%│
1118 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1119 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1120 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1121 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1122 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1123 │ Very S3a. Male │ 988│ 14%│
1124 │ likely GENDER: Female│ 1049│ 15%│
1125 │ Total │ 2037│ 30%│
1126 │ ╶──────────────────────────┼─────┼──────┤
1127 │ Somewhat S3a. Male │ 822│ 12%│
1128 │ likely GENDER: Female│ 1210│ 18%│
1129 │ Total │ 2032│ 30%│
1130 │ ╶──────────────────────────┼─────┼──────┤
1131 │ Somewhat S3a. Male │ 446│ 7%│
1132 │ unlikely GENDER: Female│ 548│ 8%│
1134 │ ╶──────────────────────────┼─────┼──────┤
1135 │ Very S3a. Male │ 268│ 4%│
1136 │ unlikely GENDER: Female│ 354│ 5%│
1138 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1139 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1140 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1141 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1142 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1143 │ Very S3a. Male │ 805│ 12%│
1144 │ likely GENDER: Female│ 1029│ 15%│
1145 │ Total │ 1834│ 27%│
1146 │ ╶──────────────────────────┼─────┼──────┤
1147 │ Somewhat S3a. Male │ 975│ 14%│
1148 │ likely GENDER: Female│ 1332│ 19%│
1149 │ Total │ 2307│ 34%│
1150 │ ╶──────────────────────────┼─────┼──────┤
1151 │ Somewhat S3a. Male │ 535│ 8%│
1152 │ unlikely GENDER: Female│ 560│ 8%│
1153 │ Total │ 1095│ 16%│
1154 │ ╶──────────────────────────┼─────┼──────┤
1155 │ Very S3a. Male │ 270│ 4%│
1156 │ unlikely GENDER: Female│ 279│ 4%│
1158 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1161 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1162 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1163 │ │ certain│likely│ likely │ unlikely│unlikely│
1164 │ ├────────┼──────┼─────────┼─────────┼────────┤
1166 │ │ Table %│ % │ Table % │ Table % │ Table %│
1167 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1168 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1169 │GENDER: is it that drivers│ │ │ │ │ │
1170 │ who have had too │ │ │ │ │ │
1171 │ much to drink to │ │ │ │ │ │
1172 │ drive safely will │ │ │ │ │ │
1173 │ A. Get stopped by │ │ │ │ │ │
1174 │ the police? │ │ │ │ │ │
1175 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1176 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1177 │ is it that drivers│ │ │ │ │ │
1178 │ who have had too │ │ │ │ │ │
1179 │ much to drink to │ │ │ │ │ │
1180 │ drive safely will │ │ │ │ │ │
1181 │ A. Get stopped by │ │ │ │ │ │
1182 │ the police? │ │ │ │ │ │
1183 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1184 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1185 │ is it that drivers│ │ │ │ │ │
1186 │ who have had too │ │ │ │ │ │
1187 │ much to drink to │ │ │ │ │ │
1188 │ drive safely will │ │ │ │ │ │
1189 │ A. Get stopped by │ │ │ │ │ │
1190 │ the police? │ │ │ │ │ │
1191 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1192 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1193 │GENDER: is it that drivers│ │ │ │ │ │
1194 │ who have had too │ │ │ │ │ │
1195 │ much to drink to │ │ │ │ │ │
1196 │ drive safely will │ │ │ │ │ │
1197 │ B. Have an │ │ │ │ │ │
1198 │ accident? │ │ │ │ │ │
1199 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1200 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1201 │ is it that drivers│ │ │ │ │ │
1202 │ who have had too │ │ │ │ │ │
1203 │ much to drink to │ │ │ │ │ │
1204 │ drive safely will │ │ │ │ │ │
1205 │ B. Have an │ │ │ │ │ │
1206 │ accident? │ │ │ │ │ │
1207 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1208 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1209 │ is it that drivers│ │ │ │ │ │
1210 │ who have had too │ │ │ │ │ │
1211 │ much to drink to │ │ │ │ │ │
1212 │ drive safely will │ │ │ │ │ │
1213 │ B. Have an │ │ │ │ │ │
1214 │ accident? │ │ │ │ │ │
1215 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1216 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1217 │GENDER: is it that drivers│ │ │ │ │ │
1218 │ who have had too │ │ │ │ │ │
1219 │ much to drink to │ │ │ │ │ │
1220 │ drive safely will │ │ │ │ │ │
1221 │ C. Be convicted │ │ │ │ │ │
1222 │ for drunk driving?│ │ │ │ │ │
1223 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1224 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1225 │ is it that drivers│ │ │ │ │ │
1226 │ who have had too │ │ │ │ │ │
1227 │ much to drink to │ │ │ │ │ │
1228 │ drive safely will │ │ │ │ │ │
1229 │ C. Be convicted │ │ │ │ │ │
1230 │ for drunk driving?│ │ │ │ │ │
1231 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1232 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1233 │ is it that drivers│ │ │ │ │ │
1234 │ who have had too │ │ │ │ │ │
1235 │ much to drink to │ │ │ │ │ │
1236 │ drive safely will │ │ │ │ │ │
1237 │ C. Be convicted │ │ │ │ │ │
1238 │ for drunk driving?│ │ │ │ │ │
1239 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1240 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1241 │GENDER: is it that drivers│ │ │ │ │ │
1242 │ who have had too │ │ │ │ │ │
1243 │ much to drink to │ │ │ │ │ │
1244 │ drive safely will │ │ │ │ │ │
1245 │ D. Be arrested for│ │ │ │ │ │
1246 │ drunk driving? │ │ │ │ │ │
1247 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1248 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1249 │ is it that drivers│ │ │ │ │ │
1250 │ who have had too │ │ │ │ │ │
1251 │ much to drink to │ │ │ │ │ │
1252 │ drive safely will │ │ │ │ │ │
1253 │ D. Be arrested for│ │ │ │ │ │
1254 │ drunk driving? │ │ │ │ │ │
1255 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1256 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1257 │ is it that drivers│ │ │ │ │ │
1258 │ who have had too │ │ │ │ │ │
1259 │ much to drink to │ │ │ │ │ │
1260 │ drive safely will │ │ │ │ │ │
1261 │ D. Be arrested for│ │ │ │ │ │
1262 │ drunk driving? │ │ │ │ │ │
1263 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1267 AT_SETUP([CTABLES nesting and scale variables])
1268 AT_KEYWORDS([nest nested])
1269 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1270 AT_DATA([ctables.sps],
1272 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1273 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1274 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1275 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1276 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1278 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1280 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1286 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1287 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1288 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1290 │ Once a week or │ 44│ 54│
1292 │ Only certain │ 34│ 41│
1293 │ times a year │ │ │
1295 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1298 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1299 │ │Minimum│Maximum│Mean│
1300 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1301 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1302 │What is GENDER: months, has there been a │ │ │ │
1303 │your time when you felt you │ │ │ │
1304 │age? should cut down on your No │ 16│ 86│ 46│
1306 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1307 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1308 │ months, has there been a │ │ │ │
1309 │ time when you felt you │ │ │ │
1310 │ should cut down on your No │ 16│ 86│ 48│
1312 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1313 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1314 │What is GENDER: months, has there been a │ │ │ │
1315 │your time when people criticized No │ 16│ 86│ 46│
1316 │age? your drinking? │ │ │ │
1317 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1318 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1319 │ months, has there been a │ │ │ │
1320 │ time when people criticized No │ 16│ 86│ 48│
1321 │ your drinking? │ │ │ │
1322 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1325 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1326 │ │S1. Including yourself, how many members of this│
1327 │ │ household are age 16 or older? │
1328 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1329 │ │ │ │ │ │ │ │ 6 or │
1330 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1331 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1332 │ │Column│Column│Column│Column│Column│Column│Column│
1333 │ │ % │ % │ % │ % │ % │ % │ % │
1334 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1335 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1336 │SAMPLE How certain │ │ │ │ │ │ │ │
1337 │SOURCE: likely │ │ │ │ │ │ │ │
1338 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1339 │ that likely │ │ │ │ │ │ │ │
1340 │ drivers │ │ │ │ │ │ │ │
1341 │ who have │ │ │ │ │ │ │ │
1342 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1343 │ much to likely │ │ │ │ │ │ │ │
1344 │ drink to │ │ │ │ │ │ │ │
1345 │ drive │ │ │ │ │ │ │ │
1346 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1347 │ will A. unlikely│ │ │ │ │ │ │ │
1348 │ Get │ │ │ │ │ │ │ │
1349 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1350 │ by the unlikely│ │ │ │ │ │ │ │
1351 │ police? │ │ │ │ │ │ │ │
1352 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1355 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1358 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1359 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1360 │group typical month did you have one or more │ │ │
1361 │ alcoholic beverages to drink? │ │ │
1362 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1363 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1364 │ typical month did you have one or more │ │ │
1365 │ alcoholic beverages to drink? │ │ │
1366 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1367 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1368 │ typical month did you have one or more │ │ │
1369 │ alcoholic beverages to drink? │ │ │
1370 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1371 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1372 │ typical month did you have one or more │ │ │
1373 │ alcoholic beverages to drink? │ │ │
1374 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1375 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1376 │ typical month did you have one or more │ │ │
1377 │ alcoholic beverages to drink? │ │ │
1378 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1379 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1380 │ older typical month did you have one or more │ │ │
1381 │ alcoholic beverages to drink? │ │ │
1382 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1387 AT_SETUP([CTABLES SLABELS])
1388 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1389 AT_DATA([ctables.sps],
1391 CTABLES /TABLE qn1 [COUNT COLPCT].
1392 CTABLES /TABLE qn1 [COUNT COLPCT]
1393 /SLABELS POSITION=ROW.
1394 CTABLES /TABLE qn1 [COUNT COLPCT]
1395 /SLABELS POSITION=ROW VISIBLE=NO.
1397 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1399 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1402 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1403 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1404 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1405 │ Once a week or less│ 361│ 5.2%│
1406 │ Only certain times │ 130│ 1.9%│
1408 │ Never │ 540│ 7.7%│
1409 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1412 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1413 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1414 │other motor vehicle? Column │66.9%│
1416 │ ╶───────────────────────────┼─────┤
1417 │ Several days a week Count │ 1274│
1420 │ ╶───────────────────────────┼─────┤
1421 │ Once a week or less Count │ 361│
1424 │ ╶───────────────────────────┼─────┤
1425 │ Only certain times Count │ 130│
1426 │ a year Column │ 1.9%│
1428 │ ╶───────────────────────────┼─────┤
1429 │ Never Count │ 540│
1432 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1435 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1436 │ 1. How often do you usually drive a car or other Every day │ 4667│
1437 │motor vehicle? │66.9%│
1438 │ Several days a week │ 1274│
1440 │ Once a week or less │ 361│
1442 │ Only certain times a │ 130│
1446 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1450 AT_SETUP([CTABLES simple totals])
1451 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1452 AT_DATA([ctables.sps],
1455 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1456 DESCRIPTIVES qn18/STATISTICS=MEAN.
1457 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1458 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1460 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1462 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1464 ├────────────────────────────────────────────────────────────────────────┼─────┤
1465 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1466 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1469 │ Wine coolers │ 137│
1470 │ Hard liquor or │ 888│
1472 │ Flavored malt │ 83│
1474 │ Number responding │ 4221│
1475 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1477 Descriptive Statistics
1478 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1480 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1481 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1482 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1483 │Valid N (listwise) │6999│ │
1484 │Missing N (listwise) │2781│ │
1485 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1488 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1489 │ │ │ │ Valid│Total│
1490 │ │Mean│Count│ N │ N │
1491 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1492 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1493 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1494 │ you usually drink per sitting? │ │ │ │ │
1495 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1496 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1497 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1498 │ you usually drink per sitting? │ │ │ │ │
1499 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1500 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1501 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1502 │ you usually drink per sitting? │ │ │ │ │
1503 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1504 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1505 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1506 │ you usually drink per sitting? │ │ │ │ │
1507 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1508 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1509 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1510 │ you usually drink per sitting? │ │ │ │ │
1511 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1515 AT_SETUP([CTABLES subtotals])
1516 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1517 AT_DATA([ctables.sps],
1519 CTABLES /TABLE=qn105ba BY qns1
1520 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1521 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1522 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1523 CTABLES /TABLE=qn105ba BY qns1
1524 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1525 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1527 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1529 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1530 │ │ S1. Including yourself, how many members of this household │
1531 │ │ are age 16 or older? │
1532 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1533 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1534 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1535 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1536 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1537 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1538 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1539 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1540 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1541 │ likely │ │ │ │ │ │ │ │
1542 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1543 │ unlikely │ │ │ │ │ │ │ │
1544 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1545 │ unlikely │ │ │ │ │ │ │ │
1546 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1549 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1550 │ │ S1. Including yourself, how many members of this household │
1551 │ │ are age 16 or older? │
1552 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1553 │ │ │ │ │ │ │ │ 6 or │
1554 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1555 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1556 │ │ │ │ │ │ Column│ │ │
1557 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1558 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1559 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1560 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1561 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1562 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1563 │ likely │ │ │ │ │ │ │ │
1564 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1565 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1566 │ unlikely │ │ │ │ │ │ │ │
1567 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1568 │ unlikely │ │ │ │ │ │ │ │
1569 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1570 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1573 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1574 │ │ S1. Including yourself, how many members of this household │
1575 │ │ are age 16 or older? │
1576 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1577 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1578 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1579 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1580 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1581 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1582 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1583 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1584 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1585 │ likely │ │ │ │ │ │ │ │
1586 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1587 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1588 │ unlikely │ │ │ │ │ │ │ │
1589 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1590 │ unlikely │ │ │ │ │ │ │ │
1591 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1592 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1596 AT_SETUP([CTABLES PCOMPUTE])
1597 AT_KEYWORDS([postcompute])
1598 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1599 AT_DATA([ctables.sps],
1602 /PCOMPUTE &x=EXPR([3] + [4])
1603 /PCOMPUTE &y=EXPR([4] + [5])
1604 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1605 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1606 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1607 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1609 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1611 /PCOMPUTE &x=EXPR([3] + [4])
1612 /PCOMPUTE &y=EXPR([4] + [5])
1613 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1614 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1615 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1616 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1618 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1620 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1621 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1622 │ ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1623 │ │ 1 │ 2 │ Subtotal │ 3 │ 4 │ 5 │ 3+4 │ 4+5 │ Subtotal │ Total │
1624 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1625 │ │ │ │ │ │ │ │ │ │ │ Row│ │ Row│ │ │ │ Row│ │ │ │ │
1626 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│ % │Count│ % │ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1627 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1628 │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%│
1629 │likely is certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1630 │it that │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1631 │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%│
1632 │who have likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1633 │had too │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1634 │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%│
1635 │drink to likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1636 │drive │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1637 │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%│
1638 │will A. unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1639 │Get │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1640 │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%│
1641 │the unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1642 │police? │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1643 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1646 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1647 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1648 │ ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1649 │ │ 1 │ 2 │ Subtotal │ 3 │ 3+4 │ 4+5 │ Subtotal │ Total │
1650 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1651 │ │ │ │ │ │ │ │ │ │ │ │ │ Row│ │ │ │ │
1652 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1653 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1654 │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%│
1655 │drivers who have had too much certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1656 │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%│
1657 │A. Get stopped by the police? likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1658 │ 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%│
1659 │ likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1660 │ 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%│
1661 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1662 │ 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%│
1663 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1664 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1668 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1669 AT_KEYWORDS([postcompute])
1670 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1671 AT_DATA([ctables.sps],
1674 /PCOMPUTE &x=EXPR(OTHERNM)
1675 /PCOMPUTE &y=EXPR(MISSING)
1676 /PPROPERTIES &x LABEL='Drivers'
1677 /PPROPERTIES &y LABEL='Missing Values 2'
1679 /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1681 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1683 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1689 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1690 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1691 │ Several days a week │ 440│ 834│
1692 │ Once a week or less │ 125│ 236│
1693 │ Only certain times a year│ 58│ 72│
1695 │ Drivers │ 2928│ 3504│
1696 │ Valid Values │ 3120│ 3852│
1697 │ Don't know │ 3│ 5│
1699 │ Missing Values │ 12│ 15│
1700 │ Missing Values 2 │ 12│ 15│
1701 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1705 AT_SETUP([CTABLES PCOMPUTE - THRU])
1706 AT_KEYWORDS([postcompute])
1707 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1708 AT_DATA([ctables.sps],
1711 /PCOMPUTE &x=EXPR([1 THRU 2])
1712 /PCOMPUTE &y=EXPR([3 THRU 4])
1713 /PCOMPUTE &z=EXPR([5] + MISSING)
1714 /PPROPERTIES &x LABEL='Frequent Drivers'
1715 /PPROPERTIES &y LABEL='Infrequent Drivers'
1716 /PPROPERTIES &z LABEL='Not Drivers or Missing'
1718 /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
1720 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1722 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1728 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1729 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1730 │ Several days a week │ 440│ 834│
1731 │ Frequent Drivers │ 2745│ 3196│
1732 │ Once a week or less │ 125│ 236│
1733 │ Only certain times a year│ 58│ 72│
1734 │ Infrequent Drivers │ 183│ 308│
1735 │ Drivers │ 2928│ 3504│
1737 │ Don't know │ 3│ 5│
1739 │ Not Drivers or Missing │ 204│ 363│
1740 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1744 dnl I'm not sure that this is the correct behavior (see
1745 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
1746 dnl but at least this test will notify us if the behavior changes.
1747 AT_SETUP([CTABLES intersecting PCOMPUTEs])
1748 AT_KEYWORDS([PCOMPUTE postcompute])
1749 AT_DATA([ctables.sps],
1750 [[DATA LIST LIST NOTABLE/x y z.
1753 VARIABLE LEVEL x y (NOMINAL).
1767 /PCOMPUTE &a = EXPR([1] + [2])
1768 /PCOMPUTE &b = EXPR([2] + [3])
1769 /PCOMPUTE &c = EXPR([4] * [5])
1770 /PCOMPUTE &d = EXPR([5] * [6])
1772 /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
1773 /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
1775 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
1777 ╭───────────┬─────────────────────────────────────╮
1779 │ ├─────┬─────────┬─────┬─────────┬─────┤
1780 │ │ 4 │[4] * [5]│ 5 │[5] * [6]│ 6 │
1781 │ ├─────┼─────────┼─────┼─────────┼─────┤
1782 │ │Count│ Count │Count│ Count │Count│
1783 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
1784 │x 1 │ 5│ 10│ 2│ 18│ 9│
1785 │ [1] + [2]│ 7│ .│ 5│ .│ 13│
1786 │ 2 │ 2│ 6│ 3│ 12│ 4│
1787 │ [2] + [3]│ 3│ .│ 9│ .│ 5│
1788 │ 3 │ 1│ 6│ 6│ 6│ 1│
1789 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
1793 AT_SETUP([CTABLES string and date and time])
1796 for gender in F M; do
1797 for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
1798 for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
1799 printf "$weight $gender $month $wkday\n"
1800 weight=$(expr \( $weight + 3 \) % 7 + 2)
1805 AT_DATA([ctables.sps],
1806 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
1807 /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
1809 VARIABLE LEVEL w (SCALE).
1810 VARIABLE LEVEL gender fmon fday (NOMINAL).
1813 fmon 'Favorite month'
1814 fday 'Favorite day of the week'.
1815 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
1817 /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
1818 /PPROPERTIES &q2 LABEL='Q2'
1819 /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
1820 /PPROPERTIES &weekend LABEL='Weekend'
1821 /TABLE fmon BY gender > fday
1822 /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
1824 'JUL' THRU 'sep', SUBTOTAL="Q3",
1825 OTHERNM, SUBTOTAL='Q4']
1826 /CATEGORIES VARIABLES=gender ['M', 'F']
1827 /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
1828 /SLABELS VISIBLE=NO.
1830 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1832 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
1834 │ ├─────────────────────────────────────────┬─────────────────────────────────────────┤
1836 │ ├─────────────────────────────────────────┼─────────────────────────────────────────┤
1837 │ │ Favorite day of the week │ Favorite day of the week │
1838 │ ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
1839 │ │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
1840 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
1841 │Favorite month JAN│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 9│ 6│ 4│ 2│ 7│ 5│ 3│ 12│ 36│
1842 │ FEB│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1843 │ MAR│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1844 │ Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│ │ │ 29│ 12│ 13│ 14│ 15│ 16│ 17│ │ │
1845 │ APR│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1846 │ MAY│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1847 │ JUN│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│
1848 │ Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│ .│ │ 28│ 15│ 16│ 17│ 18│ 12│ 13│ .│ │
1849 │ JUL│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│
1850 │ AUG│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│
1851 │ SEP│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1852 │ Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│ │ │ 62│ 33│ 28│ 30│ 32│ 27│ 29│ │ │
1853 │ OCT│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1854 │ NOV│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1855 │ DEC│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1856 │ Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│ │ │ 26│ 14│ 15│ 16│ 17│ 18│ 12│ │ │
1857 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
1861 AT_SETUP([CTABLES CLABELS])
1862 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1863 AT_DATA([ctables.sps],
1865 CTABLES /TABLE AgeGroup BY qns3a.
1866 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1867 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1868 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1869 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1871 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1873 ╭───────────────────────┬────────────╮
1879 ├───────────────────────┼─────┼──────┤
1880 │Age group 15 or younger│ 0│ 0│
1881 │ 16 to 25 │ 594│ 505│
1882 │ 26 to 35 │ 476│ 491│
1883 │ 36 to 45 │ 489│ 548│
1884 │ 46 to 55 │ 526│ 649│
1885 │ 56 to 65 │ 516│ 731│
1886 │ 66 or older │ 531│ 943│
1887 ╰───────────────────────┴─────┴──────╯
1890 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1892 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1894 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1895 │ │ 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 │
1896 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1897 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1898 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1899 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1900 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1901 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1902 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1905 ╭──────────────────────────────┬────────────╮
1909 ├──────────────────────────────┼────────────┤
1910 │Age group 15 or younger Male │ 0│
1912 │ ╶────────────────────┼────────────┤
1913 │ 16 to 25 Male │ 594│
1915 │ ╶────────────────────┼────────────┤
1916 │ 26 to 35 Male │ 476│
1918 │ ╶────────────────────┼────────────┤
1919 │ 36 to 45 Male │ 489│
1921 │ ╶────────────────────┼────────────┤
1922 │ 46 to 55 Male │ 526│
1924 │ ╶────────────────────┼────────────┤
1925 │ 56 to 65 Male │ 516│
1927 │ ╶────────────────────┼────────────┤
1928 │ 66 or older Male │ 531│
1930 ╰──────────────────────────────┴────────────╯
1934 ╭─────────┬────────────╮
1940 ├─────────┼─────┼──────┤
1942 ╰─────────┴─────┴──────╯
1946 ╭─────────┬────────────╮
1952 ├─────────┼─────┼──────┤
1953 │Age group│ 594│ 505│
1954 ╰─────────┴─────┴──────╯
1958 ╭─────────┬────────────╮
1964 ├─────────┼─────┼──────┤
1965 │Age group│ 476│ 491│
1966 ╰─────────┴─────┴──────╯
1970 ╭─────────┬────────────╮
1976 ├─────────┼─────┼──────┤
1977 │Age group│ 489│ 548│
1978 ╰─────────┴─────┴──────╯
1982 ╭─────────┬────────────╮
1988 ├─────────┼─────┼──────┤
1989 │Age group│ 526│ 649│
1990 ╰─────────┴─────┴──────╯
1994 ╭─────────┬────────────╮
2000 ├─────────┼─────┼──────┤
2001 │Age group│ 516│ 731│
2002 ╰─────────┴─────┴──────╯
2006 ╭─────────┬────────────╮
2012 ├─────────┼─────┼──────┤
2013 │Age group│ 531│ 943│
2014 ╰─────────┴─────┴──────╯
2018 ╭───────────────────────┬────────────╮
2022 ├───────────────────────┼────────────┤
2023 │Age group 15 or younger│ 0│
2029 │ 66 or older │ 531│
2030 ╰───────────────────────┴────────────╯
2034 ╭───────────────────────┬────────────╮
2038 ├───────────────────────┼────────────┤
2039 │Age group 15 or younger│ 0│
2045 │ 66 or older │ 943│
2046 ╰───────────────────────┴────────────╯
2050 AT_SETUP([CTABLES missing values])
2051 AT_DATA([ctables.sps],
2052 [[DATA LIST LIST NOTABLE/x y.
2091 MISSING VALUES x (1, 2) y (2, 3).
2092 VARIABLE LEVEL ALL (NOMINAL).
2094 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2095 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2096 /CATEGORIES VARIABLES=ALL TOTAL=YES.
2097 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2098 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2099 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2100 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2101 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2102 /CATEGORIES VARIABLES=ALL TOTAL=YES
2103 /SLABELS POSITION=ROW.
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 MISSING=INCLUDE
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=x [1, 2, 3, 4] TOTAL=YES
2111 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
2112 /SLABELS POSITION=ROW.
2114 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2116 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2117 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2118 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2119 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2120 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2121 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2122 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2123 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2124 dnl Note that Column Total N % doesn't add up to 100 because missing
2125 dnl values are included in the total but not shown as a category and this
2126 dnl is expected behavior.
2129 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2130 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2131 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2132 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2133 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2134 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2135 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2136 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2137 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2138 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2139 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2140 dnl values are included in the total but not shown as a category and this
2141 dnl is expected behavior.
2144 ╭────────────────────────┬───────────────────────────╮
2146 │ ├──────┬──────┬──────┬──────┤
2147 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
2148 ├────────────────────────┼──────┼──────┼──────┼──────┤
2149 │x 3.00 Count │ 1│ 1│ 1│ 3│
2150 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2151 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2152 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2153 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2154 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2155 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2156 │ Valid N │ │ │ │ 3│
2157 │ Total N │ │ │ │ 6│
2158 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2159 │ 4.00 Count │ 1│ 1│ 1│ 3│
2160 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2161 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2162 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2163 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2164 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2165 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2166 │ Valid N │ │ │ │ 3│
2167 │ Total N │ │ │ │ 6│
2168 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2169 │ 5.00 Count │ 1│ 1│ 1│ 3│
2170 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2171 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2172 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2173 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2174 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2175 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2176 │ Valid N │ │ │ │ 3│
2177 │ Total N │ │ │ │ 6│
2178 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2179 │ Total Count │ 3│ 3│ 3│ 9│
2180 │ Column % │100.0%│100.0%│100.0%│ .│
2181 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
2182 │ Column Total N %│100.0%│100.0%│100.0%│ .│
2183 │ Row % │ .│ .│ .│ .│
2184 │ Row Valid N % │ .│ .│ .│ .│
2185 │ Row Total N % │ .│ .│ .│ .│
2186 │ Valid N │ 3│ 3│ 3│ 9│
2187 │ Total N │ 6│ 6│ 6│ 36│
2188 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2191 ╭────────────────────────┬─────────────────────────────────────────╮
2193 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
2194 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2195 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2196 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2197 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2198 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2199 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2200 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2201 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2202 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2203 │ Valid N │ │ │ │ │ │ 0│
2204 │ Total N │ │ │ │ │ │ 6│
2205 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2206 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2207 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2208 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2209 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2210 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2211 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2212 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2213 │ Valid N │ │ │ │ │ │ 0│
2214 │ Total N │ │ │ │ │ │ 6│
2215 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2216 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2217 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2218 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2219 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2220 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2221 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2222 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2223 │ Valid N │ │ │ │ │ │ 3│
2224 │ Total N │ │ │ │ │ │ 6│
2225 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2226 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2227 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2228 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2229 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2230 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2231 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2232 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2233 │ Valid N │ │ │ │ │ │ 3│
2234 │ Total N │ │ │ │ │ │ 6│
2235 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2236 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2237 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2238 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2239 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2240 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2241 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2242 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2243 │ Valid N │ │ │ │ │ │ 3│
2244 │ Total N │ │ │ │ │ │ 6│
2245 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2246 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
2247 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2248 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
2249 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2250 │ Row % │ .│ .│ .│ .│ .│ .│
2251 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2252 │ Row Total N % │ .│ .│ .│ .│ .│ .│
2253 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
2254 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
2255 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2258 ╭────────────────────────┬──────────────────────────────────╮
2260 │ ├──────┬──────┬──────┬──────┬──────┤
2261 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2262 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2263 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
2264 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2265 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2266 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2267 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2268 │ Row Valid N % │ .│ .│ .│ .│ .│
2269 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2270 │ Valid N │ │ │ │ │ 0│
2271 │ Total N │ │ │ │ │ 6│
2272 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2273 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
2274 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2275 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2276 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2277 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2278 │ Row Valid N % │ .│ .│ .│ .│ .│
2279 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2280 │ Valid N │ │ │ │ │ 0│
2281 │ Total N │ │ │ │ │ 6│
2282 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2283 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
2284 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2285 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2286 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2287 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2288 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2289 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2290 │ Valid N │ │ │ │ │ 3│
2291 │ Total N │ │ │ │ │ 6│
2292 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2293 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2294 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2295 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2296 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2297 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2298 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2299 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2300 │ Valid N │ │ │ │ │ 3│
2301 │ Total N │ │ │ │ │ 6│
2302 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2303 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2304 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2305 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2306 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2307 │ Row % │ .│ .│ .│ .│ .│
2308 │ Row Valid N % │ .│ .│ .│ .│ .│
2309 │ Row Total N % │ .│ .│ .│ .│ .│
2310 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2311 │ Total N │ 5│ 5│ 5│ 5│ 30│
2312 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2316 AT_SETUP([CTABLES SMISSING=LISTWISE])
2317 AT_KEYWORDS([SMISSING LISTWISE])
2318 AT_DATA([ctables.sps],
2319 [[DATA LIST LIST NOTABLE/x y z.
2327 VARIABLE LEVEL x (NOMINAL).
2329 CTABLES /TABLE (y + z) > x.
2330 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2332 * The following doesn't come out as listwise because the tables are
2333 separate, not linked by an > operator.
2334 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2336 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2366 AT_SETUP([CTABLES VLABELS - variables on different axes])
2367 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2368 AT_DATA([ctables.sps],
2370 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2371 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2372 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2373 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2374 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2376 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2378 ╭────────────────────────────────────────────────────────────────┬────────────╮
2384 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2385 │D5a. What would you say is your primary Cuban │ 13│ 7│
2386 │ethnic background? Mexican │ 175│ 136│
2388 │ South American │ 21│ 13│
2389 │ Central American │ 27│ 25│
2390 │ Puerto Rican, OR │ 37│ 41│
2391 │ Something else │ 35│ 33│
2392 │ Multiple - cannot │ 2│ 5│
2394 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2397 ╭──────────────────────────────────┬────────────╮
2403 ├──────────────────────────────────┼─────┼──────┤
2404 │QND5A Cuban │ 13│ 7│
2405 │ Mexican │ 175│ 136│
2407 │ South American │ 21│ 13│
2408 │ Central American │ 27│ 25│
2409 │ Puerto Rican, OR │ 37│ 41│
2410 │ Something else │ 35│ 33│
2411 │ Multiple - cannot choose one│ 2│ 5│
2412 ╰──────────────────────────────────┴─────┴──────╯
2415 ╭────────────────────────────────────────────────────────────────┬────────────╮
2421 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2422 │D5a. What would you say is your primary Cuban │ 13│ 7│
2423 │ethnic background? Mexican │ 175│ 136│
2425 │ South American │ 21│ 13│
2426 │ Central American │ 27│ 25│
2427 │ Puerto Rican, OR │ 37│ 41│
2428 │ Something else │ 35│ 33│
2429 │ Multiple - cannot │ 2│ 5│
2431 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2434 ╭────────────────────────────────────────────────────────────┬────────────────╮
2437 │ ├───────┬────────┤
2439 │ ├───────┼────────┤
2441 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2442 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2443 │primary ethnic background? Mexican │ 175│ 136│
2445 │ South American │ 21│ 13│
2446 │ Central American │ 27│ 25│
2447 │ Puerto Rican, OR │ 37│ 41│
2448 │ Something else │ 35│ 33│
2449 │ Multiple - cannot │ 2│ 5│
2451 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2454 ╭────────────────────────────┬─────┬──────╮
2458 ├────────────────────────────┼─────┼──────┤
2460 │Mexican │ 175│ 136│
2462 │South American │ 21│ 13│
2463 │Central American │ 27│ 25│
2464 │Puerto Rican, OR │ 37│ 41│
2465 │Something else │ 35│ 33│
2466 │Multiple - cannot choose one│ 2│ 5│
2467 ╰────────────────────────────┴─────┴──────╯
2471 AT_SETUP([CTABLES VLABELS - stacked variables])
2472 AT_KEYWORDS([stack stacking])
2473 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2474 AT_DATA([ctables.sps],
2476 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2477 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2478 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2479 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2480 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2482 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2484 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2486 ├───────────────────────────────────────────────────────────────────────┼─────┤
2487 │D5a. What would you say is your primary ethnic Cuban │ 20│
2488 │background? Mexican │ 311│
2490 │ South American │ 34│
2491 │ Central American │ 52│
2492 │ Puerto Rican, OR │ 78│
2493 │ Something else │ 68│
2494 │ Multiple - cannot │ 7│
2496 ├───────────────────────────────────────────────────────────────────────┼─────┤
2499 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2502 ╭─────────────────────────────────────────┬─────╮
2504 ├─────────────────────────────────────────┼─────┤
2508 │ South American │ 34│
2509 │ Central American │ 52│
2510 │ Puerto Rican, OR │ 78│
2511 │ Something else │ 68│
2512 │ Multiple - cannot choose one│ 7│
2513 ├─────────────────────────────────────────┼─────┤
2514 │S3a. GENDER: Male │ 3132│
2516 ╰─────────────────────────────────────────┴─────╯
2519 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2521 ├───────────────────────────────────────────────────────────────────────┼─────┤
2522 │D5a. What would you say is your primary ethnic Cuban │ 20│
2523 │background? Mexican │ 311│
2525 │ South American │ 34│
2526 │ Central American │ 52│
2527 │ Puerto Rican, OR │ 78│
2528 │ Something else │ 68│
2529 │ Multiple - cannot │ 7│
2531 ├───────────────────────────────────────────────────────────────────────┼─────┤
2533 ├───────────────────────────────────────────────────────────────────────┼─────┤
2535 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2538 ╭─────────────────────────────┬─────╮
2540 ├─────────────────────────────┼─────┤
2542 ├─────────────────────────────┼─────┤
2544 ├─────────────────────────────┼─────┤
2546 ├─────────────────────────────┼─────┤
2547 │South American │ 34│
2548 ├─────────────────────────────┼─────┤
2549 │Central American │ 52│
2550 ├─────────────────────────────┼─────┤
2551 │Puerto Rican, OR │ 78│
2552 ├─────────────────────────────┼─────┤
2553 │Something else │ 68│
2554 ├─────────────────────────────┼─────┤
2555 │Multiple - cannot choose one │ 7│
2556 ├─────────────────────────────┼─────┤
2557 │S3a. GENDER: Male │ 3132│
2559 ╰─────────────────────────────┴─────╯
2562 ╭────────────────────────────┬─────╮
2564 ├────────────────────────────┼─────┤
2568 │South American │ 34│
2569 │Central American │ 52│
2570 │Puerto Rican, OR │ 78│
2571 │Something else │ 68│
2572 │Multiple - cannot choose one│ 7│
2575 ╰────────────────────────────┴─────╯
2579 AT_SETUP([CTABLES VLABELS - nested variables])
2580 AT_KEYWORDS([nest nesting])
2581 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2582 AT_DATA([ctables.sps],
2584 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2585 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2586 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2587 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2588 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2590 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2592 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2594 ├───────────────────────────────────────────────────────────────────────┼─────┤
2595 │D5a. What would you say is your Cuban QNS3A Male │ 13│
2596 │primary ethnic background? Female│ 7│
2597 │ ╶─────────────────────────────────┼─────┤
2598 │ Mexican QNS3A Male │ 175│
2600 │ ╶─────────────────────────────────┼─────┤
2601 │ Spanish QNS3A Male │ 20│
2603 │ ╶─────────────────────────────────┼─────┤
2604 │ South American QNS3A Male │ 21│
2606 │ ╶─────────────────────────────────┼─────┤
2607 │ Central American QNS3A Male │ 27│
2609 │ ╶─────────────────────────────────┼─────┤
2610 │ Puerto Rican, OR QNS3A Male │ 37│
2612 │ ╶─────────────────────────────────┼─────┤
2613 │ Something else QNS3A Male │ 35│
2615 │ ╶─────────────────────────────────┼─────┤
2616 │ Multiple - cannot QNS3A Male │ 2│
2617 │ choose one Female│ 5│
2618 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2621 ╭──────────────────────────────────────────────────────┬─────╮
2623 ├──────────────────────────────────────────────────────┼─────┤
2624 │QND5A Cuban S3a. GENDER: Male │ 13│
2626 │ ╶────────────────────────────────────────────────┼─────┤
2627 │ Mexican S3a. GENDER: Male │ 175│
2629 │ ╶────────────────────────────────────────────────┼─────┤
2630 │ Spanish S3a. GENDER: Male │ 20│
2632 │ ╶────────────────────────────────────────────────┼─────┤
2633 │ South American S3a. GENDER: Male │ 21│
2635 │ ╶────────────────────────────────────────────────┼─────┤
2636 │ Central American S3a. GENDER: Male │ 27│
2638 │ ╶────────────────────────────────────────────────┼─────┤
2639 │ Puerto Rican, OR S3a. GENDER: Male │ 37│
2641 │ ╶────────────────────────────────────────────────┼─────┤
2642 │ Something else S3a. GENDER: Male │ 35│
2644 │ ╶────────────────────────────────────────────────┼─────┤
2645 │ Multiple - cannot choose one S3a. GENDER: Male │ 2│
2647 ╰──────────────────────────────────────────────────────┴─────╯
2650 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2652 ├───────────────────────────────────────────────────────────────────────┼─────┤
2653 │D5a. What would you say is your primary Cuban Male │ 13│
2654 │ethnic background? Female│ 7│
2655 │ ╶────────────────────────────┼─────┤
2656 │ Mexican Male │ 175│
2658 │ ╶────────────────────────────┼─────┤
2659 │ Spanish Male │ 20│
2661 │ ╶────────────────────────────┼─────┤
2662 │ South American Male │ 21│
2664 │ ╶────────────────────────────┼─────┤
2665 │ Central American Male │ 27│
2667 │ ╶────────────────────────────┼─────┤
2668 │ Puerto Rican, OR Male │ 37│
2670 │ ╶────────────────────────────┼─────┤
2671 │ Something else Male │ 35│
2673 │ ╶────────────────────────────┼─────┤
2674 │ Multiple - cannot Male │ 2│
2675 │ choose one Female│ 5│
2676 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2679 ╭────────────────────────────────────────────────┬─────╮
2681 ├────────────────────────────────────────────────┼─────┤
2682 │Cuban S3a. GENDER: Male │ 13│
2684 ├────────────────────────────────────────────────┼─────┤
2685 │Mexican S3a. GENDER: Male │ 175│
2687 ├────────────────────────────────────────────────┼─────┤
2688 │Spanish S3a. GENDER: Male │ 20│
2690 ├────────────────────────────────────────────────┼─────┤
2691 │South American S3a. GENDER: Male │ 21│
2693 ├────────────────────────────────────────────────┼─────┤
2694 │Central American S3a. GENDER: Male │ 27│
2696 ├────────────────────────────────────────────────┼─────┤
2697 │Puerto Rican, OR S3a. GENDER: Male │ 37│
2699 ├────────────────────────────────────────────────┼─────┤
2700 │Something else S3a. GENDER: Male │ 35│
2702 ├────────────────────────────────────────────────┼─────┤
2703 │Multiple - cannot choose one S3a. GENDER: Male │ 2│
2705 ╰────────────────────────────────────────────────┴─────╯
2708 ╭───────────────────────────────────┬─────╮
2710 ├───────────────────────────────────┼─────┤
2713 ├───────────────────────────────────┼─────┤
2714 │Mexican Male │ 175│
2716 ├───────────────────────────────────┼─────┤
2719 ├───────────────────────────────────┼─────┤
2720 │South American Male │ 21│
2722 ├───────────────────────────────────┼─────┤
2723 │Central American Male │ 27│
2725 ├───────────────────────────────────┼─────┤
2726 │Puerto Rican, OR Male │ 37│
2728 ├───────────────────────────────────┼─────┤
2729 │Something else Male │ 35│
2731 ├───────────────────────────────────┼─────┤
2732 │Multiple - cannot choose one Male │ 2│
2734 ╰───────────────────────────────────┴─────╯
2738 AT_SETUP([CTABLES FORMAT EMPTY])
2739 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2740 AT_DATA([ctables.sps],
2742 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2743 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2744 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2746 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2748 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2749 │ │ D5. ETHNICITY: Are you of │
2750 │ │ Hispanic or Latino origin or │
2752 │ ├───────────────┬───────────────┤
2754 │ ├───────────────┼───────────────┤
2756 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2757 │D5a. What would you say is Cuban │ 20│ 0│
2758 │your primary ethnic Mexican │ 311│ 0│
2759 │background? Spanish │ 48│ 0│
2760 │ South American │ 34│ 0│
2761 │ Central American│ 52│ 0│
2762 │ Puerto Rican, OR│ 78│ 0│
2763 │ Something else │ 68│ 0│
2764 │ Multiple - │ 7│ 0│
2765 │ cannot choose │ │ │
2767 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2770 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2771 │ │ D5. ETHNICITY: Are you of │
2772 │ │ Hispanic or Latino origin or │
2774 │ ├───────────────┬───────────────┤
2776 │ ├───────────────┼───────────────┤
2778 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2779 │D5a. What would you say is Cuban │ 20│ │
2780 │your primary ethnic Mexican │ 311│ │
2781 │background? Spanish │ 48│ │
2782 │ South American │ 34│ │
2783 │ Central American│ 52│ │
2784 │ Puerto Rican, OR│ 78│ │
2785 │ Something else │ 68│ │
2787 │ cannot choose │ │ │
2789 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2792 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2793 │ │ D5. ETHNICITY: Are you of │
2794 │ │ Hispanic or Latino origin or │
2796 │ ├───────────────┬───────────────┤
2798 │ ├───────────────┼───────────────┤
2800 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2801 │D5a. What would you say is Cuban │ 20│n/a │
2802 │your primary ethnic Mexican │ 311│n/a │
2803 │background? Spanish │ 48│n/a │
2804 │ South American │ 34│n/a │
2805 │ Central American│ 52│n/a │
2806 │ Puerto Rican, OR│ 78│n/a │
2807 │ Something else │ 68│n/a │
2808 │ Multiple - │ 7│n/a │
2809 │ cannot choose │ │ │
2811 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2815 AT_SETUP([CTABLES FORMAT MISSING])
2816 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2817 AT_DATA([ctables.sps],
2819 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2821 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2823 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2824 │ │ D5. ETHNICITY: Are you of │
2825 │ │ Hispanic or Latino origin or │
2827 │ ├───────────────┬───────────────┤
2829 │ ├───────────────┼───────────────┤
2830 │ │ Column % │ Column % │
2831 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2832 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2833 │your primary ethnic Mexican │ 50.3%│(no data) │
2834 │background? Spanish │ 7.8%│(no data) │
2835 │ South American │ 5.5%│(no data) │
2836 │ Central American│ 8.4%│(no data) │
2837 │ Puerto Rican, OR│ 12.6%│(no data) │
2838 │ Something else │ 11.0%│(no data) │
2839 │ Multiple - │ 1.1%│(no data) │
2840 │ cannot choose │ │ │
2842 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2846 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2847 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2848 AT_DATA([ctables.sps],
2850 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2851 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2852 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2854 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2856 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2858 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2859 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2860 │occasion? 1 │ 491│ 34.9%│
2880 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2883 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2885 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2886 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2887 │occasion? 1 │ 491│ 34.9%│
2907 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2910 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2912 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2913 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2914 │occasion? 1 │ 491│ 34.9%│
2934 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2938 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2939 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2940 AT_DATA([ctables.sps],
2942 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2944 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2956 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2957 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2958 maximumColumnWidth="192"
2959 minimumColumnWidth="96"
2963 AT_SETUP([CTABLES special formats])
2964 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2965 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2966 AT_DATA([ctables.sps],
2968 COMPUTE x = qnd3 - 4.
2969 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].
2971 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2973 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2974 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2975 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2976 │x│(3.0) │N=-3.0 │(-3.0) │(-3.0%)│8.0 │N=8.0 │(8.0) │(8.0%) │
2977 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2981 AT_SETUP([CTABLES TITLES])
2982 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2983 AT_DATA([ctables.sps],
2986 /VLABELS VARIABLES=qn1 DISPLAY=NONE
2987 /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2988 /TITLES TITLE='How often do you drive?'
2989 CAPTION='Generated )TIME on )DATE'
2992 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
2993 s&../../..&MM/DD/YY&'], [0], [dnl
2994 How often do you drive?
2995 ╭───────────────────────────────────┬─────────────────────────────────────────╮
2997 │ ├────────────────────┬────────────────────┤
2999 │ ├────────────────────┼────────────────────┤
3000 │ │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3001 │ │ you of Hispanic or │ you of Hispanic or │
3002 │ │ Latino origin or │ Latino origin or │
3003 │( ( 1. How often do you usually │ descent? │ descent? │
3004 │drive a car or other motor ├─────────┬──────────┼─────────┬──────────┤
3005 │vehicle?) ) BY S3a. GENDER: > D5. │ Yes │ No │ Yes │ No │
3006 │ETHNICITY: Are you of Hispanic or ├─────────┼──────────┼─────────┼──────────┤
3007 │Latino origin or descent? │ Count │ Count │ Count │ Count │
3008 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3009 │Every day │ 218│ 2066│ 166│ 2175│
3010 │Several days a week │ 44│ 391│ 45│ 782│
3011 │Once a week or less │ 16│ 109│ 12│ 223│
3012 │Only certain times a year │ 15│ 41│ 11│ 61│
3013 │Never │ 39│ 150│ 56│ 278│
3014 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3015 Generated HH:MM:SS on MM/DD/YY
3019 AT_SETUP([CTABLES area definitions])
3020 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3021 AT_DATA([ctables.sps],
3024 /VLABELS VARIABLES=ALL DISPLAY=NAME
3025 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3026 /SLABELS POSITION=ROW
3027 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROWID, LAYERROWID]
3028 /SLABELS POSITION=ROW
3029 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COLID, LAYERCOLID]
3030 /SLABELS POSITION=ROW.
3032 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3035 ╭─────────────────────────────┬─────────────┬──────╮
3037 │ ├──────┬──────┼───┬──┤
3039 │ ├──────┼──────┤ │ │
3040 │ │ QN86 │ QN86 │ │ │
3041 │ ├───┬──┼───┬──┤ │ │
3042 │ │Yes│No│Yes│No│Yes│No│
3043 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3044 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3045 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3046 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
3047 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3048 │ No 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 QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3053 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3054 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
3055 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3056 │ No 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 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3063 ╭─────────────────────────────┬─────────────┬──────╮
3065 │ ├──────┬──────┼───┬──┤
3067 │ ├──────┼──────┤ │ │
3068 │ │ QN86 │ QN86 │ │ │
3069 │ ├───┬──┼───┬──┤ │ │
3070 │ │Yes│No│Yes│No│Yes│No│
3071 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3072 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3073 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3074 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
3075 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3076 │ No 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 QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3081 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3082 │ Subtable ID│ 10│10│ 11│11│ 12│12│
3083 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3084 │ No 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 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3091 ╭──────────────────────────────┬─────────────┬──────╮
3093 │ ├──────┬──────┼───┬──┤
3095 │ ├──────┼──────┤ │ │
3096 │ │ QN86 │ QN86 │ │ │
3097 │ ├───┬──┼───┬──┤ │ │
3098 │ │Yes│No│Yes│No│Yes│No│
3099 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3100 │QN61 Yes QN57 Yes Row ID │ 1│ 1│ 2│ 2│ 3│ 3│
3101 │ Layer Row ID│ 1│ 1│ 1│ 1│ 2│ 2│
3102 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3103 │ No Row ID │ 4│ 4│ 5│ 5│ 6│ 6│
3104 │ Layer Row ID│ 3│ 3│ 3│ 3│ 4│ 4│
3105 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3106 │ No QN57 Yes Row ID │ 7│ 7│ 8│ 8│ 9│ 9│
3107 │ Layer Row ID│ 5│ 5│ 5│ 5│ 6│ 6│
3108 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3109 │ No Row ID │ 10│10│ 11│11│ 12│12│
3110 │ Layer Row ID│ 7│ 7│ 7│ 7│ 8│ 8│
3111 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3115 ╭──────────────────────────────┬─────────────┬──────╮
3117 │ ├──────┬──────┼───┬──┤
3119 │ ├──────┼──────┤ │ │
3120 │ │ QN86 │ QN86 │ │ │
3121 │ ├───┬──┼───┬──┤ │ │
3122 │ │Yes│No│Yes│No│Yes│No│
3123 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3124 │QN61 Yes QN57 Yes Row ID │ 13│13│ 14│14│ 15│15│
3125 │ Layer Row ID│ 9│ 9│ 9│ 9│ 10│10│
3126 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3127 │ No Row ID │ 16│16│ 17│17│ 18│18│
3128 │ Layer Row ID│ 11│11│ 11│11│ 12│12│
3129 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3130 │ No QN57 Yes Row ID │ 19│19│ 20│20│ 21│21│
3131 │ Layer Row ID│ 13│13│ 13│13│ 14│14│
3132 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3133 │ No Row ID │ 22│22│ 23│23│ 24│24│
3134 │ Layer Row ID│ 15│15│ 15│15│ 16│16│
3135 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3139 ╭─────────────────────────────────┬─────────────┬──────╮
3141 │ ├──────┬──────┼───┬──┤
3143 │ ├──────┼──────┤ │ │
3144 │ │ QN86 │ QN86 │ │ │
3145 │ ├───┬──┼───┬──┤ │ │
3146 │ │Yes│No│Yes│No│Yes│No│
3147 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3148 │QN61 Yes QN57 Yes Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3149 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3150 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3151 │ No Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3152 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3153 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3154 │ No QN57 Yes Column ID │ 7│ 8│ 9│10│ 11│12│
3155 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3156 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3157 │ No Column ID │ 7│ 8│ 9│10│ 11│12│
3158 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3159 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3163 ╭─────────────────────────────────┬─────────────┬──────╮
3165 │ ├──────┬──────┼───┬──┤
3167 │ ├──────┼──────┤ │ │
3168 │ │ QN86 │ QN86 │ │ │
3169 │ ├───┬──┼───┬──┤ │ │
3170 │ │Yes│No│Yes│No│Yes│No│
3171 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3172 │QN61 Yes QN57 Yes Column ID │ 13│14│ 15│16│ 17│18│
3173 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3174 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3175 │ No Column ID │ 13│14│ 15│16│ 17│18│
3176 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3177 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3178 │ No QN57 Yes Column ID │ 19│20│ 21│22│ 23│24│
3179 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3180 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3181 │ No Column ID │ 19│20│ 21│22│ 23│24│
3182 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3183 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3187 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=OPPOSITE])
3188 AT_KEYWORDS([ROWLABELS OPPOSITE])
3189 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3190 AT_DATA([ctables.sps],
3193 /VLABELS VARIABLES=ALL DISPLAY=NAME
3194 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3195 /SLABELS POSITION=ROW
3196 /CLABELS ROWLABELS=OPPOSITE
3197 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3198 /SLABELS POSITION=ROW
3199 /CLABELS ROWLABELS=OPPOSITE
3200 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3201 /SLABELS POSITION=ROW
3202 /CLABELS ROWLABELS=OPPOSITE.
3204 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3207 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3209 │ ├───────────────────────────┬───────────────────────────┤
3211 │ ├───────────────────────────┼───────────────────────────┤
3213 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3214 │ │ Yes │ No │ Yes │ No │
3215 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3216 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3217 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3218 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3219 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3220 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3221 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3222 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3223 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3224 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│ 4│ 4│ 5│ 5│ 6│ 6│ 7│ 7│ 8│ 8│
3225 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3226 │ No 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 QN61 Yes 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│ 9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3233 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3234 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3241 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3243 │ ├───────────────────────────┬───────────────────────────┤
3245 │ ├───────────────────────────┼───────────────────────────┤
3247 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3248 │ │ Yes │ No │ Yes │ No │
3249 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3250 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3251 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3252 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3253 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3254 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3255 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3256 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3257 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3258 │ Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3259 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3260 │ No 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 QN61 Yes 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│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3267 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3268 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3275 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3277 │ ├───────────────────────────┬───────────────────────────┤
3279 │ ├───────────────────────────┼───────────────────────────┤
3281 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3282 │ │ Yes │ No │ Yes │ No │
3283 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3284 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3285 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3286 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3287 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3288 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3289 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3290 │QN26 Yes QN61 Yes QN57 Row ID │ 1│ 1│ 2│ 2│ 3│ 3│ 4│ 4│ 5│ 5│ 6│ 6│ 7│ 7│ 8│ 8│
3291 │ Layer Row ID│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3292 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3293 │ No QN57 Row ID │ 9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3294 │ Layer Row ID│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3295 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3296 │ No QN61 Yes QN57 Row ID │ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3297 │ Layer Row ID│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3298 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3299 │ No QN57 Row ID │ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3300 │ Layer Row ID│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3301 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3305 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3307 │ ├───────────────────────────┬───────────────────────────┤
3309 │ ├───────────────────────────┼───────────────────────────┤
3311 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3312 │ │ Yes │ No │ Yes │ No │
3313 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3314 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3315 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3316 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3317 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3318 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3319 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3320 │QN26 Yes QN61 Yes QN57 Row ID │ 33│33│ 34│34│ 35│35│ 36│36│ 37│37│ 38│38│ 39│39│ 40│40│
3321 │ Layer Row ID│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│
3322 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3323 │ No QN57 Row ID │ 41│41│ 42│42│ 43│43│ 44│44│ 45│45│ 46│46│ 47│47│ 48│48│
3324 │ Layer Row ID│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│
3325 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3326 │ No QN61 Yes QN57 Row ID │ 49│49│ 50│50│ 51│51│ 52│52│ 53│53│ 54│54│ 55│55│ 56│56│
3327 │ Layer Row ID│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│
3328 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3329 │ No QN57 Row ID │ 57│57│ 58│58│ 59│59│ 60│60│ 61│61│ 62│62│ 63│63│ 64│64│
3330 │ Layer Row ID│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│
3331 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3335 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3337 │ ├───────────────────────────┬───────────────────────────┤
3339 │ ├───────────────────────────┼───────────────────────────┤
3341 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3342 │ │ Yes │ No │ Yes │ No │
3343 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3344 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3345 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3346 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3347 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3348 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3349 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3350 │QN26 Yes QN61 Yes QN57 Column ID │ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3351 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3352 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3353 │ No QN57 Column ID │ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3354 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3355 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3356 │ No QN61 Yes QN57 Column ID │ 18│17│ 19│20│ 22│21│ 23│24│ 25│26│ 27│28│ 29│30│ 32│31│
3357 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3358 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3359 │ No QN57 Column ID │ 18│17│ 19│20│ 22│21│ 23│24│ 25│26│ 27│28│ 29│30│ 32│31│
3360 │ Layer Column ID│ 1│ 2│ 4│ 3│ 6│ 5│ 8│ 7│ 9│10│ 11│12│ 14│13│ 15│16│
3361 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3365 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3367 │ ├───────────────────────────┬───────────────────────────┤
3369 │ ├───────────────────────────┼───────────────────────────┤
3371 │ ├─────────────┬─────────────┼─────────────┬─────────────┤
3372 │ │ Yes │ No │ Yes │ No │
3373 │ ├─────────────┼─────────────┼─────────────┼─────────────┤
3374 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3375 │ ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3376 │ │ Yes │ No │ Yes │ No │ Yes │ No │ Yes │ No │
3377 │ ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3378 │ │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3379 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3380 │QN26 Yes QN61 Yes QN57 Column ID │ 33│34│ 36│35│ 37│38│ 39│40│ 42│41│ 44│43│ 45│46│ 47│48│
3381 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3382 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3383 │ No QN57 Column ID │ 33│34│ 36│35│ 37│38│ 39│40│ 42│41│ 44│43│ 45│46│ 47│48│
3384 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3385 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3386 │ No QN61 Yes QN57 Column ID │ 49│50│ 51│52│ 54│53│ 56│55│ 57│58│ 60│59│ 62│61│ 64│63│
3387 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3388 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3389 │ No QN57 Column ID │ 49│50│ 51│52│ 54│53│ 56│55│ 57│58│ 60│59│ 62│61│ 64│63│
3390 │ Layer Column ID│ 17│18│ 20│19│ 21│22│ 23│24│ 26│25│ 28│27│ 29│30│ 31│32│
3391 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3395 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=OPPOSITE])
3396 AT_KEYWORDS([COLLABELS OPPOSITE])
3397 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3398 AT_DATA([ctables.sps],
3401 /VLABELS VARIABLES=ALL DISPLAY=NAME
3402 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3403 /SLABELS POSITION=ROW
3404 /CLABELS COLLABELS=OPPOSITE
3405 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3406 /SLABELS POSITION=ROW
3407 /CLABELS COLLABELS=OPPOSITE
3408 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3409 /SLABELS POSITION=ROW
3410 /CLABELS COLLABELS=OPPOSITE.
3412 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3415 ╭──────────────────────────────────────────┬───────────────────╮
3417 │ ├─────────┬─────────┤
3419 │ ├─────────┼─────────┤
3421 │ ├────┬────┼────┬────┤
3422 │ │ Yes│ No │ Yes│ No │
3423 │ ├────┼────┼────┼────┤
3424 │ │QN86│QN86│QN86│QN86│
3425 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3426 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3427 │ Layer ID │ 1│ 1│ 1│ 1│
3428 │ Subtable ID│ 1│ 1│ 2│ 2│
3429 │ ╶───────────────┼────┼────┼────┼────┤
3430 │ No Table ID │ 1│ 1│ 1│ 1│
3431 │ Layer ID │ 1│ 1│ 1│ 1│
3432 │ Subtable ID│ 1│ 1│ 2│ 2│
3433 │ ╶───────────────────┼────┼────┼────┼────┤
3434 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3435 │ Layer ID │ 1│ 1│ 1│ 1│
3436 │ Subtable ID│ 3│ 3│ 4│ 4│
3437 │ ╶───────────────┼────┼────┼────┼────┤
3438 │ No Table ID │ 1│ 1│ 1│ 1│
3439 │ Layer ID │ 1│ 1│ 1│ 1│
3440 │ Subtable ID│ 3│ 3│ 4│ 4│
3441 │ ╶────────────────────────────┼────┼────┼────┼────┤
3442 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3443 │ Layer ID │ 1│ 1│ 1│ 1│
3444 │ Subtable ID│ 5│ 5│ 6│ 6│
3445 │ ╶───────────────┼────┼────┼────┼────┤
3446 │ No Table ID │ 1│ 1│ 1│ 1│
3447 │ Layer ID │ 1│ 1│ 1│ 1│
3448 │ Subtable ID│ 5│ 5│ 6│ 6│
3449 │ ╶───────────────────┼────┼────┼────┼────┤
3450 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3451 │ Layer ID │ 1│ 1│ 1│ 1│
3452 │ Subtable ID│ 7│ 7│ 8│ 8│
3453 │ ╶───────────────┼────┼────┼────┼────┤
3454 │ No Table ID │ 1│ 1│ 1│ 1│
3455 │ Layer ID │ 1│ 1│ 1│ 1│
3456 │ Subtable ID│ 7│ 7│ 8│ 8│
3457 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
3458 │ No QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3459 │ Layer ID │ 1│ 1│ 1│ 1│
3460 │ Subtable ID│ 9│ 9│ 10│ 10│
3461 │ ╶───────────────┼────┼────┼────┼────┤
3462 │ No Table ID │ 1│ 1│ 1│ 1│
3463 │ Layer ID │ 1│ 1│ 1│ 1│
3464 │ Subtable ID│ 9│ 9│ 10│ 10│
3465 │ ╶───────────────────┼────┼────┼────┼────┤
3466 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3467 │ Layer ID │ 1│ 1│ 1│ 1│
3468 │ Subtable ID│ 11│ 11│ 12│ 12│
3469 │ ╶───────────────┼────┼────┼────┼────┤
3470 │ No Table ID │ 1│ 1│ 1│ 1│
3471 │ Layer ID │ 1│ 1│ 1│ 1│
3472 │ Subtable ID│ 11│ 11│ 12│ 12│
3473 │ ╶────────────────────────────┼────┼────┼────┼────┤
3474 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3475 │ Layer ID │ 1│ 1│ 1│ 1│
3476 │ Subtable ID│ 13│ 13│ 14│ 14│
3477 │ ╶───────────────┼────┼────┼────┼────┤
3478 │ No Table ID │ 1│ 1│ 1│ 1│
3479 │ Layer ID │ 1│ 1│ 1│ 1│
3480 │ Subtable ID│ 13│ 13│ 14│ 14│
3481 │ ╶───────────────────┼────┼────┼────┼────┤
3482 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3483 │ Layer ID │ 1│ 1│ 1│ 1│
3484 │ Subtable ID│ 15│ 15│ 16│ 16│
3485 │ ╶───────────────┼────┼────┼────┼────┤
3486 │ No Table ID │ 1│ 1│ 1│ 1│
3487 │ Layer ID │ 1│ 1│ 1│ 1│
3488 │ Subtable ID│ 15│ 15│ 16│ 16│
3489 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3493 ╭──────────────────────────────────────────┬───────────────────╮
3495 │ ├─────────┬─────────┤
3497 │ ├─────────┼─────────┤
3499 │ ├────┬────┼────┬────┤
3500 │ │ Yes│ No │ Yes│ No │
3501 │ ├────┼────┼────┼────┤
3502 │ │QN86│QN86│QN86│QN86│
3503 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3504 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3505 │ Layer ID │ 2│ 2│ 2│ 2│
3506 │ Subtable ID│ 17│ 17│ 18│ 18│
3507 │ ╶───────────────┼────┼────┼────┼────┤
3508 │ No Table ID │ 1│ 1│ 1│ 1│
3509 │ Layer ID │ 2│ 2│ 2│ 2│
3510 │ Subtable ID│ 17│ 17│ 18│ 18│
3511 │ ╶───────────────────┼────┼────┼────┼────┤
3512 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3513 │ Layer ID │ 2│ 2│ 2│ 2│
3514 │ Subtable ID│ 19│ 19│ 20│ 20│
3515 │ ╶───────────────┼────┼────┼────┼────┤
3516 │ No Table ID │ 1│ 1│ 1│ 1│
3517 │ Layer ID │ 2│ 2│ 2│ 2│
3518 │ Subtable ID│ 19│ 19│ 20│ 20│
3519 │ ╶────────────────────────────┼────┼────┼────┼────┤
3520 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3521 │ Layer ID │ 2│ 2│ 2│ 2│
3522 │ Subtable ID│ 21│ 21│ 22│ 22│
3523 │ ╶───────────────┼────┼────┼────┼────┤
3524 │ No Table ID │ 1│ 1│ 1│ 1│
3525 │ Layer ID │ 2│ 2│ 2│ 2│
3526 │ Subtable ID│ 21│ 21│ 22│ 22│
3527 │ ╶───────────────────┼────┼────┼────┼────┤
3528 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3529 │ Layer ID │ 2│ 2│ 2│ 2│
3530 │ Subtable ID│ 23│ 23│ 24│ 24│
3531 │ ╶───────────────┼────┼────┼────┼────┤
3532 │ No Table ID │ 1│ 1│ 1│ 1│
3533 │ Layer ID │ 2│ 2│ 2│ 2│
3534 │ Subtable ID│ 23│ 23│ 24│ 24│
3535 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
3536 │ No QN61 Yes QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3537 │ Layer ID │ 2│ 2│ 2│ 2│
3538 │ Subtable ID│ 25│ 25│ 26│ 26│
3539 │ ╶───────────────┼────┼────┼────┼────┤
3540 │ No Table ID │ 1│ 1│ 1│ 1│
3541 │ Layer ID │ 2│ 2│ 2│ 2│
3542 │ Subtable ID│ 25│ 25│ 26│ 26│
3543 │ ╶───────────────────┼────┼────┼────┼────┤
3544 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3545 │ Layer ID │ 2│ 2│ 2│ 2│
3546 │ Subtable ID│ 27│ 27│ 28│ 28│
3547 │ ╶───────────────┼────┼────┼────┼────┤
3548 │ No Table ID │ 1│ 1│ 1│ 1│
3549 │ Layer ID │ 2│ 2│ 2│ 2│
3550 │ Subtable ID│ 27│ 27│ 28│ 28│
3551 │ ╶────────────────────────────┼────┼────┼────┼────┤
3552 │ No QN57 Yes Yes Table ID │ 1│ 1│ 1│ 1│
3553 │ Layer ID │ 2│ 2│ 2│ 2│
3554 │ Subtable ID│ 29│ 29│ 30│ 30│
3555 │ ╶───────────────┼────┼────┼────┼────┤
3556 │ No Table ID │ 1│ 1│ 1│ 1│
3557 │ Layer ID │ 2│ 2│ 2│ 2│
3558 │ Subtable ID│ 29│ 29│ 30│ 30│
3559 │ ╶───────────────────┼────┼────┼────┼────┤
3560 │ No Yes Table ID │ 1│ 1│ 1│ 1│
3561 │ Layer ID │ 2│ 2│ 2│ 2│
3562 │ Subtable ID│ 31│ 31│ 32│ 32│
3563 │ ╶───────────────┼────┼────┼────┼────┤
3564 │ No Table ID │ 1│ 1│ 1│ 1│
3565 │ Layer ID │ 2│ 2│ 2│ 2│
3566 │ Subtable ID│ 31│ 31│ 32│ 32│
3567 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3571 ╭───────────────────────────────────────────┬───────────────────╮
3573 │ ├─────────┬─────────┤
3575 │ ├─────────┼─────────┤
3577 │ ├────┬────┼────┬────┤
3578 │ │ Yes│ No │ Yes│ No │
3579 │ ├────┼────┼────┼────┤
3580 │ │QN86│QN86│QN86│QN86│
3581 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3582 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID │ 1│ 1│ 3│ 3│
3583 │ Layer Row ID│ 1│ 1│ 1│ 1│
3584 │ ╶────────────────┼────┼────┼────┼────┤
3585 │ No Row ID │ 2│ 2│ 4│ 4│
3586 │ Layer Row ID│ 2│ 2│ 2│ 2│
3587 │ ╶────────────────────┼────┼────┼────┼────┤
3588 │ No Yes Row ID │ 6│ 6│ 7│ 7│
3589 │ Layer Row ID│ 4│ 4│ 4│ 4│
3590 │ ╶────────────────┼────┼────┼────┼────┤
3591 │ No Row ID │ 5│ 5│ 8│ 8│
3592 │ Layer Row ID│ 3│ 3│ 3│ 3│
3593 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3594 │ No QN57 Yes Yes Row ID │ 10│ 10│ 11│ 11│
3595 │ Layer Row ID│ 6│ 6│ 6│ 6│
3596 │ ╶────────────────┼────┼────┼────┼────┤
3597 │ No Row ID │ 9│ 9│ 12│ 12│
3598 │ Layer Row ID│ 5│ 5│ 5│ 5│
3599 │ ╶────────────────────┼────┼────┼────┼────┤
3600 │ No Yes Row ID │ 13│ 13│ 15│ 15│
3601 │ Layer Row ID│ 7│ 7│ 7│ 7│
3602 │ ╶────────────────┼────┼────┼────┼────┤
3603 │ No Row ID │ 14│ 14│ 16│ 16│
3604 │ Layer Row ID│ 8│ 8│ 8│ 8│
3605 │ ╶──────────────────────────────────────┼────┼────┼────┼────┤
3606 │ No QN61 Yes QN57 Yes Yes Row ID │ 17│ 17│ 20│ 20│
3607 │ Layer Row ID│ 9│ 9│ 9│ 9│
3608 │ ╶────────────────┼────┼────┼────┼────┤
3609 │ No Row ID │ 18│ 18│ 19│ 19│
3610 │ Layer Row ID│ 10│ 10│ 10│ 10│
3611 │ ╶────────────────────┼────┼────┼────┼────┤
3612 │ No Yes Row ID │ 21│ 21│ 24│ 24│
3613 │ Layer Row ID│ 11│ 11│ 11│ 11│
3614 │ ╶────────────────┼────┼────┼────┼────┤
3615 │ No Row ID │ 22│ 22│ 23│ 23│
3616 │ Layer Row ID│ 12│ 12│ 12│ 12│
3617 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3618 │ No QN57 Yes Yes Row ID │ 25│ 25│ 27│ 27│
3619 │ Layer Row ID│ 13│ 13│ 13│ 13│
3620 │ ╶────────────────┼────┼────┼────┼────┤
3621 │ No Row ID │ 26│ 26│ 28│ 28│
3622 │ Layer Row ID│ 14│ 14│ 14│ 14│
3623 │ ╶────────────────────┼────┼────┼────┼────┤
3624 │ No Yes Row ID │ 30│ 30│ 32│ 32│
3625 │ Layer Row ID│ 16│ 16│ 16│ 16│
3626 │ ╶────────────────┼────┼────┼────┼────┤
3627 │ No Row ID │ 29│ 29│ 31│ 31│
3628 │ Layer Row ID│ 15│ 15│ 15│ 15│
3629 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3633 ╭───────────────────────────────────────────┬───────────────────╮
3635 │ ├─────────┬─────────┤
3637 │ ├─────────┼─────────┤
3639 │ ├────┬────┼────┬────┤
3640 │ │ Yes│ No │ Yes│ No │
3641 │ ├────┼────┼────┼────┤
3642 │ │QN86│QN86│QN86│QN86│
3643 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3644 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID │ 34│ 34│ 35│ 35│
3645 │ Layer Row ID│ 18│ 18│ 18│ 18│
3646 │ ╶────────────────┼────┼────┼────┼────┤
3647 │ No Row ID │ 33│ 33│ 36│ 36│
3648 │ Layer Row ID│ 17│ 17│ 17│ 17│
3649 │ ╶────────────────────┼────┼────┼────┼────┤
3650 │ No Yes Row ID │ 38│ 38│ 39│ 39│
3651 │ Layer Row ID│ 20│ 20│ 20│ 20│
3652 │ ╶────────────────┼────┼────┼────┼────┤
3653 │ No Row ID │ 37│ 37│ 40│ 40│
3654 │ Layer Row ID│ 19│ 19│ 19│ 19│
3655 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3656 │ No QN57 Yes Yes Row ID │ 42│ 42│ 43│ 43│
3657 │ Layer Row ID│ 22│ 22│ 22│ 22│
3658 │ ╶────────────────┼────┼────┼────┼────┤
3659 │ No Row ID │ 41│ 41│ 44│ 44│
3660 │ Layer Row ID│ 21│ 21│ 21│ 21│
3661 │ ╶────────────────────┼────┼────┼────┼────┤
3662 │ No Yes Row ID │ 45│ 45│ 47│ 47│
3663 │ Layer Row ID│ 23│ 23│ 23│ 23│
3664 │ ╶────────────────┼────┼────┼────┼────┤
3665 │ No Row ID │ 46│ 46│ 48│ 48│
3666 │ Layer Row ID│ 24│ 24│ 24│ 24│
3667 │ ╶──────────────────────────────────────┼────┼────┼────┼────┤
3668 │ No QN61 Yes QN57 Yes Yes Row ID │ 50│ 50│ 51│ 51│
3669 │ Layer Row ID│ 26│ 26│ 26│ 26│
3670 │ ╶────────────────┼────┼────┼────┼────┤
3671 │ No Row ID │ 49│ 49│ 52│ 52│
3672 │ Layer Row ID│ 25│ 25│ 25│ 25│
3673 │ ╶────────────────────┼────┼────┼────┼────┤
3674 │ No Yes Row ID │ 53│ 53│ 55│ 55│
3675 │ Layer Row ID│ 27│ 27│ 27│ 27│
3676 │ ╶────────────────┼────┼────┼────┼────┤
3677 │ No Row ID │ 54│ 54│ 56│ 56│
3678 │ Layer Row ID│ 28│ 28│ 28│ 28│
3679 │ ╶─────────────────────────────┼────┼────┼────┼────┤
3680 │ No QN57 Yes Yes Row ID │ 57│ 57│ 59│ 59│
3681 │ Layer Row ID│ 29│ 29│ 29│ 29│
3682 │ ╶────────────────┼────┼────┼────┼────┤
3683 │ No Row ID │ 58│ 58│ 60│ 60│
3684 │ Layer Row ID│ 30│ 30│ 30│ 30│
3685 │ ╶────────────────────┼────┼────┼────┼────┤
3686 │ No Yes Row ID │ 62│ 62│ 64│ 64│
3687 │ Layer Row ID│ 32│ 32│ 32│ 32│
3688 │ ╶────────────────┼────┼────┼────┼────┤
3689 │ No Row ID │ 61│ 61│ 63│ 63│
3690 │ Layer Row ID│ 31│ 31│ 31│ 31│
3691 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3695 ╭──────────────────────────────────────────────┬───────────────────╮
3697 │ ├─────────┬─────────┤
3699 │ ├─────────┼─────────┤
3701 │ ├────┬────┼────┬────┤
3702 │ │ Yes│ No │ Yes│ No │
3703 │ ├────┼────┼────┼────┤
3704 │ │QN86│QN86│QN86│QN86│
3705 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3706 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID │ 1│ 2│ 3│ 4│
3707 │ Layer Column ID│ 1│ 2│ 3│ 4│
3708 │ ╶───────────────────┼────┼────┼────┼────┤
3709 │ No Column ID │ 1│ 2│ 3│ 4│
3710 │ Layer Column ID│ 1│ 2│ 3│ 4│
3711 │ ╶───────────────────────┼────┼────┼────┼────┤
3712 │ No Yes Column ID │ 5│ 6│ 7│ 8│
3713 │ Layer Column ID│ 1│ 2│ 3│ 4│
3714 │ ╶───────────────────┼────┼────┼────┼────┤
3715 │ No Column ID │ 5│ 6│ 7│ 8│
3716 │ Layer Column ID│ 1│ 2│ 3│ 4│
3717 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3718 │ No QN57 Yes Yes Column ID │ 9│ 10│ 11│ 12│
3719 │ Layer Column ID│ 1│ 2│ 3│ 4│
3720 │ ╶───────────────────┼────┼────┼────┼────┤
3721 │ No Column ID │ 9│ 10│ 11│ 12│
3722 │ Layer Column ID│ 1│ 2│ 3│ 4│
3723 │ ╶───────────────────────┼────┼────┼────┼────┤
3724 │ No Yes Column ID │ 13│ 14│ 15│ 16│
3725 │ Layer Column ID│ 1│ 2│ 3│ 4│
3726 │ ╶───────────────────┼────┼────┼────┼────┤
3727 │ No Column ID │ 13│ 14│ 15│ 16│
3728 │ Layer Column ID│ 1│ 2│ 3│ 4│
3729 │ ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3730 │ No QN61 Yes QN57 Yes Yes Column ID │ 17│ 18│ 19│ 20│
3731 │ Layer Column ID│ 1│ 2│ 3│ 4│
3732 │ ╶───────────────────┼────┼────┼────┼────┤
3733 │ No Column ID │ 17│ 18│ 19│ 20│
3734 │ Layer Column ID│ 1│ 2│ 3│ 4│
3735 │ ╶───────────────────────┼────┼────┼────┼────┤
3736 │ No Yes Column ID │ 21│ 22│ 23│ 24│
3737 │ Layer Column ID│ 1│ 2│ 3│ 4│
3738 │ ╶───────────────────┼────┼────┼────┼────┤
3739 │ No Column ID │ 21│ 22│ 23│ 24│
3740 │ Layer Column ID│ 1│ 2│ 3│ 4│
3741 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3742 │ No QN57 Yes Yes Column ID │ 25│ 26│ 27│ 28│
3743 │ Layer Column ID│ 1│ 2│ 3│ 4│
3744 │ ╶───────────────────┼────┼────┼────┼────┤
3745 │ No Column ID │ 25│ 26│ 27│ 28│
3746 │ Layer Column ID│ 1│ 2│ 3│ 4│
3747 │ ╶───────────────────────┼────┼────┼────┼────┤
3748 │ No Yes Column ID │ 29│ 30│ 31│ 32│
3749 │ Layer Column ID│ 1│ 2│ 3│ 4│
3750 │ ╶───────────────────┼────┼────┼────┼────┤
3751 │ No Column ID │ 29│ 30│ 31│ 32│
3752 │ Layer Column ID│ 1│ 2│ 3│ 4│
3753 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3757 ╭──────────────────────────────────────────────┬───────────────────╮
3759 │ ├─────────┬─────────┤
3761 │ ├─────────┼─────────┤
3763 │ ├────┬────┼────┬────┤
3764 │ │ Yes│ No │ Yes│ No │
3765 │ ├────┼────┼────┼────┤
3766 │ │QN86│QN86│QN86│QN86│
3767 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3768 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID │ 33│ 34│ 35│ 36│
3769 │ Layer Column ID│ 5│ 6│ 7│ 8│
3770 │ ╶───────────────────┼────┼────┼────┼────┤
3771 │ No Column ID │ 33│ 34│ 35│ 36│
3772 │ Layer Column ID│ 5│ 6│ 7│ 8│
3773 │ ╶───────────────────────┼────┼────┼────┼────┤
3774 │ No Yes Column ID │ 37│ 38│ 39│ 40│
3775 │ Layer Column ID│ 5│ 6│ 7│ 8│
3776 │ ╶───────────────────┼────┼────┼────┼────┤
3777 │ No Column ID │ 37│ 38│ 39│ 40│
3778 │ Layer Column ID│ 5│ 6│ 7│ 8│
3779 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3780 │ No QN57 Yes Yes Column ID │ 41│ 42│ 43│ 44│
3781 │ Layer Column ID│ 5│ 6│ 7│ 8│
3782 │ ╶───────────────────┼────┼────┼────┼────┤
3783 │ No Column ID │ 41│ 42│ 43│ 44│
3784 │ Layer Column ID│ 5│ 6│ 7│ 8│
3785 │ ╶───────────────────────┼────┼────┼────┼────┤
3786 │ No Yes Column ID │ 45│ 46│ 47│ 48│
3787 │ Layer Column ID│ 5│ 6│ 7│ 8│
3788 │ ╶───────────────────┼────┼────┼────┼────┤
3789 │ No Column ID │ 45│ 46│ 47│ 48│
3790 │ Layer Column ID│ 5│ 6│ 7│ 8│
3791 │ ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3792 │ No QN61 Yes QN57 Yes Yes Column ID │ 49│ 50│ 51│ 52│
3793 │ Layer Column ID│ 5│ 6│ 7│ 8│
3794 │ ╶───────────────────┼────┼────┼────┼────┤
3795 │ No Column ID │ 49│ 50│ 51│ 52│
3796 │ Layer Column ID│ 5│ 6│ 7│ 8│
3797 │ ╶───────────────────────┼────┼────┼────┼────┤
3798 │ No Yes Column ID │ 53│ 54│ 55│ 56│
3799 │ Layer Column ID│ 5│ 6│ 7│ 8│
3800 │ ╶───────────────────┼────┼────┼────┼────┤
3801 │ No Column ID │ 53│ 54│ 55│ 56│
3802 │ Layer Column ID│ 5│ 6│ 7│ 8│
3803 │ ╶────────────────────────────────┼────┼────┼────┼────┤
3804 │ No QN57 Yes Yes Column ID │ 57│ 58│ 59│ 60│
3805 │ Layer Column ID│ 5│ 6│ 7│ 8│
3806 │ ╶───────────────────┼────┼────┼────┼────┤
3807 │ No Column ID │ 57│ 58│ 59│ 60│
3808 │ Layer Column ID│ 5│ 6│ 7│ 8│
3809 │ ╶───────────────────────┼────┼────┼────┼────┤
3810 │ No Yes Column ID │ 61│ 62│ 63│ 64│
3811 │ Layer Column ID│ 5│ 6│ 7│ 8│
3812 │ ╶───────────────────┼────┼────┼────┼────┤
3813 │ No Column ID │ 61│ 62│ 63│ 64│
3814 │ Layer Column ID│ 5│ 6│ 7│ 8│
3815 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3819 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=LAYER])
3820 AT_KEYWORDS([ROWLABELS LAYER])
3821 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3822 AT_DATA([ctables.sps],
3825 /VLABELS VARIABLES=ALL DISPLAY=NAME
3826 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3827 /SLABELS POSITION=ROW
3828 /CLABELS ROWLABELS=LAYER
3829 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3830 /SLABELS POSITION=ROW
3831 /CLABELS ROWLABELS=LAYER
3832 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3833 /SLABELS POSITION=ROW
3834 /CLABELS ROWLABELS=LAYER.
3836 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3840 ╭──────────────────────────────────┬───────────────────────────╮
3842 │ ├─────────────┬─────────────┤
3844 │ ├─────────────┼─────────────┤
3846 │ ├──────┬──────┼──────┬──────┤
3847 │ │ Yes │ No │ Yes │ No │
3848 │ ├──────┼──────┼──────┼──────┤
3849 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3850 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3851 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3852 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3853 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3854 │ Layer ID │ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
3855 │ Subtable ID│ 2│ 2│ 4│ 4│ 6│ 6│ 7│ 7│
3856 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3857 │ No 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 QN61 Yes 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│ 10│10│ 12│12│ 13│13│ 15│15│
3864 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3865 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3873 ╭──────────────────────────────────┬───────────────────────────╮
3875 │ ├─────────────┬─────────────┤
3877 │ ├─────────────┼─────────────┤
3879 │ ├──────┬──────┼──────┬──────┤
3880 │ │ Yes │ No │ Yes │ No │
3881 │ ├──────┼──────┼──────┼──────┤
3882 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3883 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3884 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3885 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3886 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3887 │ Layer ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3888 │ Subtable ID│ 1│ 1│ 3│ 3│ 5│ 5│ 8│ 8│
3889 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3890 │ No 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 QN61 Yes 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│ 9│ 9│ 11│11│ 14│14│ 16│16│
3897 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3898 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3906 ╭──────────────────────────────────┬───────────────────────────╮
3908 │ ├─────────────┬─────────────┤
3910 │ ├─────────────┼─────────────┤
3912 │ ├──────┬──────┼──────┬──────┤
3913 │ │ Yes │ No │ Yes │ No │
3914 │ ├──────┼──────┼──────┼──────┤
3915 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3916 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3917 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3918 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3919 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3920 │ Layer ID │ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3921 │ Subtable ID│ 18│18│ 20│20│ 21│21│ 23│23│
3922 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3923 │ No 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 QN61 Yes 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│ 26│26│ 27│27│ 30│30│ 31│31│
3930 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3931 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3939 ╭──────────────────────────────────┬───────────────────────────╮
3941 │ ├─────────────┬─────────────┤
3943 │ ├─────────────┼─────────────┤
3945 │ ├──────┬──────┼──────┬──────┤
3946 │ │ Yes │ No │ Yes │ No │
3947 │ ├──────┼──────┼──────┼──────┤
3948 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3949 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3950 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3951 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3952 │QN26 Yes QN61 Yes QN57 Table ID │ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3953 │ Layer ID │ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
3954 │ Subtable ID│ 17│17│ 19│19│ 22│22│ 24│24│
3955 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3956 │ No 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 QN61 Yes 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│ 25│25│ 28│28│ 29│29│ 32│32│
3963 │ ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3964 │ No 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 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3972 ╭───────────────────────────────────┬───────────────────────────╮
3974 │ ├─────────────┬─────────────┤
3976 │ ├─────────────┼─────────────┤
3978 │ ├──────┬──────┼──────┬──────┤
3979 │ │ Yes │ No │ Yes │ No │
3980 │ ├──────┼──────┼──────┼──────┤
3981 │ │ QN86 │ QN86 │ QN86 │ QN86 │
3982 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
3983 │ │Yes│No│Yes│No│Yes│No│Yes│No│
3984 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3985 │QN26 Yes QN61 Yes QN57 Row ID │ 1│ 1│ 3│ 3│ 6│ 6│ 7│ 7│
3986 │ Layer Row ID│ 1│ 1│ 1│ 1│ 1│ 1│ 1│ 1│
3987 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3988 │ No QN57 Row ID │ 10│10│ 11│11│ 13│13│ 15│15│
3989 │ Layer Row ID│ 4│ 4│ 4│ 4│ 4│ 4│ 4│ 4│
3990 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3991 │ No QN61 Yes QN57 Row ID │ 17│17│ 20│20│ 21│21│ 24│24│
3992 │ Layer Row ID│ 5│ 5│ 5│ 5│ 5│ 5│ 5│ 5│
3993 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3994 │ No QN57 Row ID │ 25│25│ 28│28│ 30│30│ 31│31│
3995 │ Layer Row ID│ 7│ 7│ 7│ 7│ 7│ 7│ 7│ 7│
3996 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4001 ╭───────────────────────────────────┬───────────────────────────╮
4003 │ ├─────────────┬─────────────┤
4005 │ ├─────────────┼─────────────┤
4007 │ ├──────┬──────┼──────┬──────┤
4008 │ │ Yes │ No │ Yes │ No │
4009 │ ├──────┼──────┼──────┼──────┤
4010 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4011 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4012 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4013 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4014 │QN26 Yes QN61 Yes QN57 Row ID │ 2│ 2│ 4│ 4│ 5│ 5│ 8│ 8│
4015 │ Layer Row ID│ 2│ 2│ 2│ 2│ 2│ 2│ 2│ 2│
4016 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4017 │ No QN57 Row ID │ 9│ 9│ 12│12│ 14│14│ 16│16│
4018 │ Layer Row ID│ 3│ 3│ 3│ 3│ 3│ 3│ 3│ 3│
4019 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4020 │ No QN61 Yes QN57 Row ID │ 18│18│ 19│19│ 22│22│ 23│23│
4021 │ Layer Row ID│ 6│ 6│ 6│ 6│ 6│ 6│ 6│ 6│
4022 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4023 │ No QN57 Row ID │ 26│26│ 27│27│ 29│29│ 32│32│
4024 │ Layer Row ID│ 8│ 8│ 8│ 8│ 8│ 8│ 8│ 8│
4025 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4030 ╭───────────────────────────────────┬───────────────────────────╮
4032 │ ├─────────────┬─────────────┤
4034 │ ├─────────────┼─────────────┤
4036 │ ├──────┬──────┼──────┬──────┤
4037 │ │ Yes │ No │ Yes │ No │
4038 │ ├──────┼──────┼──────┼──────┤
4039 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4040 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4041 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4042 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4043 │QN26 Yes QN61 Yes QN57 Row ID │ 34│34│ 36│36│ 38│38│ 39│39│
4044 │ Layer Row ID│ 10│10│ 10│10│ 10│10│ 10│10│
4045 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4046 │ No QN57 Row ID │ 41│41│ 43│43│ 46│46│ 47│47│
4047 │ Layer Row ID│ 11│11│ 11│11│ 11│11│ 11│11│
4048 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4049 │ No QN61 Yes QN57 Row ID │ 50│50│ 51│51│ 53│53│ 56│56│
4050 │ Layer Row ID│ 14│14│ 14│14│ 14│14│ 14│14│
4051 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4052 │ No QN57 Row ID │ 58│58│ 59│59│ 62│62│ 63│63│
4053 │ Layer Row ID│ 16│16│ 16│16│ 16│16│ 16│16│
4054 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4059 ╭───────────────────────────────────┬───────────────────────────╮
4061 │ ├─────────────┬─────────────┤
4063 │ ├─────────────┼─────────────┤
4065 │ ├──────┬──────┼──────┬──────┤
4066 │ │ Yes │ No │ Yes │ No │
4067 │ ├──────┼──────┼──────┼──────┤
4068 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4069 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4070 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4071 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4072 │QN26 Yes QN61 Yes QN57 Row ID │ 33│33│ 35│35│ 37│37│ 40│40│
4073 │ Layer Row ID│ 9│ 9│ 9│ 9│ 9│ 9│ 9│ 9│
4074 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4075 │ No QN57 Row ID │ 42│42│ 44│44│ 45│45│ 48│48│
4076 │ Layer Row ID│ 12│12│ 12│12│ 12│12│ 12│12│
4077 │ ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4078 │ No QN61 Yes QN57 Row ID │ 49│49│ 52│52│ 54│54│ 55│55│
4079 │ Layer Row ID│ 13│13│ 13│13│ 13│13│ 13│13│
4080 │ ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4081 │ No QN57 Row ID │ 57│57│ 60│60│ 61│61│ 64│64│
4082 │ Layer Row ID│ 15│15│ 15│15│ 15│15│ 15│15│
4083 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4088 ╭──────────────────────────────────────┬───────────────────────────╮
4090 │ ├─────────────┬─────────────┤
4092 │ ├─────────────┼─────────────┤
4094 │ ├──────┬──────┼──────┬──────┤
4095 │ │ Yes │ No │ Yes │ No │
4096 │ ├──────┼──────┼──────┼──────┤
4097 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4098 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4099 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4100 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4101 │QN26 Yes QN61 Yes QN57 Column ID │ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4102 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4103 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4104 │ No QN57 Column ID │ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4105 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4106 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4107 │ No QN61 Yes QN57 Column ID │ 18│19│ 22│23│ 25│27│ 29│32│
4108 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4109 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4110 │ No QN57 Column ID │ 18│19│ 22│23│ 25│27│ 29│32│
4111 │ Layer Column ID│ 1│ 4│ 6│ 8│ 9│11│ 14│15│
4112 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4117 ╭──────────────────────────────────────┬───────────────────────────╮
4119 │ ├─────────────┬─────────────┤
4121 │ ├─────────────┼─────────────┤
4123 │ ├──────┬──────┼──────┬──────┤
4124 │ │ Yes │ No │ Yes │ No │
4125 │ ├──────┼──────┼──────┼──────┤
4126 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4127 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4128 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4129 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4130 │QN26 Yes QN61 Yes QN57 Column ID │ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4131 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4132 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4133 │ No QN57 Column ID │ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4134 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4135 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4136 │ No QN61 Yes QN57 Column ID │ 17│20│ 21│24│ 26│28│ 30│31│
4137 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4138 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4139 │ No QN57 Column ID │ 17│20│ 21│24│ 26│28│ 30│31│
4140 │ Layer Column ID│ 2│ 3│ 5│ 7│ 10│12│ 13│16│
4141 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4146 ╭──────────────────────────────────────┬───────────────────────────╮
4148 │ ├─────────────┬─────────────┤
4150 │ ├─────────────┼─────────────┤
4152 │ ├──────┬──────┼──────┬──────┤
4153 │ │ Yes │ No │ Yes │ No │
4154 │ ├──────┼──────┼──────┼──────┤
4155 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4156 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4157 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4158 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4159 │QN26 Yes QN61 Yes QN57 Column ID │ 33│36│ 37│39│ 42│44│ 45│47│
4160 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4161 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4162 │ No QN57 Column ID │ 33│36│ 37│39│ 42│44│ 45│47│
4163 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4164 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4165 │ No QN61 Yes QN57 Column ID │ 49│51│ 54│56│ 57│60│ 62│64│
4166 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4167 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4168 │ No QN57 Column ID │ 49│51│ 54│56│ 57│60│ 62│64│
4169 │ Layer Column ID│ 17│20│ 21│23│ 26│28│ 29│31│
4170 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4175 ╭──────────────────────────────────────┬───────────────────────────╮
4177 │ ├─────────────┬─────────────┤
4179 │ ├─────────────┼─────────────┤
4181 │ ├──────┬──────┼──────┬──────┤
4182 │ │ Yes │ No │ Yes │ No │
4183 │ ├──────┼──────┼──────┼──────┤
4184 │ │ QN86 │ QN86 │ QN86 │ QN86 │
4185 │ ├───┬──┼───┬──┼───┬──┼───┬──┤
4186 │ │Yes│No│Yes│No│Yes│No│Yes│No│
4187 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4188 │QN26 Yes QN61 Yes QN57 Column ID │ 34│35│ 38│40│ 41│43│ 46│48│
4189 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4190 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4191 │ No QN57 Column ID │ 34│35│ 38│40│ 41│43│ 46│48│
4192 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4193 │ ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4194 │ No QN61 Yes QN57 Column ID │ 50│52│ 53│55│ 58│59│ 61│63│
4195 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4196 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4197 │ No QN57 Column ID │ 50│52│ 53│55│ 58│59│ 61│63│
4198 │ Layer Column ID│ 18│19│ 22│24│ 25│27│ 30│32│
4199 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4203 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=LAYER])
4204 AT_KEYWORDS([COLLABELS LAYER])
4205 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4206 AT_DATA([ctables.sps],
4209 /VLABELS VARIABLES=ALL DISPLAY=NAME
4210 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
4211 /SLABELS POSITION=ROW
4212 /CLABELS COLLABELS=LAYER
4213 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
4214 /SLABELS POSITION=ROW
4215 /CLABELS COLLABELS=LAYER
4216 /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
4217 /SLABELS POSITION=ROW
4218 /CLABELS COLLABELS=LAYER.
4220 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
4224 ╭──────────────────────────────────────┬───────────────────╮
4226 │ ├─────────┬─────────┤
4228 │ ├─────────┼─────────┤
4230 │ ├────┬────┼────┬────┤
4231 │ │ Yes│ No │ Yes│ No │
4232 │ ├────┼────┼────┼────┤
4233 │ │QN86│QN86│QN86│QN86│
4234 ├──────────────────────────────────────┼────┼────┼────┼────┤
4235 │QN26 Yes QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4236 │ Layer ID │ 2│ 2│ 2│ 2│
4237 │ Subtable ID│ 2│ 2│ 4│ 4│
4238 │ ╶───────────────┼────┼────┼────┼────┤
4239 │ No Table ID │ 1│ 1│ 1│ 1│
4240 │ Layer ID │ 2│ 2│ 2│ 2│
4241 │ Subtable ID│ 2│ 2│ 4│ 4│
4242 │ ╶────────────────────────┼────┼────┼────┼────┤
4243 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4244 │ Layer ID │ 2│ 2│ 2│ 2│
4245 │ Subtable ID│ 5│ 5│ 8│ 8│
4246 │ ╶───────────────┼────┼────┼────┼────┤
4247 │ No Table ID │ 1│ 1│ 1│ 1│
4248 │ Layer ID │ 2│ 2│ 2│ 2│
4249 │ Subtable ID│ 5│ 5│ 8│ 8│
4250 │ ╶─────────────────────────────────┼────┼────┼────┼────┤
4251 │ No QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4252 │ Layer ID │ 2│ 2│ 2│ 2│
4253 │ Subtable ID│ 9│ 9│ 12│ 12│
4254 │ ╶───────────────┼────┼────┼────┼────┤
4255 │ No Table ID │ 1│ 1│ 1│ 1│
4256 │ Layer ID │ 2│ 2│ 2│ 2│
4257 │ Subtable ID│ 9│ 9│ 12│ 12│
4258 │ ╶────────────────────────┼────┼────┼────┼────┤
4259 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4260 │ Layer ID │ 2│ 2│ 2│ 2│
4261 │ Subtable ID│ 14│ 14│ 15│ 15│
4262 │ ╶───────────────┼────┼────┼────┼────┤
4263 │ No Table ID │ 1│ 1│ 1│ 1│
4264 │ Layer ID │ 2│ 2│ 2│ 2│
4265 │ Subtable ID│ 14│ 14│ 15│ 15│
4266 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4271 ╭──────────────────────────────────────┬───────────────────╮
4273 │ ├─────────┬─────────┤
4275 │ ├─────────┼─────────┤
4277 │ ├────┬────┼────┬────┤
4278 │ │ Yes│ No │ Yes│ No │
4279 │ ├────┼────┼────┼────┤
4280 │ │QN86│QN86│QN86│QN86│
4281 ├──────────────────────────────────────┼────┼────┼────┼────┤
4282 │QN26 Yes QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4283 │ Layer ID │ 1│ 1│ 1│ 1│
4284 │ Subtable ID│ 1│ 1│ 3│ 3│
4285 │ ╶───────────────┼────┼────┼────┼────┤
4286 │ No Table ID │ 1│ 1│ 1│ 1│
4287 │ Layer ID │ 1│ 1│ 1│ 1│
4288 │ Subtable ID│ 1│ 1│ 3│ 3│
4289 │ ╶────────────────────────┼────┼────┼────┼────┤
4290 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4291 │ Layer ID │ 1│ 1│ 1│ 1│
4292 │ Subtable ID│ 6│ 6│ 7│ 7│
4293 │ ╶───────────────┼────┼────┼────┼────┤
4294 │ No Table ID │ 1│ 1│ 1│ 1│
4295 │ Layer ID │ 1│ 1│ 1│ 1│
4296 │ Subtable ID│ 6│ 6│ 7│ 7│
4297 │ ╶─────────────────────────────────┼────┼────┼────┼────┤
4298 │ No QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4299 │ Layer ID │ 1│ 1│ 1│ 1│
4300 │ Subtable ID│ 10│ 10│ 11│ 11│
4301 │ ╶───────────────┼────┼────┼────┼────┤
4302 │ No Table ID │ 1│ 1│ 1│ 1│
4303 │ Layer ID │ 1│ 1│ 1│ 1│
4304 │ Subtable ID│ 10│ 10│ 11│ 11│
4305 │ ╶────────────────────────┼────┼────┼────┼────┤
4306 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4307 │ Layer ID │ 1│ 1│ 1│ 1│
4308 │ Subtable ID│ 13│ 13│ 16│ 16│
4309 │ ╶───────────────┼────┼────┼────┼────┤
4310 │ No Table ID │ 1│ 1│ 1│ 1│
4311 │ Layer ID │ 1│ 1│ 1│ 1│
4312 │ Subtable ID│ 13│ 13│ 16│ 16│
4313 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4318 ╭──────────────────────────────────────┬───────────────────╮
4320 │ ├─────────┬─────────┤
4322 │ ├─────────┼─────────┤
4324 │ ├────┬────┼────┬────┤
4325 │ │ Yes│ No │ Yes│ No │
4326 │ ├────┼────┼────┼────┤
4327 │ │QN86│QN86│QN86│QN86│
4328 ├──────────────────────────────────────┼────┼────┼────┼────┤
4329 │QN26 Yes QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4330 │ Layer ID │ 4│ 4│ 4│ 4│
4331 │ Subtable ID│ 18│ 18│ 20│ 20│
4332 │ ╶───────────────┼────┼────┼────┼────┤
4333 │ No Table ID │ 1│ 1│ 1│ 1│
4334 │ Layer ID │ 4│ 4│ 4│ 4│
4335 │ Subtable ID│ 18│ 18│ 20│ 20│
4336 │ ╶────────────────────────┼────┼────┼────┼────┤
4337 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4338 │ Layer ID │ 4│ 4│ 4│ 4│
4339 │ Subtable ID│ 21│ 21│ 23│ 23│
4340 │ ╶───────────────┼────┼────┼────┼────┤
4341 │ No Table ID │ 1│ 1│ 1│ 1│
4342 │ Layer ID │ 4│ 4│ 4│ 4│
4343 │ Subtable ID│ 21│ 21│ 23│ 23│
4344 │ ╶─────────────────────────────────┼────┼────┼────┼────┤
4345 │ No QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4346 │ Layer ID │ 4│ 4│ 4│ 4│
4347 │ Subtable ID│ 25│ 25│ 28│ 28│
4348 │ ╶───────────────┼────┼────┼────┼────┤
4349 │ No Table ID │ 1│ 1│ 1│ 1│
4350 │ Layer ID │ 4│ 4│ 4│ 4│
4351 │ Subtable ID│ 25│ 25│ 28│ 28│
4352 │ ╶────────────────────────┼────┼────┼────┼────┤
4353 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4354 │ Layer ID │ 4│ 4│ 4│ 4│
4355 │ Subtable ID│ 30│ 30│ 32│ 32│
4356 │ ╶───────────────┼────┼────┼────┼────┤
4357 │ No Table ID │ 1│ 1│ 1│ 1│
4358 │ Layer ID │ 4│ 4│ 4│ 4│
4359 │ Subtable ID│ 30│ 30│ 32│ 32│
4360 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4365 ╭──────────────────────────────────────┬───────────────────╮
4367 │ ├─────────┬─────────┤
4369 │ ├─────────┼─────────┤
4371 │ ├────┬────┼────┬────┤
4372 │ │ Yes│ No │ Yes│ No │
4373 │ ├────┼────┼────┼────┤
4374 │ │QN86│QN86│QN86│QN86│
4375 ├──────────────────────────────────────┼────┼────┼────┼────┤
4376 │QN26 Yes QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4377 │ Layer ID │ 3│ 3│ 3│ 3│
4378 │ Subtable ID│ 17│ 17│ 19│ 19│
4379 │ ╶───────────────┼────┼────┼────┼────┤
4380 │ No Table ID │ 1│ 1│ 1│ 1│
4381 │ Layer ID │ 3│ 3│ 3│ 3│
4382 │ Subtable ID│ 17│ 17│ 19│ 19│
4383 │ ╶────────────────────────┼────┼────┼────┼────┤
4384 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4385 │ Layer ID │ 3│ 3│ 3│ 3│
4386 │ Subtable ID│ 22│ 22│ 24│ 24│
4387 │ ╶───────────────┼────┼────┼────┼────┤
4388 │ No Table ID │ 1│ 1│ 1│ 1│
4389 │ Layer ID │ 3│ 3│ 3│ 3│
4390 │ Subtable ID│ 22│ 22│ 24│ 24│
4391 │ ╶─────────────────────────────────┼────┼────┼────┼────┤
4392 │ No QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4393 │ Layer ID │ 3│ 3│ 3│ 3│
4394 │ Subtable ID│ 26│ 26│ 27│ 27│
4395 │ ╶───────────────┼────┼────┼────┼────┤
4396 │ No Table ID │ 1│ 1│ 1│ 1│
4397 │ Layer ID │ 3│ 3│ 3│ 3│
4398 │ Subtable ID│ 26│ 26│ 27│ 27│
4399 │ ╶────────────────────────┼────┼────┼────┼────┤
4400 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│
4401 │ Layer ID │ 3│ 3│ 3│ 3│
4402 │ Subtable ID│ 29│ 29│ 31│ 31│
4403 │ ╶───────────────┼────┼────┼────┼────┤
4404 │ No Table ID │ 1│ 1│ 1│ 1│
4405 │ Layer ID │ 3│ 3│ 3│ 3│
4406 │ Subtable ID│ 29│ 29│ 31│ 31│
4407 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4412 ╭───────────────────────────────────────┬───────────────────╮
4414 │ ├─────────┬─────────┤
4416 │ ├─────────┼─────────┤
4418 │ ├────┬────┼────┬────┤
4419 │ │ Yes│ No │ Yes│ No │
4420 │ ├────┼────┼────┼────┤
4421 │ │QN86│QN86│QN86│QN86│
4422 ├───────────────────────────────────────┼────┼────┼────┼────┤
4423 │QN26 Yes QN61 Yes QN57 Yes Row ID │ 1│ 1│ 3│ 3│
4424 │ Layer Row ID│ 1│ 1│ 1│ 1│
4425 │ ╶────────────────┼────┼────┼────┼────┤
4426 │ No Row ID │ 6│ 6│ 7│ 7│
4427 │ Layer Row ID│ 4│ 4│ 4│ 4│
4428 │ ╶─────────────────────────┼────┼────┼────┼────┤
4429 │ No QN57 Yes Row ID │ 10│ 10│ 11│ 11│
4430 │ Layer Row ID│ 6│ 6│ 6│ 6│
4431 │ ╶────────────────┼────┼────┼────┼────┤
4432 │ No Row ID │ 13│ 13│ 15│ 15│
4433 │ Layer Row ID│ 7│ 7│ 7│ 7│
4434 │ ╶──────────────────────────────────┼────┼────┼────┼────┤
4435 │ No QN61 Yes QN57 Yes Row ID │ 17│ 17│ 20│ 20│
4436 │ Layer Row ID│ 9│ 9│ 9│ 9│
4437 │ ╶────────────────┼────┼────┼────┼────┤
4438 │ No Row ID │ 21│ 21│ 24│ 24│
4439 │ Layer Row ID│ 11│ 11│ 11│ 11│
4440 │ ╶─────────────────────────┼────┼────┼────┼────┤
4441 │ No QN57 Yes Row ID │ 25│ 25│ 27│ 27│
4442 │ Layer Row ID│ 13│ 13│ 13│ 13│
4443 │ ╶────────────────┼────┼────┼────┼────┤
4444 │ No Row ID │ 30│ 30│ 32│ 32│
4445 │ Layer Row ID│ 16│ 16│ 16│ 16│
4446 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4451 ╭───────────────────────────────────────┬───────────────────╮
4453 │ ├─────────┬─────────┤
4455 │ ├─────────┼─────────┤
4457 │ ├────┬────┼────┬────┤
4458 │ │ Yes│ No │ Yes│ No │
4459 │ ├────┼────┼────┼────┤
4460 │ │QN86│QN86│QN86│QN86│
4461 ├───────────────────────────────────────┼────┼────┼────┼────┤
4462 │QN26 Yes QN61 Yes QN57 Yes Row ID │ 2│ 2│ 4│ 4│
4463 │ Layer Row ID│ 2│ 2│ 2│ 2│
4464 │ ╶────────────────┼────┼────┼────┼────┤
4465 │ No Row ID │ 5│ 5│ 8│ 8│
4466 │ Layer Row ID│ 3│ 3│ 3│ 3│
4467 │ ╶─────────────────────────┼────┼────┼────┼────┤
4468 │ No QN57 Yes Row ID │ 9│ 9│ 12│ 12│
4469 │ Layer Row ID│ 5│ 5│ 5│ 5│
4470 │ ╶────────────────┼────┼────┼────┼────┤
4471 │ No Row ID │ 14│ 14│ 16│ 16│
4472 │ Layer Row ID│ 8│ 8│ 8│ 8│
4473 │ ╶──────────────────────────────────┼────┼────┼────┼────┤
4474 │ No QN61 Yes QN57 Yes Row ID │ 18│ 18│ 19│ 19│
4475 │ Layer Row ID│ 10│ 10│ 10│ 10│
4476 │ ╶────────────────┼────┼────┼────┼────┤
4477 │ No Row ID │ 22│ 22│ 23│ 23│
4478 │ Layer Row ID│ 12│ 12│ 12│ 12│
4479 │ ╶─────────────────────────┼────┼────┼────┼────┤
4480 │ No QN57 Yes Row ID │ 26│ 26│ 28│ 28│
4481 │ Layer Row ID│ 14│ 14│ 14│ 14│
4482 │ ╶────────────────┼────┼────┼────┼────┤
4483 │ No Row ID │ 29│ 29│ 31│ 31│
4484 │ Layer Row ID│ 15│ 15│ 15│ 15│
4485 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4490 ╭───────────────────────────────────────┬───────────────────╮
4492 │ ├─────────┬─────────┤
4494 │ ├─────────┼─────────┤
4496 │ ├────┬────┼────┬────┤
4497 │ │ Yes│ No │ Yes│ No │
4498 │ ├────┼────┼────┼────┤
4499 │ │QN86│QN86│QN86│QN86│
4500 ├───────────────────────────────────────┼────┼────┼────┼────┤
4501 │QN26 Yes QN61 Yes QN57 Yes Row ID │ 34│ 34│ 35│ 35│
4502 │ Layer Row ID│ 18│ 18│ 18│ 18│
4503 │ ╶────────────────┼────┼────┼────┼────┤
4504 │ No Row ID │ 38│ 38│ 39│ 39│
4505 │ Layer Row ID│ 20│ 20│ 20│ 20│
4506 │ ╶─────────────────────────┼────┼────┼────┼────┤
4507 │ No QN57 Yes Row ID │ 42│ 42│ 43│ 43│
4508 │ Layer Row ID│ 22│ 22│ 22│ 22│
4509 │ ╶────────────────┼────┼────┼────┼────┤
4510 │ No Row ID │ 45│ 45│ 47│ 47│
4511 │ Layer Row ID│ 23│ 23│ 23│ 23│
4512 │ ╶──────────────────────────────────┼────┼────┼────┼────┤
4513 │ No QN61 Yes QN57 Yes Row ID │ 50│ 50│ 51│ 51│
4514 │ Layer Row ID│ 26│ 26│ 26│ 26│
4515 │ ╶────────────────┼────┼────┼────┼────┤
4516 │ No Row ID │ 53│ 53│ 55│ 55│
4517 │ Layer Row ID│ 27│ 27│ 27│ 27│
4518 │ ╶─────────────────────────┼────┼────┼────┼────┤
4519 │ No QN57 Yes Row ID │ 57│ 57│ 59│ 59│
4520 │ Layer Row ID│ 29│ 29│ 29│ 29│
4521 │ ╶────────────────┼────┼────┼────┼────┤
4522 │ No Row ID │ 62│ 62│ 64│ 64│
4523 │ Layer Row ID│ 32│ 32│ 32│ 32│
4524 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4529 ╭───────────────────────────────────────┬───────────────────╮
4531 │ ├─────────┬─────────┤
4533 │ ├─────────┼─────────┤
4535 │ ├────┬────┼────┬────┤
4536 │ │ Yes│ No │ Yes│ No │
4537 │ ├────┼────┼────┼────┤
4538 │ │QN86│QN86│QN86│QN86│
4539 ├───────────────────────────────────────┼────┼────┼────┼────┤
4540 │QN26 Yes QN61 Yes QN57 Yes Row ID │ 33│ 33│ 36│ 36│
4541 │ Layer Row ID│ 17│ 17│ 17│ 17│
4542 │ ╶────────────────┼────┼────┼────┼────┤
4543 │ No Row ID │ 37│ 37│ 40│ 40│
4544 │ Layer Row ID│ 19│ 19│ 19│ 19│
4545 │ ╶─────────────────────────┼────┼────┼────┼────┤
4546 │ No QN57 Yes Row ID │ 41│ 41│ 44│ 44│
4547 │ Layer Row ID│ 21│ 21│ 21│ 21│
4548 │ ╶────────────────┼────┼────┼────┼────┤
4549 │ No Row ID │ 46│ 46│ 48│ 48│
4550 │ Layer Row ID│ 24│ 24│ 24│ 24│
4551 │ ╶──────────────────────────────────┼────┼────┼────┼────┤
4552 │ No QN61 Yes QN57 Yes Row ID │ 49│ 49│ 52│ 52│
4553 │ Layer Row ID│ 25│ 25│ 25│ 25│
4554 │ ╶────────────────┼────┼────┼────┼────┤
4555 │ No Row ID │ 54│ 54│ 56│ 56│
4556 │ Layer Row ID│ 28│ 28│ 28│ 28│
4557 │ ╶─────────────────────────┼────┼────┼────┼────┤
4558 │ No QN57 Yes Row ID │ 58│ 58│ 60│ 60│
4559 │ Layer Row ID│ 30│ 30│ 30│ 30│
4560 │ ╶────────────────┼────┼────┼────┼────┤
4561 │ No Row ID │ 61│ 61│ 63│ 63│
4562 │ Layer Row ID│ 31│ 31│ 31│ 31│
4563 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4568 ╭──────────────────────────────────────────┬───────────────────╮
4570 │ ├─────────┬─────────┤
4572 │ ├─────────┼─────────┤
4574 │ ├────┬────┼────┬────┤
4575 │ │ Yes│ No │ Yes│ No │
4576 │ ├────┼────┼────┼────┤
4577 │ │QN86│QN86│QN86│QN86│
4578 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4579 │QN26 Yes QN61 Yes QN57 Yes Column ID │ 2│ 4│ 6│ 7│
4580 │ Layer Column ID│ 2│ 4│ 6│ 7│
4581 │ ╶───────────────────┼────┼────┼────┼────┤
4582 │ No Column ID │ 2│ 4│ 6│ 7│
4583 │ Layer Column ID│ 2│ 4│ 6│ 7│
4584 │ ╶────────────────────────────┼────┼────┼────┼────┤
4585 │ No QN57 Yes Column ID │ 9│ 12│ 13│ 16│
4586 │ Layer Column ID│ 2│ 4│ 6│ 7│
4587 │ ╶───────────────────┼────┼────┼────┼────┤
4588 │ No Column ID │ 9│ 12│ 13│ 16│
4589 │ Layer Column ID│ 2│ 4│ 6│ 7│
4590 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
4591 │ No QN61 Yes QN57 Yes Column ID │ 18│ 19│ 22│ 24│
4592 │ Layer Column ID│ 2│ 4│ 6│ 7│
4593 │ ╶───────────────────┼────┼────┼────┼────┤
4594 │ No Column ID │ 18│ 19│ 22│ 24│
4595 │ Layer Column ID│ 2│ 4│ 6│ 7│
4596 │ ╶────────────────────────────┼────┼────┼────┼────┤
4597 │ No QN57 Yes Column ID │ 25│ 27│ 29│ 32│
4598 │ Layer Column ID│ 2│ 4│ 6│ 7│
4599 │ ╶───────────────────┼────┼────┼────┼────┤
4600 │ No Column ID │ 25│ 27│ 29│ 32│
4601 │ Layer Column ID│ 2│ 4│ 6│ 7│
4602 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4607 ╭──────────────────────────────────────────┬───────────────────╮
4609 │ ├─────────┬─────────┤
4611 │ ├─────────┼─────────┤
4613 │ ├────┬────┼────┬────┤
4614 │ │ Yes│ No │ Yes│ No │
4615 │ ├────┼────┼────┼────┤
4616 │ │QN86│QN86│QN86│QN86│
4617 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4618 │QN26 Yes QN61 Yes QN57 Yes Column ID │ 1│ 3│ 5│ 8│
4619 │ Layer Column ID│ 1│ 3│ 5│ 8│
4620 │ ╶───────────────────┼────┼────┼────┼────┤
4621 │ No Column ID │ 1│ 3│ 5│ 8│
4622 │ Layer Column ID│ 1│ 3│ 5│ 8│
4623 │ ╶────────────────────────────┼────┼────┼────┼────┤
4624 │ No QN57 Yes Column ID │ 10│ 11│ 14│ 15│
4625 │ Layer Column ID│ 1│ 3│ 5│ 8│
4626 │ ╶───────────────────┼────┼────┼────┼────┤
4627 │ No Column ID │ 10│ 11│ 14│ 15│
4628 │ Layer Column ID│ 1│ 3│ 5│ 8│
4629 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
4630 │ No QN61 Yes QN57 Yes Column ID │ 17│ 20│ 21│ 23│
4631 │ Layer Column ID│ 1│ 3│ 5│ 8│
4632 │ ╶───────────────────┼────┼────┼────┼────┤
4633 │ No Column ID │ 17│ 20│ 21│ 23│
4634 │ Layer Column ID│ 1│ 3│ 5│ 8│
4635 │ ╶────────────────────────────┼────┼────┼────┼────┤
4636 │ No QN57 Yes Column ID │ 26│ 28│ 30│ 31│
4637 │ Layer Column ID│ 1│ 3│ 5│ 8│
4638 │ ╶───────────────────┼────┼────┼────┼────┤
4639 │ No Column ID │ 26│ 28│ 30│ 31│
4640 │ Layer Column ID│ 1│ 3│ 5│ 8│
4641 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4646 ╭──────────────────────────────────────────┬───────────────────╮
4648 │ ├─────────┬─────────┤
4650 │ ├─────────┼─────────┤
4652 │ ├────┬────┼────┬────┤
4653 │ │ Yes│ No │ Yes│ No │
4654 │ ├────┼────┼────┼────┤
4655 │ │QN86│QN86│QN86│QN86│
4656 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4657 │QN26 Yes QN61 Yes QN57 Yes Column ID │ 34│ 36│ 37│ 40│
4658 │ Layer Column ID│ 10│ 12│ 13│ 16│
4659 │ ╶───────────────────┼────┼────┼────┼────┤
4660 │ No Column ID │ 34│ 36│ 37│ 40│
4661 │ Layer Column ID│ 10│ 12│ 13│ 16│
4662 │ ╶────────────────────────────┼────┼────┼────┼────┤
4663 │ No QN57 Yes Column ID │ 41│ 43│ 45│ 47│
4664 │ Layer Column ID│ 10│ 12│ 13│ 16│
4665 │ ╶───────────────────┼────┼────┼────┼────┤
4666 │ No Column ID │ 41│ 43│ 45│ 47│
4667 │ Layer Column ID│ 10│ 12│ 13│ 16│
4668 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
4669 │ No QN61 Yes QN57 Yes Column ID │ 49│ 51│ 54│ 55│
4670 │ Layer Column ID│ 10│ 12│ 13│ 16│
4671 │ ╶───────────────────┼────┼────┼────┼────┤
4672 │ No Column ID │ 49│ 51│ 54│ 55│
4673 │ Layer Column ID│ 10│ 12│ 13│ 16│
4674 │ ╶────────────────────────────┼────┼────┼────┼────┤
4675 │ No QN57 Yes Column ID │ 58│ 60│ 62│ 63│
4676 │ Layer Column ID│ 10│ 12│ 13│ 16│
4677 │ ╶───────────────────┼────┼────┼────┼────┤
4678 │ No Column ID │ 58│ 60│ 62│ 63│
4679 │ Layer Column ID│ 10│ 12│ 13│ 16│
4680 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4685 ╭──────────────────────────────────────────┬───────────────────╮
4687 │ ├─────────┬─────────┤
4689 │ ├─────────┼─────────┤
4691 │ ├────┬────┼────┬────┤
4692 │ │ Yes│ No │ Yes│ No │
4693 │ ├────┼────┼────┼────┤
4694 │ │QN86│QN86│QN86│QN86│
4695 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4696 │QN26 Yes QN61 Yes QN57 Yes Column ID │ 33│ 35│ 38│ 39│
4697 │ Layer Column ID│ 9│ 11│ 14│ 15│
4698 │ ╶───────────────────┼────┼────┼────┼────┤
4699 │ No Column ID │ 33│ 35│ 38│ 39│
4700 │ Layer Column ID│ 9│ 11│ 14│ 15│
4701 │ ╶────────────────────────────┼────┼────┼────┼────┤
4702 │ No QN57 Yes Column ID │ 42│ 44│ 46│ 48│
4703 │ Layer Column ID│ 9│ 11│ 14│ 15│
4704 │ ╶───────────────────┼────┼────┼────┼────┤
4705 │ No Column ID │ 42│ 44│ 46│ 48│
4706 │ Layer Column ID│ 9│ 11│ 14│ 15│
4707 │ ╶─────────────────────────────────────┼────┼────┼────┼────┤
4708 │ No QN61 Yes QN57 Yes Column ID │ 50│ 52│ 53│ 56│
4709 │ Layer Column ID│ 9│ 11│ 14│ 15│
4710 │ ╶───────────────────┼────┼────┼────┼────┤
4711 │ No Column ID │ 50│ 52│ 53│ 56│
4712 │ Layer Column ID│ 9│ 11│ 14│ 15│
4713 │ ╶────────────────────────────┼────┼────┼────┼────┤
4714 │ No QN57 Yes Column ID │ 57│ 59│ 61│ 64│
4715 │ Layer Column ID│ 9│ 11│ 14│ 15│
4716 │ ╶───────────────────┼────┼────┼────┼────┤
4717 │ No Column ID │ 57│ 59│ 61│ 64│
4718 │ Layer Column ID│ 9│ 11│ 14│ 15│
4719 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4723 AT_SETUP([CTABLES categorical summary functions])
4724 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4725 AT_DATA([ctables.sps],
4728 /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
4729 /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
4730 /SLABELS POSITION=ROW.
4732 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4734 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
4735 │ │ D5a. What would you say is your primary ethnic background? │
4736 │ ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
4737 │ │ │ │ │ │ │ │ │ Multiple - │ │ │ │
4738 │ │ │ │ │ South │ Central │ Puerto │ Something│ cannot choose│ Don't│ │ │
4739 │ │Cuban│Mexican│Spanish│ American │ American │Rican, OR│ else │ one │ know │Refused│Total│
4740 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4741 │Region NE Count │ 6│ 8│ 8│ 11│ 7│ 39│ 23│ 2│ 0│ 1│ 105│
4742 │ Row % │ 5.7%│ 7.6%│ 7.6%│ 10.5%│ 6.7%│ 37.1%│ 21.9%│ 1.9%│ .0%│ 1.0%│ │
4743 │ Row │ 5.8%│ 7.7%│ 7.7%│ 10.6%│ 6.7%│ 37.5%│ 22.1%│ 1.9%│ .0%│ .0%│ │
4744 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4745 │ % │ │ │ │ │ │ │ │ │ │ │ │
4746 │ Row │ .4%│ .6%│ .6%│ .8%│ .5%│ 2.8%│ 1.6%│ .1%│ .0%│ .1%│ │
4747 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4748 │ % │ │ │ │ │ │ │ │ │ │ │ │
4749 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 104│
4750 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1409│
4751 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4752 │ MW Count │ 3│ 24│ 1│ 4│ 5│ 9│ 6│ 0│ 0│ 1│ 53│
4753 │ Row % │ 5.7%│ 45.3%│ 1.9%│ 7.5%│ 9.4%│ 17.0%│ 11.3%│ .0%│ .0%│ 1.9%│ │
4754 │ Row │ 5.8%│ 46.2%│ 1.9%│ 7.7%│ 9.6%│ 17.3%│ 11.5%│ .0%│ .0%│ .0%│ │
4755 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4756 │ % │ │ │ │ │ │ │ │ │ │ │ │
4757 │ Row │ .2%│ 1.5%│ .1%│ .2%│ .3%│ .5%│ .4%│ .0%│ .0%│ .1%│ │
4758 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4759 │ % │ │ │ │ │ │ │ │ │ │ │ │
4760 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 52│
4761 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1654│
4762 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4763 │ S Count │ 10│ 113│ 11│ 14│ 25│ 23│ 20│ 2│ 3│ 2│ 223│
4764 │ Row % │ 4.5%│ 50.7%│ 4.9%│ 6.3%│ 11.2%│ 10.3%│ 9.0%│ .9%│ 1.3%│ .9%│ │
4765 │ Row │ 4.6%│ 51.8%│ 5.0%│ 6.4%│ 11.5%│ 10.6%│ 9.2%│ .9%│ .0%│ .0%│ │
4766 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4767 │ % │ │ │ │ │ │ │ │ │ │ │ │
4768 │ Row │ .4%│ 4.7%│ .5%│ .6%│ 1.0%│ 1.0%│ .8%│ .1%│ .1%│ .1%│ │
4769 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4770 │ % │ │ │ │ │ │ │ │ │ │ │ │
4771 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 218│
4772 │ Total N│ │ │ │ │ │ │ │ │ │ │ 2390│
4773 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4774 │ W Count │ 1│ 166│ 28│ 5│ 15│ 7│ 19│ 3│ 0│ 1│ 245│
4775 │ Row % │ .4%│ 67.8%│ 11.4%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .4%│ │
4776 │ Row │ .4%│ 68.0%│ 11.5%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .0%│ │
4777 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
4778 │ % │ │ │ │ │ │ │ │ │ │ │ │
4779 │ Row │ .1%│ 10.7%│ 1.8%│ .3%│ 1.0%│ .5%│ 1.2%│ .2%│ .0%│ .1%│ │
4780 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
4781 │ % │ │ │ │ │ │ │ │ │ │ │ │
4782 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 244│
4783 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1546│
4784 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
4788 AT_SETUP([CTABLES scale summary functions])
4789 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4790 AT_DATA([ctables.sps],
4794 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4795 CTABLES later, to make the results easier to verify.
4796 SPLIT FILE BY REGION.
4799 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4800 /FORMAT NOTABLE /MISSING=INCLUDE.
4804 /VLABELS VARIABLE=qn19a DISPLAY=NONE
4805 /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, ROWPCT.SUM]
4806 /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
4807 /SLABELS POSITION=ROW
4808 /CLABELS ROWLABELS=OPPOSITE.
4810 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4812 ╭─────────┬───────────────────────────────────╮
4814 │ ├────────┬────────┬────────┬────────┤
4815 │ │ NE │ MW │ S │ W │
4816 │ ├────────┼────────┼────────┼────────┤
4817 │ │ QN19A │ QN19A │ QN19A │ QN19A │
4818 ├─────────┼────────┼────────┼────────┼────────┤
4819 │N Valid │ 936│ 1019│ 1276│ 950│
4820 │ Missing│ 473│ 635│ 1114│ 596│
4821 ├─────────┼────────┼────────┼────────┼────────┤
4822 │Mean │ 19.33│ 19.83│ 20.29│ 19.87│
4823 ├─────────┼────────┼────────┼────────┼────────┤
4824 │S.E. Mean│ .14│ .16│ .18│ .17│
4825 ├─────────┼────────┼────────┼────────┼────────┤
4826 │Median │ 18.00│ 19.00│ 19.00│ 19.00│
4827 ├─────────┼────────┼────────┼────────┼────────┤
4828 │Mode │ 18.00│ 18.00│ 18.00│ 18.00│
4829 ├─────────┼────────┼────────┼────────┼────────┤
4830 │Std Dev │ 4.41│ 5.15│ 6.44│ 5.25│
4831 ├─────────┼────────┼────────┼────────┼────────┤
4832 │Variance │ 19.41│ 26.47│ 41.43│ 27.59│
4833 ├─────────┼────────┼────────┼────────┼────────┤
4834 │Range │ 59.00│ 71.00│ 75.00│ 61.00│
4835 ├─────────┼────────┼────────┼────────┼────────┤
4836 │Minimum │ .00│ 4.00│ 4.00│ 4.00│
4837 ├─────────┼────────┼────────┼────────┼────────┤
4838 │Maximum │ 59.00│ 75.00│ 79.00│ 65.00│
4839 ├─────────┼────────┼────────┼────────┼────────┤
4840 │Sum │18092.00│20206.00│25886.00│18877.00│
4841 ╰─────────┴────────┴────────┴────────┴────────╯
4844 ╭────────────────────────┬────────┬────────┬────────┬────────╮
4845 │ │ NE │ MW │ S │ W │
4846 ├────────────────────────┼────────┼────────┼────────┼────────┤
4847 │REGION Valid N │ 936│ 1019│ 1276│ 950│
4848 │ Missing │ 473.00│ 635.00│ 1114.00│ 596.00│
4849 │ Mean │ 19.33│ 19.83│ 20.29│ 19.87│
4850 │ Std Error of Mean│ .14│ .16│ .18│ .17│
4851 │ Median │ 18.00│ 19.00│ 19.00│ 19.00│
4852 │ Mode │ 18.00│ 18.00│ 18.00│ 18.00│
4853 │ Std Deviation │ 4.41│ 5.15│ 6.44│ 5.25│
4854 │ Variance │ 19.41│ 26.47│ 41.43│ 27.59│
4855 │ Range │ 59.00│ 71.00│ 75.00│ 61.00│
4856 │ Minimum │ .00│ 4.00│ 4.00│ 4.00│
4857 │ Maximum │ 59.00│ 75.00│ 79.00│ 65.00│
4858 │ Sum │18092.00│20206.00│25886.00│18877.00│
4859 │ Count │ 1409│ 1654│ 2390│ 1546│
4860 │ Total N │ 1409│ 1654│ 2390│ 1546│
4861 │ Row Sum % │ 21.8%│ 24.3%│ 31.2%│ 22.7%│
4862 ╰────────────────────────┴────────┴────────┴────────┴────────╯
4866 AT_SETUP([CTABLES scale summary functions - weighting])
4871 for n in 1 2 3 4 5 6 7 8 9 10; do
4872 if test $c -lt 15; then
4877 printf "$weight $a $b $cval\n"
4878 weight=$(expr \( $weight + 3 \) % 7 + 2)
4879 c=$(expr \( $c + 13 \) % 29 + 7)
4884 AT_DATA([analysis.sps],
4885 [[* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4886 CTABLES later, to make the results easier to verify.
4890 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4891 /FORMAT NOTABLE /MISSING=INCLUDE.
4895 /TABLE c[VALIDN, MISSING, MEAN F8.2, SEMEAN F8.2, MEDIAN F8.2, MODE, STDDEV F8.2, VARIANCE F8.2, RANGE F8.2, MINIMUM, MAXIMUM, SUM F8.2, COUNT, TOTALN, LAYERROWPCT.SUM] BY a>b
4896 /SLABELS POSITION=ROW
4897 /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4900 AT_DATA([ctables.sps],
4901 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
4902 /w (F5.0) a b c (f2.0).
4903 VAR LEVEL w c (SCALE) a b (NOMINAL).
4904 MISSING VALUES a b (9).
4906 INCLUDE 'analysis.sps'.
4909 INCLUDE 'analysis.sps'.
4911 * Same as original analysis using unweighted versions of summaries.
4913 /TABLE c[UVALIDN, UMISSING, UMEAN F8.2, USEMEAN F8.2, UMEDIAN F8.2, UMODE, USTDDEV F8.2, UVARIANCE F8.2, USUM F8.2, UCOUNT, UTOTALN, ULAYERROWPCT.SUM] BY a>b
4914 /SLABELS POSITION=ROW
4915 /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4917 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4919 ╭─────────┬──────────────────────────────────────────────────────────────╮
4921 │ ├────────────────────┬────────────────────┬────────────────────┤
4923 │ ├────────────────────┼────────────────────┼────────────────────┤
4925 │ ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4926 │ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
4927 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4928 │ │ c │ c │ c │ c │ c │ c │ c │ c │ c │
4929 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4930 │N Valid │ 7│ 6│ 8│ 7│ 7│ 8│ 7│ 7│ 8│
4931 │ Missing│ 3│ 4│ 2│ 3│ 3│ 2│ 3│ 3│ 2│
4932 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4933 │Mean │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4934 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4935 │S.E. Mean│ 2.44│ 2.14│ 2.58│ 2.44│ 2.18│ 2.43│ 2.36│ 2.18│ 2.47│
4936 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4937 │Median │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
4938 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4939 │Mode │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
4940 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4941 │Std Dev │ 6.47│ 5.24│ 7.31│ 6.47│ 5.77│ 6.88│ 6.24│ 5.77│ 6.98│
4942 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4943 │Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
4944 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4945 │Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
4946 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4947 │Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
4948 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4949 │Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
4950 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4951 │Sum │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
4952 ╰─────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
4955 ╭───────────────────┬──────────────────────────────────────────────────────────────╮
4957 │ ├────────────────────┬────────────────────┬────────────────────┤
4959 │ ├────────────────────┼────────────────────┼────────────────────┤
4961 │ ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4962 │ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
4963 ├───────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4964 │c Valid N │ 7│ 6│ 8│ 7│ 7│ 8│ 7│ 7│ 8│
4965 │ Missing │ 3│ 4│ 2│ 3│ 3│ 2│ 3│ 3│ 2│
4966 │ Mean │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4967 │ Std Error of Mean│ 2.44│ 2.14│ 2.58│ 2.44│ 2.18│ 2.43│ 2.36│ 2.18│ 2.47│
4968 │ Median │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
4969 │ Mode │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
4970 │ Std Deviation │ 6.47│ 5.24│ 7.31│ 6.47│ 5.77│ 6.88│ 6.24│ 5.77│ 6.98│
4971 │ Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
4972 │ Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
4973 │ Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
4974 │ Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
4975 │ Sum │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
4976 │ Count │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
4977 │ Total N │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
4978 │ Layer Row Sum % │ 26.3%│ 21.3%│ .│ 26.3%│ 26.1%│ .│ .│ .│ .│
4979 ╰───────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
4982 ╭─────────┬─────────────────────────────────────────────────────────────────╮
4984 │ ├─────────────────────┬─────────────────────┬─────────────────────┤
4986 │ ├─────────────────────┼─────────────────────┼─────────────────────┤
4988 │ ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
4989 │ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
4990 │ ├───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
4991 │ │ c │ c │ c │ c │ c │ c │ c │ c │ c │
4992 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
4993 │N Valid │ 40│ 35│ 41│ 26│ 38│ 40│ 34│ 32│ 39│
4994 │ Missing│ 6│ 14│ 11│ 22│ 13│ 7│ 16│ 21│ 10│
4995 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
4996 │Mean │ 27.23│ 24.20│ 22.63│ 27.96│ 27.21│ 23.48│ 23.71│ 25.47│ 26.03│
4997 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
4998 │S.E. Mean│ .93│ .75│ 1.03│ 1.12│ .84│ .87│ 1.01│ 1.05│ 1.01│
4999 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5000 │Median │ 30.00│ 22.00│ 19.00│ 30.00│ 29.00│ 24.00│ 23.00│ 24.00│ 28.00│
5001 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5002 │Mode │ 34│ 29│ 19│ 34│ 33│ 28│ 23│ 18│ 30│
5003 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5004 │Std Dev │ 5.89│ 4.42│ 6.59│ 5.69│ 5.16│ 5.50│ 5.87│ 5.94│ 6.30│
5005 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5006 │Variance │ 34.64│ 19.52│ 43.39│ 32.36│ 26.66│ 30.20│ 34.46│ 35.29│ 39.71│
5007 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5008 │Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
5009 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5010 │Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
5011 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5012 │Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
5013 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5014 │Sum │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5015 ╰─────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5018 ╭───────────────────┬─────────────────────────────────────────────────────────────────╮
5020 │ ├─────────────────────┬─────────────────────┬─────────────────────┤
5022 │ ├─────────────────────┼─────────────────────┼─────────────────────┤
5024 │ ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5025 │ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
5026 ├───────────────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5027 │c Valid N │ 40│ 35│ 41│ 26│ 38│ 40│ 34│ 32│ 39│
5028 │ Missing │ 6│ 14│ 11│ 22│ 13│ 7│ 16│ 21│ 10│
5029 │ Mean │ 27.22│ 24.20│ 22.63│ 27.96│ 27.21│ 23.48│ 23.71│ 25.47│ 26.03│
5030 │ Std Error of Mean│ .93│ .75│ 1.03│ 1.12│ .84│ .87│ 1.01│ 1.05│ 1.01│
5031 │ Median │ 30.00│ 22.00│ 19.00│ 30.00│ 29.00│ 24.00│ 23.00│ 24.00│ 28.00│
5032 │ Mode │ 34│ 29│ 19│ 34│ 33│ 28│ 23│ 18│ 30│
5033 │ Std Deviation │ 5.89│ 4.42│ 6.59│ 5.69│ 5.16│ 5.50│ 5.87│ 5.94│ 6.30│
5034 │ Variance │ 34.64│ 19.52│ 43.39│ 32.36│ 26.66│ 30.20│ 34.46│ 35.29│ 39.71│
5035 │ Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
5036 │ Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
5037 │ Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
5038 │ Sum │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5039 │ Count │ 46│ 49│ 52│ 48│ 51│ 47│ 50│ 53│ 49│
5040 │ Total N │ 46│ 49│ 52│ 48│ 51│ 47│ 50│ 53│ 49│
5041 │ Layer Row Sum % │ 29.5%│ 22.9%│ .│ 19.7%│ 28.0%│ .│ .│ .│ .│
5042 ╰───────────────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5045 ╭────────────────────────────┬──────────────────────────────────────────────────────────────╮
5047 │ ├────────────────────┬────────────────────┬────────────────────┤
5049 │ ├────────────────────┼────────────────────┼────────────────────┤
5051 │ ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5052 │ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
5053 ├────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5054 │c Valid N │ 7│ 6│ 8│ 7│ 7│ 8│ 7│ 7│ 8│
5055 │ Missing │ 3│ 4│ 2│ 3│ 3│ 2│ 3│ 3│ 2│
5056 │ Unweighted Mean │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5057 │ Std Error of Mean │ 2.44│ 2.14│ 2.58│ 2.44│ 2.18│ 2.43│ 2.36│ 2.18│ 2.47│
5058 │ Median │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5059 │ Mode │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
5060 │ Std Deviation │ 6.47│ 5.24│ 7.31│ 6.47│ 5.77│ 6.88│ 6.24│ 5.77│ 6.98│
5061 │ Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5062 │ Sum │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5063 │ Unweighted Count │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
5064 │ Total N │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
5065 │ Unweighted Layer Row Sum %│ 26.3%│ 21.3%│ .│ 26.3%│ 26.1%│ .│ .│ .│ .│
5066 ╰────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5070 AT_SETUP([CTABLES hidden scale VLABELS])
5071 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5072 AT_DATA([ctables.sps],
5075 /TABLE region BY qn19a + qn35
5076 /SLABELS POSITION=ROW.
5078 /VLABELS VARIABLE=qn19a DISPLAY=NONE
5079 /TABLE region BY qn19a + qn35
5080 /SLABELS POSITION=ROW.
5082 /VLABELS VARIABLE=qn35 DISPLAY=NONE
5083 /TABLE region BY qn19a + qn35
5084 /SLABELS POSITION=ROW.
5086 * This one in particular caused a crash because no categories were
5087 created on the column axis, so passing in 0 for the index was still
5088 too big for that number of categories. It was fixed by creating a
5089 name-only category for each variable despite the "NONE" request,
5090 then hiding the entire dimension's labels if all its labels were
5093 /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
5094 /TABLE region BY qn19a + qn35
5095 /SLABELS POSITION=ROW.
5097 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
5099 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
5100 │ │ 19a. About how old were you│ 35. In the past thirty days, how│
5101 │ │ when you first starting │ many times have you driven a │
5102 │ │ drinking alcohol, not │ motor vehicle WITHIN TWO HOURS │
5103 │ │ counting small tastes or │ AFTER drinking alcoholic │
5104 │ │ sips of alcohol. │ beverages? │
5105 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
5106 │Region NE Mean│ 19.33│ 2│
5107 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
5108 │ MW Mean│ 19.83│ 2│
5109 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
5111 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
5113 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
5116 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
5117 │ │ │ 35. In the past thirty days, how many times have you │
5118 │ │ │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
5119 │ │QN19A│ alcoholic beverages? │
5120 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
5121 │Region NE Mean│19.33│ 2│
5122 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
5124 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
5126 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
5128 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
5131 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
5132 │ │ 19a. About how old were you when you first starting │ │
5133 │ │ drinking alcohol, not counting small tastes or sips of │ │
5135 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
5136 │Region NE Mean│ 19.33│ 2│
5137 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
5138 │ MW Mean│ 19.83│ 2│
5139 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
5141 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
5143 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
5146 ╭──────────────┬───────╮
5147 │Region NE Mean│19.33 2│
5154 ╰──────────────┴───────╯
5158 AT_SETUP([CTABLES with SPLIT FILE])
5159 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5160 AT_DATA([ctables.sps],
5163 SORT CASES BY qns3a.
5165 CTABLES /TABLE qn105ba.
5167 * Layered split has no effect on output.
5168 SPLIT FILE BY qns3a.
5169 CTABLES /TABLE qn105ba.
5171 * Add column variable qns3a to compare against separate splits.
5172 CTABLES /TABLE qn105ba BY qns3a.
5174 * Separate splits are truly output separately.
5175 SPLIT FILE SEPARATE BY qns3a.
5176 CTABLES /TABLE qn105ba.
5178 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5180 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5182 ├────────────────────────────────────────────────────────────────────────┼─────┤
5183 │105b. How likely is it that drivers who have had too much Almost │ 700│
5184 │to drink to drive safely will A. Get stopped by the police? certain │ │
5185 │ Very likely │ 1502│
5192 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5195 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5197 ├────────────────────────────────────────────────────────────────────────┼─────┤
5198 │105b. How likely is it that drivers who have had too much Almost │ 700│
5199 │to drink to drive safely will A. Get stopped by the police? certain │ │
5200 │ Very likely │ 1502│
5207 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5210 ╭─────────────────────────────────────────────────────────────────┬────────────╮
5216 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
5217 │105b. How likely is it that drivers who have had too Almost │ 297│ 403│
5218 │much to drink to drive safely will A. Get stopped by certain │ │ │
5219 │the police? Very likely │ 660│ 842│
5220 │ Somewhat │ 1174│ 1589│
5222 │ Somewhat │ 640│ 667│
5226 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
5229 ╭────────────┬─────╮
5231 ├────────────┼─────┤
5232 │S3a. GENDER:│Male │
5233 ╰────────────┴─────╯
5236 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5238 ├────────────────────────────────────────────────────────────────────────┼─────┤
5239 │105b. How likely is it that drivers who have had too much Almost │ 297│
5240 │to drink to drive safely will A. Get stopped by the police? certain │ │
5241 │ Very likely │ 660│
5248 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5251 ╭────────────┬──────╮
5253 ├────────────┼──────┤
5254 │S3a. GENDER:│Female│
5255 ╰────────────┴──────╯
5258 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5260 ├────────────────────────────────────────────────────────────────────────┼─────┤
5261 │105b. How likely is it that drivers who have had too much Almost │ 403│
5262 │to drink to drive safely will A. Get stopped by the police? certain │ │
5263 │ Very likely │ 842│
5270 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5274 AT_SETUP([CTABLES variable level inference])
5275 AT_DATA([data.txt], [dnl
5276 dnl n1 has 10 unique small values -> nominal.
5277 dnl n2 has 23 unique small values -> nominal.
5278 dnl n3 is all missing -> nominal.
5279 dnl s1 has 24 unique small values -> scale.
5280 dnl s2 has one negative value -> scale.
5281 dnl s3 has one non-integer value -> scale.
5282 dnl s4 has no valid values less than 10 -> scale.
5283 dnl s5 has no valid values less than 10,000 -> scale.
5284 1 1 . 1 1 1 10 10001
5285 2 2 . 2 2 2 11 10002
5286 3 3 . 3 3 3 12 10003
5287 4 4 . 4 4 4 13 10004
5288 5 5 . 5 5 5 14 10005
5289 6 6 . 6 6 6 15 10006
5290 7 7 . 7 7 7 16 10007
5291 8 8 . 8 8 8 17 10008
5292 9 9 . 9 9 9 18 10009
5293 10 10 . 10 10 10.5 19 110000
5294 1 11 . 11 -1 1 11 10001
5295 2 12 . 12 2 2 12 10002
5296 3 13 . 13 3 3 13 10003
5297 4 14 . 14 4 4 14 10004
5298 5 15 . 15 5 5 15 10005
5299 6 16 . 16 6 6 16 10006
5300 7 17 . 17 7 7 17 10007
5301 8 18 . 18 8 8 18 10008
5302 9 19 . 19 9 9 19 10009
5303 1 20 . 20 1 1 20 10001
5304 2 21 . 21 2 2 21 10002
5305 3 22 . 22 3 3 22 10003
5306 4 23 . 23 4 4 23 10004
5307 5 23 . 24 5 5 24 10005
5308 6 23 . 24 6 6 25 10006
5311 AT_DATA([ctables.sps], [dnl
5312 DATA LIST LIST file='data.txt' NOTABLE /n1 to n3 s1 to s5.
5314 * Nominal formats (copied from data that will default to scale).
5317 FORMATS n4(WKDAY5) n5(MONTH5).
5319 * Scale formats (copied from data that will default to nominal).
5323 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
5328 CTABLES /TABLE n1 + n2 + n3 + string + s1 + s2 + s3 + s4 + s5.
5332 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5334 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5335 │ │ │ Measurement │ │ │ │ │ │
5336 │Name │Position│ Level │ Role│Width│Alignment│Print Format│Write Format│
5337 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5338 │n1 │ 1│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5339 │n2 │ 2│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5340 │n3 │ 3│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5341 │s1 │ 4│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5342 │s2 │ 5│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5343 │s3 │ 6│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5344 │s4 │ 7│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5345 │s5 │ 8│Unknown │Input│ 8│Right │F8.2 │F8.2 │
5346 │n4 │ 9│Unknown │Input│ 8│Right │WKDAY5 │WKDAY5 │
5347 │n5 │ 10│Unknown │Input│ 8│Right │MONTH5 │MONTH5 │
5348 │s6 │ 11│Unknown │Input│ 8│Right │DOLLAR6.2 │DOLLAR6.2 │
5349 │s7 │ 12│Unknown │Input│ 8│Right │CCA8.2 │CCA8.2 │
5350 │s8 │ 13│Unknown │Input│ 8│Right │DATETIME17.0│DATETIME17.0│
5351 │string│ 14│Nominal │Input│ 8│Left │A8 │A8 │
5352 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5355 ╭────────────┬─────┬────────╮
5357 ├────────────┼─────┼────────┤
5368 ├────────────┼─────┼────────┤
5392 ├────────────┼─────┼────────┤
5394 ├────────────┼─────┼────────┤
5396 ├────────────┼─────┼────────┤
5398 ├────────────┼─────┼────────┤
5400 ├────────────┼─────┼────────┤
5402 ├────────────┼─────┼────────┤
5404 ╰────────────┴─────┴────────╯
5407 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5408 │ │ │ Measurement │ │ │ │ │ │
5409 │Name │Position│ Level │ Role│Width│Alignment│Print Format│Write Format│
5410 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5411 │n1 │ 1│Nominal │Input│ 8│Right │F8.2 │F8.2 │
5412 │n2 │ 2│Nominal │Input│ 8│Right │F8.2 │F8.2 │
5413 │n3 │ 3│Nominal │Input│ 8│Right │F8.2 │F8.2 │
5414 │s1 │ 4│Scale │Input│ 8│Right │F8.2 │F8.2 │
5415 │s2 │ 5│Scale │Input│ 8│Right │F8.2 │F8.2 │
5416 │s3 │ 6│Scale │Input│ 8│Right │F8.2 │F8.2 │
5417 │s4 │ 7│Scale │Input│ 8│Right │F8.2 │F8.2 │
5418 │s5 │ 8│Scale │Input│ 8│Right │F8.2 │F8.2 │
5419 │n4 │ 9│Nominal │Input│ 8│Right │WKDAY5 │WKDAY5 │
5420 │n5 │ 10│Nominal │Input│ 8│Right │MONTH5 │MONTH5 │
5421 │s6 │ 11│Scale │Input│ 8│Right │DOLLAR6.2 │DOLLAR6.2 │
5422 │s7 │ 12│Scale │Input│ 8│Right │CCA8.2 │CCA8.2 │
5423 │s8 │ 13│Scale │Input│ 8│Right │DATETIME17.0│DATETIME17.0│
5424 │string│ 14│Nominal │Input│ 8│Left │A8 │A8 │
5425 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯