3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Testing details of missing value handling in summaries.
6 dnl - Test WEIGHT and adjustment weights.
7 dnl - Summary functions:
8 dnl * Separate summary functions for totals and subtotals.
9 dnl * )CILEVEL in summary label specification
10 dnl - Summary functions:
11 dnl * U-prefix for unweighted summaries.
12 dnl * areaPCT.SUM and UareaPCT.SUM functions.
13 dnl - Definition of columns/rows when labels are rotated from one axis to another.
16 dnl - Multiple response sets
17 dnl - MRSETS subcommand.
18 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
21 dnl - Summary functions:
22 dnl * .LCL and .UCL suffixes.
25 dnl * Data-dependent sorting.
27 AT_SETUP([CTABLES parsing])
28 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
29 AT_DATA([ctables.sps],
32 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
33 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
34 /FORMAT UNITS=CM EMPTY="(-)"
35 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
36 /VLABELS VARIABLES=qn17 DISPLAY=NAME
37 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
38 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
39 /VLABELS VARIABLES=qn20 DISPLAY=NONE
40 /MRSETS COUNTDUPLICATES=NO
41 /MRSETS COUNTDUPLICATES=YES
44 /WEIGHT VARIABLE=qns3a
46 /HIDESMALLCOUNTS COUNT=10
48 /SLABELS POSITION=COLUMN VISIBLE=YES
49 /SLABELS VISIBLE=NO POSITION=ROW
50 /SLABELS POSITION=LAYER
52 /CLABELS ROWLABELS=OPPOSITE
54 /CATEGORIES VARIABLES=qn1 qn17
55 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
56 POSITION=BEFORE EMPTY=INCLUDE.
57 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
58 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
59 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
61 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
64 ╭───────────────────┬────┬────╮
66 ├───────────────────┼────┼────┤
67 │Sa1. SAMPLE SOURCE:│5392│1607│
68 ╰───────────────────┴────┴────╯
72 ╭───────────────────┬─────╮
74 ├───────────────────┼─────┤
75 │Sa1. SAMPLE SOURCE:│ 5392│
76 ╰───────────────────┴─────╯
79 ╭────────────────────────┬─────╮
81 ├────────────────────────┼─────┤
82 │Sa1. SAMPLE SOURCE: RDD │ 5392│
84 ╰────────────────────────┴─────╯
87 ╭────────────────────────┬─────╮
89 ├────────────────────────┼─────┤
90 │Sa1. SAMPLE SOURCE: RDD │ 5392│
92 ╰────────────────────────┴─────╯
96 AT_SETUP([CTABLES parsing - negative])
97 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
98 AT_DATA([ctables.sps],
101 CTABLES /FORMAT MINCOLWIDTH='foo'.
102 CTABLES /TABLE qn1 [**].
103 CTABLES /TABLE qn1 [NOTAFUNCTION].
106 CTABLES /TABLE NOTAVAR.
108 CTABLES /TABLE string[S].
109 CTABLES /TABLE qn1 [PTILE 101].
110 CTABLES /TABLE qn1 [MEAN F0.1].
111 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
112 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
113 CTABLES /TABLE qn1 [MEAN TOTALS].
114 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
115 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
116 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
117 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
118 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
119 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
120 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
121 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
122 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
123 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
124 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
125 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
127 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
128 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
129 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
130 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
131 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
132 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
133 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
134 CTABLES /PCOMPUTE &k=EXPR([LO **]).
135 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
136 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
137 CTABLES /PCOMPUTE &k=EXPR([1**]).
138 CTABLES /PCOMPUTE &k=EXPR((1x)).
139 CTABLES /PCOMPUTE **k.
140 CTABLES /PCOMPUTE &1.
141 CTABLES /PCOMPUTE &k**.
142 CTABLES /PCOMPUTE &k=**.
143 CTABLES /PCOMPUTE &k=EXPR**.
144 CTABLES /PCOMPUTE &k=EXPR(1x).
145 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
146 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
147 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
148 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
149 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
150 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
151 CTABLES /FORMAT EMPTY=**.
152 CTABLES /FORMAT MISSING=**.
154 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
156 CTABLES /VLABELS VARIABLES=NOTAVAR.
157 CTABLES /VLABELS VARIABLES=qn1 **.
158 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
160 CTABLES /MRSETS COUNTDUPLICATES=**.
161 CTABLES /SMISSING **.
163 CTABLES /WEIGHT VARIABLE=NOTAVAR.
164 CTABLES /HIDESMALLCOUNTS COUNT=1.
166 CTABLES /HIDESMALLCOUNTS COUNT=2.
167 CTABLES /TABLE qn1**.
168 CTABLES /TABLE qn1 /SLABELS POSITION=**.
169 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
170 CTABLES /TABLE qn1 /SLABELS **.
171 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
172 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
173 CTABLES /TABLE qn1 /CLABELS **.
174 CTABLES /TABLE qn1 /CRITERIA **.
175 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
176 CTABLES /TABLE qn1 /TITLES **.
177 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
178 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
179 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
180 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
181 CTABLES /TABLE qn1 /SIGTEST **.
182 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
183 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
184 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
185 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
186 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
187 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
188 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
189 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
190 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
191 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
192 CTABLES /TABLE qn1 /COMPARETEST **.
193 CTABLES /TABLE qn1 / **.
194 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
195 CTABLES /TABLE qn20 > qnd1.
196 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
197 NUMERIC datetime (DATETIME17.0).
198 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
200 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
201 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
203 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
204 negative number for MINCOLWIDTH.
206 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
209 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
210 summary function name.
212 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
214 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
217 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
219 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
221 10 | CTABLES /TABLE string[S].
224 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
225 between 0 and 100 for PTILE.
227 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
228 requires a width between 1 and 40.
230 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
231 format NEGPAREN requires width 2 or greater.
233 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
234 format NEGPAREN requires width greater than decimals.
236 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
238 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
241 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
242 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
245 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
247 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
249 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
252 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
253 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
256 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
258 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
260 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
262 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
264 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
266 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
268 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
271 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
272 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
275 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
276 between 0 and 100 for PTILE.
278 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
281 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
284 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
287 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
290 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
292 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
295 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
298 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
299 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
301 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
302 LABEL, POSITION, or EMPTY.
304 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
305 integer for SUBTOTAL.
307 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
309 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
311 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
313 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
315 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
317 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
319 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
321 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
323 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
325 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
327 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
329 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
331 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
332 the previous definition.
333 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
334 | ^~~~~~~~~~~~~~~~~~~
336 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
337 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
338 | ^~~~~~~~~~~~~~~~~~~
340 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
343 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
344 Expecting summary function name.
346 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
347 between 0 and 100 for PTILE.
349 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
351 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
354 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
355 FORMAT, or HIDESOURCECATS.
357 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
359 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
361 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
362 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
364 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
367 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
370 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
372 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
375 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
376 DEFAULT, NAME, LABEL, BOTH, or NONE.
378 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
381 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
384 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
385 VARIABLE or LISTWISE.
387 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
390 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
392 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
393 greater for HIDESMALLCOUNTS COUNT.
395 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
396 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
397 HIDESMALLCOUNTS, or TABLE.
399 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
402 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
404 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
407 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
410 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
413 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
416 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
419 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
420 ROWLABELS, or COLLABELS.
422 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
425 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
426 in @<:@0,100@:}@ for CILEVEL.
428 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
429 CAPTION, CORNER, or TITLE.
431 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
434 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
435 in @<:@0,1@:}@ for ALPHA.
437 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
440 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
441 ALLVISIBLE or SUBTOTALS.
443 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
444 ALPHA, INCLUDEMRSETS, or CATEGORIES.
446 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
449 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
452 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
455 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
456 BONFERRONI, BH, or NONE.
458 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
461 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
464 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
465 ALLVISIBLE or SUBTOTALS.
467 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
470 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
473 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
476 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
477 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
480 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
481 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
483 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
486 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
487 97 | CTABLES /TABLE qn20 > qnd1.
490 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
491 97 | CTABLES /TABLE qn20 > qnd1.
494 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
495 97 | CTABLES /TABLE qn20 > qnd1.
498 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
499 categorical variables at the innermost nesting level.
500 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
501 | ^~~~~~~~~~~~~~~~~~~~
503 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
505 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
508 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
509 specification as format DATETIME: Day (123) must be between 1 and 31..
510 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
515 AT_SETUP([CTABLES parsing - more negative])
516 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
517 AT_DATA([ctables.sps],
519 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
520 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
521 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
524 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
525 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
527 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
529 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
530 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
531 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
532 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
534 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
535 CTABLES /PCOMPUTE &x=EXPR([**]).
536 CTABLES /PCOMPUTE &x=EXPR(**).
540 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
542 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
543 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
544 category not included in the category list.
545 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
550 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
551 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
555 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
556 list of categories here.
557 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
562 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
563 category not included in the category list.
564 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
569 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
570 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
574 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
575 variable's CATEGORIES specification.
577 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
578 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
579 subtotals by position, e.g. SUBTOTAL[1].
580 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
581 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
583 ^~~~~~~~~~~~~~~~~~~~~~~~
585 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
587 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
588 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
591 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
592 applied only to string variables, but this subcommand tries to apply it to
593 numeric variable QN1.
594 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
597 ctables.sps:8.53: error: CTABLES: This category specification may be applied
598 only to numeric variables, but this subcommand tries to apply it to string
600 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
603 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
604 based on a summary function.
606 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
607 moved to be categorical, but qnd1 is a scale variable.
609 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
610 moved to have the same width, but QN1 has width 0 and string has width 8.
612 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
613 moved to have the same value labels, but QN1 and QNSA1 have different value
616 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
617 moved to have the same category specifications, but QN105BA and QN105BB have
618 different category specifications.
620 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
621 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
622 this warning, insert parentheses.
623 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
626 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
629 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
631 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
633 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
634 variable must be specified.
636 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
638 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
640 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
643 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows 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 variable on the columns axis has a
650 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
653 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
654 has a summary even if the syntax does not explicitly specify one.
655 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
660 AT_SETUP([CTABLES one categorical variable])
661 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
662 AT_DATA([ctables.sps],
665 CTABLES /TABLE BY qn1.
666 CTABLES /TABLE BY BY qn1.
668 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
670 ╭────────────────────────────────────────────────────────────────────────┬─────╮
672 ├────────────────────────────────────────────────────────────────────────┼─────┤
673 │ 1. How often do you usually drive a car or other Every day │ 4667│
674 │motor vehicle? Several days a week │ 1274│
675 │ Once a week or less │ 361│
676 │ Only certain times a │ 130│
679 ╰────────────────────────────────────────────────────────────────────────┴─────╯
682 ╭──────────────────────────────────────────────────────────────────────────────╮
683 │ 1. How often do you usually drive a car or other motor vehicle? │
684 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
685 │ │ Several days a │ Once a week or │ Only certain times a │ │
686 │Every day│ week │ less │ year │Never│
687 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
688 │ Count │ Count │ Count │ Count │Count│
689 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
690 │ 4667│ 1274│ 361│ 130│ 540│
691 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
703 AT_SETUP([CTABLES one string variable])
704 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
705 AT_DATA([ctables.sps],
708 MISSING VALUES licensed('DontKnow', 'Refused').
709 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
710 CTABLES /TABLE licensed.
711 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
712 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
713 * Notice that the string matching is case-sensitive.
714 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
715 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
717 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
718 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
720 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
722 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
723 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
725 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
727 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
737 ╭─────────────────┬─────┬───────╮
739 ├─────────────────┼─────┼───────┤
740 │licensed DontKnow│ 4│ │
744 │ Total │ 6999│ 6951│
745 ╰─────────────────┴─────┴───────╯
748 ╭──────────────┬─────╮
750 ├──────────────┼─────┤
751 │licensed Yes │ 6379│
754 ╰──────────────┴─────╯
757 ╭──────────────┬─────╮
759 ├──────────────┼─────┤
760 │licensed Yes │ 6379│
763 ╰──────────────┴─────╯
766 ╭────────────────┬─────╮
768 ├────────────────┼─────┤
773 ╰────────────────┴─────╯
776 ╭────────────────┬─────╮
778 ├────────────────┼─────┤
779 │licensed Yes │ 6379│
781 ╰────────────────┴─────╯
784 ╭────────────────┬─────╮
786 ├────────────────┼─────┤
787 │licensed Yes │ 6379│
789 ╰────────────────┴─────╯
793 AT_SETUP([CTABLES one scale variable])
794 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
795 AT_DATA([ctables.sps],
797 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
798 CTABLES /TABLE BY qnd1.
799 CTABLES /TABLE BY BY qnd1.
801 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
803 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
804 │ │ │ │ │ │ Std │ │ │
805 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
806 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
807 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
808 │age? │ │ │ │ │ │ │ │
809 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
812 ╭──────────────────────────╮
813 │D1. AGE: What is your age?│
814 ├──────────────────────────┤
816 ├──────────────────────────┤
818 ╰──────────────────────────╯
821 D1. AGE: What is your age?
830 AT_SETUP([CTABLES simple stacking])
831 AT_KEYWORDS([stack stacked])
832 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
833 AT_DATA([ctables.sps],
835 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
837 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
839 ╭───────────────────────────────────────────────────────────────┬──────────────╮
846 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
847 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
848 │too much to drink to drive safely will A. Get certain │ │ │
849 │stopped by the police? Very likely │ 21%│ 22%│
850 │ Somewhat │ 38%│ 42%│
852 │ Somewhat │ 21%│ 18%│
856 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
857 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
858 │too much to drink to drive safely will B. Have an certain │ │ │
859 │accident? Very likely │ 36%│ 45%│
860 │ Somewhat │ 39%│ 32%│
866 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
867 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
868 │too much to drink to drive safely will C. Be certain │ │ │
869 │convicted for drunk driving? Very likely │ 32%│ 28%│
870 │ Somewhat │ 27%│ 32%│
872 │ Somewhat │ 15%│ 15%│
876 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
877 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
878 │too much to drink to drive safely will D. Be certain │ │ │
879 │arrested for drunk driving? Very likely │ 26%│ 27%│
880 │ Somewhat │ 32%│ 35%│
882 │ Somewhat │ 17%│ 15%│
886 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
890 AT_SETUP([CTABLES show or hide empty categories])
891 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
892 AT_DATA([ctables.sps],
894 IF (qn105ba = 2) qn105ba = 1.
895 IF (qns3a = 1) qns3a = 2.
896 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
897 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
898 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
899 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
900 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
901 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
902 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
904 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
906 ╭──────────────────────────────────────────────────────────────┬───────────────╮
913 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
914 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
915 │too much to drink to drive safely will A. Get certain │ │ │
916 │stopped by the police? Very likely│ .│ 0%│
923 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
926 ╭──────────────────────────────────────────────────────────────┬───────────────╮
933 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
934 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
935 │too much to drink to drive safely will A. Get certain │ │ │
936 │stopped by the police? Somewhat │ .│ 40%│
942 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
945 ╭────────────────────────────────────────────────────────────────────┬─────────╮
952 ├────────────────────────────────────────────────────────────────────┼─────────┤
953 │105b. How likely is it that drivers who have had too Almost │ 32%│
954 │much to drink to drive safely will A. Get stopped by certain │ │
955 │the police? Very likely │ 0%│
962 ╰────────────────────────────────────────────────────────────────────┴─────────╯
965 ╭────────────────────────────────────────────────────────────────────┬─────────╮
972 ├────────────────────────────────────────────────────────────────────┼─────────┤
973 │105b. How likely is it that drivers who have had too Almost │ 32%│
974 │much to drink to drive safely will A. Get stopped by certain │ │
975 │the police? Somewhat │ 40%│
981 ╰────────────────────────────────────────────────────────────────────┴─────────╯
985 AT_SETUP([CTABLES sorting categories])
986 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
987 AT_DATA([ctables.sps],
989 IF (QND5A=6) QND5A=-1.
990 IF (QND5A=5) QND5A=-2.
991 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
992 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
993 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
994 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
996 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
998 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1000 ├────────────────────────────────────────────────────────────────────────┼─────┤
1001 │D5a. What would you say is your primary ethnic -2.00 │ 52│
1002 │background? -1.00 │ 78│
1006 │ South American │ 34│
1007 │ Central American │ 0│
1008 │ Puerto Rican, OR │ 0│
1009 │ Something else │ 68│
1010 │ Multiple - cannot choose│ 7│
1012 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1015 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1017 ├────────────────────────────────────────────────────────────────────────┼─────┤
1018 │D5a. What would you say is your primary ethnic Multiple - cannot choose│ 7│
1019 │background? one │ │
1020 │ Something else │ 68│
1021 │ Puerto Rican, OR │ 0│
1022 │ Central American │ 0│
1023 │ South American │ 34│
1029 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1032 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1034 ├────────────────────────────────────────────────────────────────────────┼─────┤
1035 │D5a. What would you say is your primary ethnic Central American │ 0│
1036 │background? Cuban │ 20│
1038 │ Multiple - cannot choose│ 7│
1040 │ Puerto Rican, OR │ 0│
1041 │ Something else │ 68│
1042 │ South American │ 34│
1046 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1049 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1051 ├────────────────────────────────────────────────────────────────────────┼─────┤
1052 │D5a. What would you say is your primary ethnic Spanish │ 48│
1053 │background? South American │ 34│
1054 │ Something else │ 68│
1055 │ Puerto Rican, OR │ 0│
1056 │ Multiple - cannot choose│ 7│
1060 │ Central American │ 0│
1063 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1067 AT_SETUP([CTABLES simple nesting])
1068 AT_KEYWORDS([nest nested])
1069 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1070 AT_DATA([ctables.sps],
1072 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1073 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1074 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1075 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1076 /CLABELS ROW=OPPOSITE.
1078 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1080 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1083 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1084 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1085 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1086 │drive safely will A. Get stopped by Total │ 700│ 10%│
1087 │the police? ╶──────────────────────────┼─────┼──────┤
1088 │ Very S3a. Male │ 660│ 10%│
1089 │ likely GENDER: Female│ 842│ 12%│
1090 │ Total │ 1502│ 22%│
1091 │ ╶──────────────────────────┼─────┼──────┤
1092 │ Somewhat S3a. Male │ 1174│ 17%│
1093 │ likely GENDER: Female│ 1589│ 23%│
1094 │ Total │ 2763│ 40%│
1095 │ ╶──────────────────────────┼─────┼──────┤
1096 │ Somewhat S3a. Male │ 640│ 9%│
1097 │ unlikely GENDER: Female│ 667│ 10%│
1098 │ Total │ 1307│ 19%│
1099 │ ╶──────────────────────────┼─────┼──────┤
1100 │ Very S3a. Male │ 311│ 5%│
1101 │ unlikely GENDER: Female│ 298│ 4%│
1103 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1104 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1105 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1106 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1107 │ ╶──────────────────────────┼─────┼──────┤
1108 │ Very S3a. Male │ 1104│ 16%│
1109 │ likely GENDER: Female│ 1715│ 25%│
1110 │ Total │ 2819│ 41%│
1111 │ ╶──────────────────────────┼─────┼──────┤
1112 │ Somewhat S3a. Male │ 1203│ 17%│
1113 │ likely GENDER: Female│ 1214│ 18%│
1114 │ Total │ 2417│ 35%│
1115 │ ╶──────────────────────────┼─────┼──────┤
1116 │ Somewhat S3a. Male │ 262│ 4%│
1117 │ unlikely GENDER: Female│ 168│ 2%│
1119 │ ╶──────────────────────────┼─────┼──────┤
1120 │ Very S3a. Male │ 81│ 1%│
1121 │ unlikely GENDER: Female│ 59│ 1%│
1123 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1124 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1125 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1126 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1127 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1128 │ Very S3a. Male │ 988│ 14%│
1129 │ likely GENDER: Female│ 1049│ 15%│
1130 │ Total │ 2037│ 30%│
1131 │ ╶──────────────────────────┼─────┼──────┤
1132 │ Somewhat S3a. Male │ 822│ 12%│
1133 │ likely GENDER: Female│ 1210│ 18%│
1134 │ Total │ 2032│ 30%│
1135 │ ╶──────────────────────────┼─────┼──────┤
1136 │ Somewhat S3a. Male │ 446│ 7%│
1137 │ unlikely GENDER: Female│ 548│ 8%│
1139 │ ╶──────────────────────────┼─────┼──────┤
1140 │ Very S3a. Male │ 268│ 4%│
1141 │ unlikely GENDER: Female│ 354│ 5%│
1143 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1144 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1145 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1146 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1147 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1148 │ Very S3a. Male │ 805│ 12%│
1149 │ likely GENDER: Female│ 1029│ 15%│
1150 │ Total │ 1834│ 27%│
1151 │ ╶──────────────────────────┼─────┼──────┤
1152 │ Somewhat S3a. Male │ 975│ 14%│
1153 │ likely GENDER: Female│ 1332│ 19%│
1154 │ Total │ 2307│ 34%│
1155 │ ╶──────────────────────────┼─────┼──────┤
1156 │ Somewhat S3a. Male │ 535│ 8%│
1157 │ unlikely GENDER: Female│ 560│ 8%│
1158 │ Total │ 1095│ 16%│
1159 │ ╶──────────────────────────┼─────┼──────┤
1160 │ Very S3a. Male │ 270│ 4%│
1161 │ unlikely GENDER: Female│ 279│ 4%│
1163 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1166 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1167 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1168 │ │ certain│likely│ likely │ unlikely│unlikely│
1169 │ ├────────┼──────┼─────────┼─────────┼────────┤
1171 │ │ Table %│ % │ Table % │ Table % │ Table %│
1172 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1173 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1174 │GENDER: is it that drivers│ │ │ │ │ │
1175 │ who have had too │ │ │ │ │ │
1176 │ much to drink to │ │ │ │ │ │
1177 │ drive safely will │ │ │ │ │ │
1178 │ A. Get stopped by │ │ │ │ │ │
1179 │ the police? │ │ │ │ │ │
1180 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1181 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1182 │ is it that drivers│ │ │ │ │ │
1183 │ who have had too │ │ │ │ │ │
1184 │ much to drink to │ │ │ │ │ │
1185 │ drive safely will │ │ │ │ │ │
1186 │ A. Get stopped by │ │ │ │ │ │
1187 │ the police? │ │ │ │ │ │
1188 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1189 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1190 │ is it that drivers│ │ │ │ │ │
1191 │ who have had too │ │ │ │ │ │
1192 │ much to drink to │ │ │ │ │ │
1193 │ drive safely will │ │ │ │ │ │
1194 │ A. Get stopped by │ │ │ │ │ │
1195 │ the police? │ │ │ │ │ │
1196 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1197 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1198 │GENDER: is it that drivers│ │ │ │ │ │
1199 │ who have had too │ │ │ │ │ │
1200 │ much to drink to │ │ │ │ │ │
1201 │ drive safely will │ │ │ │ │ │
1202 │ B. Have an │ │ │ │ │ │
1203 │ accident? │ │ │ │ │ │
1204 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1205 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1206 │ is it that drivers│ │ │ │ │ │
1207 │ who have had too │ │ │ │ │ │
1208 │ much to drink to │ │ │ │ │ │
1209 │ drive safely will │ │ │ │ │ │
1210 │ B. Have an │ │ │ │ │ │
1211 │ accident? │ │ │ │ │ │
1212 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1213 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1214 │ is it that drivers│ │ │ │ │ │
1215 │ who have had too │ │ │ │ │ │
1216 │ much to drink to │ │ │ │ │ │
1217 │ drive safely will │ │ │ │ │ │
1218 │ B. Have an │ │ │ │ │ │
1219 │ accident? │ │ │ │ │ │
1220 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1221 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1222 │GENDER: is it that drivers│ │ │ │ │ │
1223 │ who have had too │ │ │ │ │ │
1224 │ much to drink to │ │ │ │ │ │
1225 │ drive safely will │ │ │ │ │ │
1226 │ C. Be convicted │ │ │ │ │ │
1227 │ for drunk driving?│ │ │ │ │ │
1228 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1229 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1230 │ is it that drivers│ │ │ │ │ │
1231 │ who have had too │ │ │ │ │ │
1232 │ much to drink to │ │ │ │ │ │
1233 │ drive safely will │ │ │ │ │ │
1234 │ C. Be convicted │ │ │ │ │ │
1235 │ for drunk driving?│ │ │ │ │ │
1236 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1237 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1238 │ is it that drivers│ │ │ │ │ │
1239 │ who have had too │ │ │ │ │ │
1240 │ much to drink to │ │ │ │ │ │
1241 │ drive safely will │ │ │ │ │ │
1242 │ C. Be convicted │ │ │ │ │ │
1243 │ for drunk driving?│ │ │ │ │ │
1244 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1245 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1246 │GENDER: is it that drivers│ │ │ │ │ │
1247 │ who have had too │ │ │ │ │ │
1248 │ much to drink to │ │ │ │ │ │
1249 │ drive safely will │ │ │ │ │ │
1250 │ D. Be arrested for│ │ │ │ │ │
1251 │ drunk driving? │ │ │ │ │ │
1252 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1253 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1254 │ is it that drivers│ │ │ │ │ │
1255 │ who have had too │ │ │ │ │ │
1256 │ much to drink to │ │ │ │ │ │
1257 │ drive safely will │ │ │ │ │ │
1258 │ D. Be arrested for│ │ │ │ │ │
1259 │ drunk driving? │ │ │ │ │ │
1260 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1261 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1262 │ is it that drivers│ │ │ │ │ │
1263 │ who have had too │ │ │ │ │ │
1264 │ much to drink to │ │ │ │ │ │
1265 │ drive safely will │ │ │ │ │ │
1266 │ D. Be arrested for│ │ │ │ │ │
1267 │ drunk driving? │ │ │ │ │ │
1268 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1272 AT_SETUP([CTABLES nesting and scale variables])
1273 AT_KEYWORDS([nest nested])
1274 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1275 AT_DATA([ctables.sps],
1277 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1278 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1279 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1280 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1281 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1283 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1285 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1291 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1292 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1293 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1295 │ Once a week or │ 44│ 54│
1297 │ Only certain │ 34│ 41│
1298 │ times a year │ │ │
1300 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1303 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1304 │ │Minimum│Maximum│Mean│
1305 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1306 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1307 │What is GENDER: months, has there been a │ │ │ │
1308 │your time when you felt you │ │ │ │
1309 │age? should cut down on your No │ 16│ 86│ 46│
1311 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1312 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1313 │ months, has there been a │ │ │ │
1314 │ time when you felt you │ │ │ │
1315 │ should cut down on your No │ 16│ 86│ 48│
1317 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1318 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1319 │What is GENDER: months, has there been a │ │ │ │
1320 │your time when people criticized No │ 16│ 86│ 46│
1321 │age? your drinking? │ │ │ │
1322 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1323 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1324 │ months, has there been a │ │ │ │
1325 │ time when people criticized No │ 16│ 86│ 48│
1326 │ your drinking? │ │ │ │
1327 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1330 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1331 │ │S1. Including yourself, how many members of this│
1332 │ │ household are age 16 or older? │
1333 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1334 │ │ │ │ │ │ │ │ 6 or │
1335 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1336 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1337 │ │Column│Column│Column│Column│Column│Column│Column│
1338 │ │ % │ % │ % │ % │ % │ % │ % │
1339 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1340 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1341 │SAMPLE How certain │ │ │ │ │ │ │ │
1342 │SOURCE: likely │ │ │ │ │ │ │ │
1343 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1344 │ that likely │ │ │ │ │ │ │ │
1345 │ drivers │ │ │ │ │ │ │ │
1346 │ who have │ │ │ │ │ │ │ │
1347 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1348 │ much to likely │ │ │ │ │ │ │ │
1349 │ drink to │ │ │ │ │ │ │ │
1350 │ drive │ │ │ │ │ │ │ │
1351 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1352 │ will A. unlikely│ │ │ │ │ │ │ │
1353 │ Get │ │ │ │ │ │ │ │
1354 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1355 │ by the unlikely│ │ │ │ │ │ │ │
1356 │ police? │ │ │ │ │ │ │ │
1357 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1360 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1363 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1364 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1365 │group typical month did you have one or more │ │ │
1366 │ alcoholic beverages to drink? │ │ │
1367 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1368 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1369 │ typical month did you have one or more │ │ │
1370 │ alcoholic beverages to drink? │ │ │
1371 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1372 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1373 │ typical month did you have one or more │ │ │
1374 │ alcoholic beverages to drink? │ │ │
1375 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1376 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1377 │ typical month did you have one or more │ │ │
1378 │ alcoholic beverages to drink? │ │ │
1379 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1380 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1381 │ typical month did you have one or more │ │ │
1382 │ alcoholic beverages to drink? │ │ │
1383 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1384 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1385 │ older typical month did you have one or more │ │ │
1386 │ alcoholic beverages to drink? │ │ │
1387 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1392 AT_SETUP([CTABLES SLABELS])
1393 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1394 AT_DATA([ctables.sps],
1396 CTABLES /TABLE qn1 [COUNT COLPCT].
1397 CTABLES /TABLE qn1 [COUNT COLPCT]
1398 /SLABELS POSITION=ROW.
1399 CTABLES /TABLE qn1 [COUNT COLPCT]
1400 /SLABELS POSITION=ROW VISIBLE=NO.
1402 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1404 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1407 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1408 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1409 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1410 │ Once a week or less│ 361│ 5.2%│
1411 │ Only certain times │ 130│ 1.9%│
1413 │ Never │ 540│ 7.7%│
1414 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1417 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1418 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1419 │other motor vehicle? Column │66.9%│
1421 │ ╶───────────────────────────┼─────┤
1422 │ Several days a week Count │ 1274│
1425 │ ╶───────────────────────────┼─────┤
1426 │ Once a week or less Count │ 361│
1429 │ ╶───────────────────────────┼─────┤
1430 │ Only certain times Count │ 130│
1431 │ a year Column │ 1.9%│
1433 │ ╶───────────────────────────┼─────┤
1434 │ Never Count │ 540│
1437 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1440 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1441 │ 1. How often do you usually drive a car or other Every day │ 4667│
1442 │motor vehicle? │66.9%│
1443 │ Several days a week │ 1274│
1445 │ Once a week or less │ 361│
1447 │ Only certain times a │ 130│
1451 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1455 AT_SETUP([CTABLES simple totals])
1456 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1457 AT_DATA([ctables.sps],
1460 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1461 DESCRIPTIVES qn18/STATISTICS=MEAN.
1462 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1463 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1465 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1467 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1469 ├────────────────────────────────────────────────────────────────────────┼─────┤
1470 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1471 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1474 │ Wine coolers │ 137│
1475 │ Hard liquor or │ 888│
1477 │ Flavored malt │ 83│
1479 │ Number responding │ 4221│
1480 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1482 Descriptive Statistics
1483 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1485 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1486 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1487 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1488 │Valid N (listwise) │6999│ │
1489 │Missing N (listwise) │2781│ │
1490 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1493 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1494 │ │ │ │ Valid│Total│
1495 │ │Mean│Count│ N │ N │
1496 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1497 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1498 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1499 │ you usually drink per sitting? │ │ │ │ │
1500 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1501 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1502 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1503 │ you usually drink per sitting? │ │ │ │ │
1504 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1505 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1506 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1507 │ you usually drink per sitting? │ │ │ │ │
1508 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1509 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1510 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1511 │ you usually drink per sitting? │ │ │ │ │
1512 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1513 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1514 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1515 │ you usually drink per sitting? │ │ │ │ │
1516 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1520 AT_SETUP([CTABLES subtotals])
1521 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1522 AT_DATA([ctables.sps],
1524 CTABLES /TABLE=qn105ba BY qns1
1525 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1526 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1527 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1528 CTABLES /TABLE=qn105ba BY qns1
1529 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1530 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1532 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1534 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1535 │ │ S1. Including yourself, how many members of this household │
1536 │ │ are age 16 or older? │
1537 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1538 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1539 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1540 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1541 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1542 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1543 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1544 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1545 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1546 │ likely │ │ │ │ │ │ │ │
1547 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1548 │ unlikely │ │ │ │ │ │ │ │
1549 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1550 │ unlikely │ │ │ │ │ │ │ │
1551 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1554 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1555 │ │ S1. Including yourself, how many members of this household │
1556 │ │ are age 16 or older? │
1557 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1558 │ │ │ │ │ │ │ │ 6 or │
1559 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1560 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1561 │ │ │ │ │ │ Column│ │ │
1562 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1563 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1564 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1565 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1566 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1567 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1568 │ likely │ │ │ │ │ │ │ │
1569 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1570 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1571 │ unlikely │ │ │ │ │ │ │ │
1572 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1573 │ unlikely │ │ │ │ │ │ │ │
1574 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1575 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1578 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1579 │ │ S1. Including yourself, how many members of this household │
1580 │ │ are age 16 or older? │
1581 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1582 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1583 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1584 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1585 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1586 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1587 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1588 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1589 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1590 │ likely │ │ │ │ │ │ │ │
1591 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1592 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1593 │ unlikely │ │ │ │ │ │ │ │
1594 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1595 │ unlikely │ │ │ │ │ │ │ │
1596 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1597 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1601 AT_SETUP([CTABLES PCOMPUTE])
1602 AT_KEYWORDS([postcompute])
1603 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1604 AT_DATA([ctables.sps],
1607 /PCOMPUTE &x=EXPR([3] + [4])
1608 /PCOMPUTE &y=EXPR([4] + [5])
1609 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1610 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1611 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1612 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1614 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1616 /PCOMPUTE &x=EXPR([3] + [4])
1617 /PCOMPUTE &y=EXPR([4] + [5])
1618 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1619 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1620 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1621 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1623 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1625 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1626 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1627 │ ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1628 │ │ 1 │ 2 │ Subtotal │ 3 │ 4 │ 5 │ 3+4 │ 4+5 │ Subtotal │ Total │
1629 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1630 │ │ │ │ │ │ │ │ │ │ │ Row│ │ Row│ │ │ │ Row│ │ │ │ │
1631 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│ % │Count│ % │ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1632 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1633 │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%│
1634 │likely is certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1635 │it that │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1636 │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%│
1637 │who have likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1638 │had too │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1639 │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%│
1640 │drink to likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1641 │drive │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1642 │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%│
1643 │will A. unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1644 │Get │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1645 │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%│
1646 │the unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1647 │police? │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1648 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1651 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1652 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1653 │ ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1654 │ │ 1 │ 2 │ Subtotal │ 3 │ 3+4 │ 4+5 │ Subtotal │ Total │
1655 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1656 │ │ │ │ │ │ │ │ │ │ │ │ │ Row│ │ │ │ │
1657 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1658 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1659 │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%│
1660 │drivers who have had too much certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1661 │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%│
1662 │A. Get stopped by the police? likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1663 │ 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%│
1664 │ likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1665 │ 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%│
1666 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1667 │ 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%│
1668 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1669 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1673 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1674 AT_KEYWORDS([postcompute])
1675 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1676 AT_DATA([ctables.sps],
1679 /PCOMPUTE &x=EXPR(OTHERNM)
1680 /PCOMPUTE &y=EXPR(MISSING)
1681 /PPROPERTIES &x LABEL='Drivers'
1682 /PPROPERTIES &y LABEL='Missing Values 2'
1684 /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1686 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1688 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1694 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1695 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1696 │ Several days a week │ 440│ 834│
1697 │ Once a week or less │ 125│ 236│
1698 │ Only certain times a year│ 58│ 72│
1700 │ Drivers │ 2928│ 3504│
1701 │ Valid Values │ 3120│ 3852│
1702 │ Don't know │ 3│ 5│
1704 │ Missing Values │ 12│ 15│
1705 │ Missing Values 2 │ 12│ 15│
1706 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1710 AT_SETUP([CTABLES PCOMPUTE - THRU])
1711 AT_KEYWORDS([postcompute])
1712 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1713 AT_DATA([ctables.sps],
1716 /PCOMPUTE &x=EXPR([1 THRU 2])
1717 /PCOMPUTE &y=EXPR([3 THRU 4])
1718 /PCOMPUTE &z=EXPR([5] + MISSING)
1719 /PPROPERTIES &x LABEL='Frequent Drivers'
1720 /PPROPERTIES &y LABEL='Infrequent Drivers'
1721 /PPROPERTIES &z LABEL='Not Drivers or Missing'
1723 /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
1725 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1727 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1733 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1734 │ 1. How often do you usually drive a car or other motor vehicle? Every day │ 2305│ 2362│
1735 │ Several days a week │ 440│ 834│
1736 │ Frequent Drivers │ 2745│ 3196│
1737 │ Once a week or less │ 125│ 236│
1738 │ Only certain times a year│ 58│ 72│
1739 │ Infrequent Drivers │ 183│ 308│
1740 │ Drivers │ 2928│ 3504│
1742 │ Don't know │ 3│ 5│
1744 │ Not Drivers or Missing │ 204│ 363│
1745 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1749 dnl I'm not sure that this is the correct behavior (see
1750 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
1751 dnl but at least this test will notify us if the behavior changes.
1752 AT_SETUP([CTABLES intersecting PCOMPUTEs])
1753 AT_KEYWORDS([PCOMPUTE postcompute])
1754 AT_DATA([ctables.sps],
1755 [[DATA LIST LIST NOTABLE/x y z.
1758 VARIABLE LEVEL x y (NOMINAL).
1772 /PCOMPUTE &a = EXPR([1] + [2])
1773 /PCOMPUTE &b = EXPR([2] + [3])
1774 /PCOMPUTE &c = EXPR([4] * [5])
1775 /PCOMPUTE &d = EXPR([5] * [6])
1777 /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
1778 /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
1780 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
1782 ╭───────────┬─────────────────────────────────────╮
1784 │ ├─────┬─────────┬─────┬─────────┬─────┤
1785 │ │ 4 │[4] * [5]│ 5 │[5] * [6]│ 6 │
1786 │ ├─────┼─────────┼─────┼─────────┼─────┤
1787 │ │Count│ Count │Count│ Count │Count│
1788 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
1789 │x 1 │ 5│ 10│ 2│ 18│ 9│
1790 │ [1] + [2]│ 7│ .│ 5│ .│ 13│
1791 │ 2 │ 2│ 6│ 3│ 12│ 4│
1792 │ [2] + [3]│ 3│ .│ 9│ .│ 5│
1793 │ 3 │ 1│ 6│ 6│ 6│ 1│
1794 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
1798 AT_SETUP([CTABLES string and date and time])
1801 for gender in F M; do
1802 for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
1803 for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
1804 printf "$weight $gender $month $wkday\n"
1805 weight=$(expr \( $weight + 3 \) % 7 + 2)
1810 AT_DATA([ctables.sps],
1811 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
1812 /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
1814 VARIABLE LEVEL w (SCALE).
1815 VARIABLE LEVEL gender fmon fday (NOMINAL).
1818 fmon 'Favorite month'
1819 fday 'Favorite day of the week'.
1820 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
1822 /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
1823 /PPROPERTIES &q2 LABEL='Q2'
1824 /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
1825 /PPROPERTIES &weekend LABEL='Weekend'
1826 /TABLE fmon BY gender > fday
1827 /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
1829 'JUL' THRU 'sep', SUBTOTAL="Q3",
1830 OTHERNM, SUBTOTAL='Q4']
1831 /CATEGORIES VARIABLES=gender ['M', 'F']
1832 /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
1833 /SLABELS VISIBLE=NO.
1835 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1837 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
1839 │ ├─────────────────────────────────────────┬─────────────────────────────────────────┤
1841 │ ├─────────────────────────────────────────┼─────────────────────────────────────────┤
1842 │ │ Favorite day of the week │ Favorite day of the week │
1843 │ ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
1844 │ │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
1845 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
1846 │Favorite month JAN│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 9│ 6│ 4│ 2│ 7│ 5│ 3│ 12│ 36│
1847 │ FEB│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1848 │ MAR│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1849 │ Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│ │ │ 29│ 12│ 13│ 14│ 15│ 16│ 17│ │ │
1850 │ APR│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1851 │ MAY│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1852 │ JUN│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│
1853 │ Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│ .│ │ 28│ 15│ 16│ 17│ 18│ 12│ 13│ .│ │
1854 │ JUL│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│
1855 │ AUG│ 10│ 3│ 8│ 6│ 4│ 2│ 7│ 17│ 40│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│
1856 │ SEP│ 6│ 8│ 6│ 4│ 2│ 7│ 5│ 11│ 38│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│
1857 │ Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│ │ │ 62│ 33│ 28│ 30│ 32│ 27│ 29│ │ │
1858 │ OCT│ 16│ 6│ 4│ 2│ 7│ 5│ 3│ 19│ 43│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│
1859 │ NOV│ 12│ 4│ 2│ 7│ 5│ 3│ 8│ 20│ 41│ 4│ 7│ 5│ 3│ 8│ 6│ 4│ 8│ 37│
1860 │ DEC│ 8│ 2│ 7│ 5│ 3│ 8│ 6│ 14│ 39│ 14│ 5│ 3│ 8│ 6│ 4│ 2│ 16│ 42│
1861 │ Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│ │ │ 26│ 14│ 15│ 16│ 17│ 18│ 12│ │ │
1862 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
1866 AT_SETUP([CTABLES CLABELS])
1867 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1868 AT_DATA([ctables.sps],
1870 CTABLES /TABLE AgeGroup BY qns3a.
1871 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1872 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1873 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1874 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1876 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1878 ╭───────────────────────┬────────────╮
1884 ├───────────────────────┼─────┼──────┤
1885 │Age group 15 or younger│ 0│ 0│
1886 │ 16 to 25 │ 594│ 505│
1887 │ 26 to 35 │ 476│ 491│
1888 │ 36 to 45 │ 489│ 548│
1889 │ 46 to 55 │ 526│ 649│
1890 │ 56 to 65 │ 516│ 731│
1891 │ 66 or older │ 531│ 943│
1892 ╰───────────────────────┴─────┴──────╯
1895 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1897 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1899 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1900 │ │ 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 │
1901 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1902 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1903 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1904 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1905 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1906 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1907 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1910 ╭──────────────────────────────┬────────────╮
1914 ├──────────────────────────────┼────────────┤
1915 │Age group 15 or younger Male │ 0│
1917 │ ╶────────────────────┼────────────┤
1918 │ 16 to 25 Male │ 594│
1920 │ ╶────────────────────┼────────────┤
1921 │ 26 to 35 Male │ 476│
1923 │ ╶────────────────────┼────────────┤
1924 │ 36 to 45 Male │ 489│
1926 │ ╶────────────────────┼────────────┤
1927 │ 46 to 55 Male │ 526│
1929 │ ╶────────────────────┼────────────┤
1930 │ 56 to 65 Male │ 516│
1932 │ ╶────────────────────┼────────────┤
1933 │ 66 or older Male │ 531│
1935 ╰──────────────────────────────┴────────────╯
1939 ╭─────────┬────────────╮
1945 ├─────────┼─────┼──────┤
1947 ╰─────────┴─────┴──────╯
1951 ╭─────────┬────────────╮
1957 ├─────────┼─────┼──────┤
1958 │Age group│ 594│ 505│
1959 ╰─────────┴─────┴──────╯
1963 ╭─────────┬────────────╮
1969 ├─────────┼─────┼──────┤
1970 │Age group│ 476│ 491│
1971 ╰─────────┴─────┴──────╯
1975 ╭─────────┬────────────╮
1981 ├─────────┼─────┼──────┤
1982 │Age group│ 489│ 548│
1983 ╰─────────┴─────┴──────╯
1987 ╭─────────┬────────────╮
1993 ├─────────┼─────┼──────┤
1994 │Age group│ 526│ 649│
1995 ╰─────────┴─────┴──────╯
1999 ╭─────────┬────────────╮
2005 ├─────────┼─────┼──────┤
2006 │Age group│ 516│ 731│
2007 ╰─────────┴─────┴──────╯
2011 ╭─────────┬────────────╮
2017 ├─────────┼─────┼──────┤
2018 │Age group│ 531│ 943│
2019 ╰─────────┴─────┴──────╯
2023 ╭───────────────────────┬────────────╮
2027 ├───────────────────────┼────────────┤
2028 │Age group 15 or younger│ 0│
2034 │ 66 or older │ 531│
2035 ╰───────────────────────┴────────────╯
2039 ╭───────────────────────┬────────────╮
2043 ├───────────────────────┼────────────┤
2044 │Age group 15 or younger│ 0│
2050 │ 66 or older │ 943│
2051 ╰───────────────────────┴────────────╯
2055 AT_SETUP([CTABLES missing values])
2056 AT_DATA([ctables.sps],
2057 [[DATA LIST LIST NOTABLE/x y.
2096 MISSING VALUES x (1, 2) y (2, 3).
2097 VARIABLE LEVEL ALL (NOMINAL).
2099 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2100 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2101 /CATEGORIES VARIABLES=ALL TOTAL=YES.
2102 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2103 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2104 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2105 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2106 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2107 /CATEGORIES VARIABLES=ALL TOTAL=YES
2108 /SLABELS POSITION=ROW.
2109 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2110 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2111 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
2112 /SLABELS POSITION=ROW.
2113 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2114 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2115 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
2116 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
2117 /SLABELS POSITION=ROW.
2119 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2121 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2122 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2123 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2124 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2125 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2126 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
2127 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2128 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2129 dnl Note that Column Total N % doesn't add up to 100 because missing
2130 dnl values are included in the total but not shown as a category and this
2131 dnl is expected behavior.
2134 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2135 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2136 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2137 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2138 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
2139 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2140 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2141 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
2142 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
2143 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2144 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2145 dnl values are included in the total but not shown as a category and this
2146 dnl is expected behavior.
2149 ╭────────────────────────┬───────────────────────────╮
2151 │ ├──────┬──────┬──────┬──────┤
2152 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
2153 ├────────────────────────┼──────┼──────┼──────┼──────┤
2154 │x 3.00 Count │ 1│ 1│ 1│ 3│
2155 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2156 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2157 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2158 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2159 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2160 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2161 │ Valid N │ │ │ │ 3│
2162 │ Total N │ │ │ │ 6│
2163 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2164 │ 4.00 Count │ 1│ 1│ 1│ 3│
2165 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2166 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2167 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2168 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2169 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2170 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2171 │ Valid N │ │ │ │ 3│
2172 │ Total N │ │ │ │ 6│
2173 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2174 │ 5.00 Count │ 1│ 1│ 1│ 3│
2175 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
2176 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
2177 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
2178 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2179 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
2180 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
2181 │ Valid N │ │ │ │ 3│
2182 │ Total N │ │ │ │ 6│
2183 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2184 │ Total Count │ 3│ 3│ 3│ 9│
2185 │ Column % │100.0%│100.0%│100.0%│ .│
2186 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
2187 │ Column Total N %│100.0%│100.0%│100.0%│ .│
2188 │ Row % │ .│ .│ .│ .│
2189 │ Row Valid N % │ .│ .│ .│ .│
2190 │ Row Total N % │ .│ .│ .│ .│
2191 │ Valid N │ 3│ 3│ 3│ 9│
2192 │ Total N │ 6│ 6│ 6│ 36│
2193 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2196 ╭────────────────────────┬─────────────────────────────────────────╮
2198 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
2199 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2200 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2201 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2202 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2203 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2204 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2205 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2206 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2207 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2208 │ Valid N │ │ │ │ │ │ 0│
2209 │ Total N │ │ │ │ │ │ 6│
2210 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2211 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2212 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2213 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2214 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2215 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2216 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2217 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2218 │ Valid N │ │ │ │ │ │ 0│
2219 │ Total N │ │ │ │ │ │ 6│
2220 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2221 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2222 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2223 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2224 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2225 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2226 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2227 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2228 │ Valid N │ │ │ │ │ │ 3│
2229 │ Total N │ │ │ │ │ │ 6│
2230 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2231 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2232 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2233 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2234 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2235 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2236 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2237 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2238 │ Valid N │ │ │ │ │ │ 3│
2239 │ Total N │ │ │ │ │ │ 6│
2240 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2241 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2242 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2243 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2244 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2245 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2246 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2247 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2248 │ Valid N │ │ │ │ │ │ 3│
2249 │ Total N │ │ │ │ │ │ 6│
2250 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2251 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
2252 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2253 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
2254 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2255 │ Row % │ .│ .│ .│ .│ .│ .│
2256 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2257 │ Row Total N % │ .│ .│ .│ .│ .│ .│
2258 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
2259 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
2260 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2263 ╭────────────────────────┬──────────────────────────────────╮
2265 │ ├──────┬──────┬──────┬──────┬──────┤
2266 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2267 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2268 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
2269 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2270 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2271 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2272 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2273 │ Row Valid N % │ .│ .│ .│ .│ .│
2274 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2275 │ Valid N │ │ │ │ │ 0│
2276 │ Total N │ │ │ │ │ 6│
2277 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2278 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
2279 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2280 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2281 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2282 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2283 │ Row Valid N % │ .│ .│ .│ .│ .│
2284 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2285 │ Valid N │ │ │ │ │ 0│
2286 │ Total N │ │ │ │ │ 6│
2287 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2288 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
2289 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2290 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2291 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2292 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2293 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2294 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2295 │ Valid N │ │ │ │ │ 3│
2296 │ Total N │ │ │ │ │ 6│
2297 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2298 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2299 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2300 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2301 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2302 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2303 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2304 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2305 │ Valid N │ │ │ │ │ 3│
2306 │ Total N │ │ │ │ │ 6│
2307 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2308 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2309 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2310 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2311 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2312 │ Row % │ .│ .│ .│ .│ .│
2313 │ Row Valid N % │ .│ .│ .│ .│ .│
2314 │ Row Total N % │ .│ .│ .│ .│ .│
2315 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2316 │ Total N │ 5│ 5│ 5│ 5│ 30│
2317 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2321 AT_SETUP([CTABLES SMISSING=LISTWISE])
2322 AT_KEYWORDS([SMISSING LISTWISE])
2323 AT_DATA([ctables.sps],
2324 [[DATA LIST LIST NOTABLE/x y z.
2332 VARIABLE LEVEL x (NOMINAL).
2334 CTABLES /TABLE (y + z) > x.
2335 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2337 * The following doesn't come out as listwise because the tables are
2338 separate, not linked by an > operator.
2339 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2341 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2371 AT_SETUP([CTABLES VLABELS - variables on different axes])
2372 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2373 AT_DATA([ctables.sps],
2375 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2376 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2377 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2378 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2379 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2381 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2383 ╭────────────────────────────────────────────────────────────────┬────────────╮
2389 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2390 │D5a. What would you say is your primary Cuban │ 13│ 7│
2391 │ethnic background? Mexican │ 175│ 136│
2393 │ South American │ 21│ 13│
2394 │ Central American │ 27│ 25│
2395 │ Puerto Rican, OR │ 37│ 41│
2396 │ Something else │ 35│ 33│
2397 │ Multiple - cannot │ 2│ 5│
2399 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2402 ╭──────────────────────────────────┬────────────╮
2408 ├──────────────────────────────────┼─────┼──────┤
2409 │QND5A Cuban │ 13│ 7│
2410 │ Mexican │ 175│ 136│
2412 │ South American │ 21│ 13│
2413 │ Central American │ 27│ 25│
2414 │ Puerto Rican, OR │ 37│ 41│
2415 │ Something else │ 35│ 33│
2416 │ Multiple - cannot choose one│ 2│ 5│
2417 ╰──────────────────────────────────┴─────┴──────╯
2420 ╭────────────────────────────────────────────────────────────────┬────────────╮
2426 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2427 │D5a. What would you say is your primary Cuban │ 13│ 7│
2428 │ethnic background? Mexican │ 175│ 136│
2430 │ South American │ 21│ 13│
2431 │ Central American │ 27│ 25│
2432 │ Puerto Rican, OR │ 37│ 41│
2433 │ Something else │ 35│ 33│
2434 │ Multiple - cannot │ 2│ 5│
2436 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2439 ╭────────────────────────────────────────────────────────────┬────────────────╮
2442 │ ├───────┬────────┤
2444 │ ├───────┼────────┤
2446 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2447 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2448 │primary ethnic background? Mexican │ 175│ 136│
2450 │ South American │ 21│ 13│
2451 │ Central American │ 27│ 25│
2452 │ Puerto Rican, OR │ 37│ 41│
2453 │ Something else │ 35│ 33│
2454 │ Multiple - cannot │ 2│ 5│
2456 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2459 ╭────────────────────────────┬─────┬──────╮
2463 ├────────────────────────────┼─────┼──────┤
2465 │Mexican │ 175│ 136│
2467 │South American │ 21│ 13│
2468 │Central American │ 27│ 25│
2469 │Puerto Rican, OR │ 37│ 41│
2470 │Something else │ 35│ 33│
2471 │Multiple - cannot choose one│ 2│ 5│
2472 ╰────────────────────────────┴─────┴──────╯
2476 AT_SETUP([CTABLES VLABELS - stacked variables])
2477 AT_KEYWORDS([stack stacking])
2478 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2479 AT_DATA([ctables.sps],
2481 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2482 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2483 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2484 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2485 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2487 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2489 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2491 ├───────────────────────────────────────────────────────────────────────┼─────┤
2492 │D5a. What would you say is your primary ethnic Cuban │ 20│
2493 │background? Mexican │ 311│
2495 │ South American │ 34│
2496 │ Central American │ 52│
2497 │ Puerto Rican, OR │ 78│
2498 │ Something else │ 68│
2499 │ Multiple - cannot │ 7│
2501 ├───────────────────────────────────────────────────────────────────────┼─────┤
2504 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2507 ╭─────────────────────────────────────────┬─────╮
2509 ├─────────────────────────────────────────┼─────┤
2513 │ South American │ 34│
2514 │ Central American │ 52│
2515 │ Puerto Rican, OR │ 78│
2516 │ Something else │ 68│
2517 │ Multiple - cannot choose one│ 7│
2518 ├─────────────────────────────────────────┼─────┤
2519 │S3a. GENDER: Male │ 3132│
2521 ╰─────────────────────────────────────────┴─────╯
2524 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2526 ├───────────────────────────────────────────────────────────────────────┼─────┤
2527 │D5a. What would you say is your primary ethnic Cuban │ 20│
2528 │background? Mexican │ 311│
2530 │ South American │ 34│
2531 │ Central American │ 52│
2532 │ Puerto Rican, OR │ 78│
2533 │ Something else │ 68│
2534 │ Multiple - cannot │ 7│
2536 ├───────────────────────────────────────────────────────────────────────┼─────┤
2538 ├───────────────────────────────────────────────────────────────────────┼─────┤
2540 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2543 ╭─────────────────────────────┬─────╮
2545 ├─────────────────────────────┼─────┤
2547 ├─────────────────────────────┼─────┤
2549 ├─────────────────────────────┼─────┤
2551 ├─────────────────────────────┼─────┤
2552 │South American │ 34│
2553 ├─────────────────────────────┼─────┤
2554 │Central American │ 52│
2555 ├─────────────────────────────┼─────┤
2556 │Puerto Rican, OR │ 78│
2557 ├─────────────────────────────┼─────┤
2558 │Something else │ 68│
2559 ├─────────────────────────────┼─────┤
2560 │Multiple - cannot choose one │ 7│
2561 ├─────────────────────────────┼─────┤
2562 │S3a. GENDER: Male │ 3132│
2564 ╰─────────────────────────────┴─────╯
2567 ╭────────────────────────────┬─────╮
2569 ├────────────────────────────┼─────┤
2573 │South American │ 34│
2574 │Central American │ 52│
2575 │Puerto Rican, OR │ 78│
2576 │Something else │ 68│
2577 │Multiple - cannot choose one│ 7│
2580 ╰────────────────────────────┴─────╯
2584 AT_SETUP([CTABLES VLABELS - nested variables])
2585 AT_KEYWORDS([nest nesting])
2586 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2587 AT_DATA([ctables.sps],
2589 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2590 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2591 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2592 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2593 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2595 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2597 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2599 ├───────────────────────────────────────────────────────────────────────┼─────┤
2600 │D5a. What would you say is your Cuban QNS3A Male │ 13│
2601 │primary ethnic background? Female│ 7│
2602 │ ╶─────────────────────────────────┼─────┤
2603 │ Mexican QNS3A Male │ 175│
2605 │ ╶─────────────────────────────────┼─────┤
2606 │ Spanish QNS3A Male │ 20│
2608 │ ╶─────────────────────────────────┼─────┤
2609 │ South American QNS3A Male │ 21│
2611 │ ╶─────────────────────────────────┼─────┤
2612 │ Central American QNS3A Male │ 27│
2614 │ ╶─────────────────────────────────┼─────┤
2615 │ Puerto Rican, OR QNS3A Male │ 37│
2617 │ ╶─────────────────────────────────┼─────┤
2618 │ Something else QNS3A Male │ 35│
2620 │ ╶─────────────────────────────────┼─────┤
2621 │ Multiple - cannot QNS3A Male │ 2│
2622 │ choose one Female│ 5│
2623 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2626 ╭──────────────────────────────────────────────────────┬─────╮
2628 ├──────────────────────────────────────────────────────┼─────┤
2629 │QND5A Cuban S3a. GENDER: Male │ 13│
2631 │ ╶────────────────────────────────────────────────┼─────┤
2632 │ Mexican S3a. GENDER: Male │ 175│
2634 │ ╶────────────────────────────────────────────────┼─────┤
2635 │ Spanish S3a. GENDER: Male │ 20│
2637 │ ╶────────────────────────────────────────────────┼─────┤
2638 │ South American S3a. GENDER: Male │ 21│
2640 │ ╶────────────────────────────────────────────────┼─────┤
2641 │ Central American S3a. GENDER: Male │ 27│
2643 │ ╶────────────────────────────────────────────────┼─────┤
2644 │ Puerto Rican, OR S3a. GENDER: Male │ 37│
2646 │ ╶────────────────────────────────────────────────┼─────┤
2647 │ Something else S3a. GENDER: Male │ 35│
2649 │ ╶────────────────────────────────────────────────┼─────┤
2650 │ Multiple - cannot choose one S3a. GENDER: Male │ 2│
2652 ╰──────────────────────────────────────────────────────┴─────╯
2655 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2657 ├───────────────────────────────────────────────────────────────────────┼─────┤
2658 │D5a. What would you say is your primary Cuban Male │ 13│
2659 │ethnic background? Female│ 7│
2660 │ ╶────────────────────────────┼─────┤
2661 │ Mexican Male │ 175│
2663 │ ╶────────────────────────────┼─────┤
2664 │ Spanish Male │ 20│
2666 │ ╶────────────────────────────┼─────┤
2667 │ South American Male │ 21│
2669 │ ╶────────────────────────────┼─────┤
2670 │ Central American Male │ 27│
2672 │ ╶────────────────────────────┼─────┤
2673 │ Puerto Rican, OR Male │ 37│
2675 │ ╶────────────────────────────┼─────┤
2676 │ Something else Male │ 35│
2678 │ ╶────────────────────────────┼─────┤
2679 │ Multiple - cannot Male │ 2│
2680 │ choose one Female│ 5│
2681 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2684 ╭────────────────────────────────────────────────┬─────╮
2686 ├────────────────────────────────────────────────┼─────┤
2687 │Cuban S3a. GENDER: Male │ 13│
2689 ├────────────────────────────────────────────────┼─────┤
2690 │Mexican S3a. GENDER: Male │ 175│
2692 ├────────────────────────────────────────────────┼─────┤
2693 │Spanish S3a. GENDER: Male │ 20│
2695 ├────────────────────────────────────────────────┼─────┤
2696 │South American S3a. GENDER: Male │ 21│
2698 ├────────────────────────────────────────────────┼─────┤
2699 │Central American S3a. GENDER: Male │ 27│
2701 ├────────────────────────────────────────────────┼─────┤
2702 │Puerto Rican, OR S3a. GENDER: Male │ 37│
2704 ├────────────────────────────────────────────────┼─────┤
2705 │Something else S3a. GENDER: Male │ 35│
2707 ├────────────────────────────────────────────────┼─────┤
2708 │Multiple - cannot choose one S3a. GENDER: Male │ 2│
2710 ╰────────────────────────────────────────────────┴─────╯
2713 ╭───────────────────────────────────┬─────╮
2715 ├───────────────────────────────────┼─────┤
2718 ├───────────────────────────────────┼─────┤
2719 │Mexican Male │ 175│
2721 ├───────────────────────────────────┼─────┤
2724 ├───────────────────────────────────┼─────┤
2725 │South American Male │ 21│
2727 ├───────────────────────────────────┼─────┤
2728 │Central American Male │ 27│
2730 ├───────────────────────────────────┼─────┤
2731 │Puerto Rican, OR Male │ 37│
2733 ├───────────────────────────────────┼─────┤
2734 │Something else Male │ 35│
2736 ├───────────────────────────────────┼─────┤
2737 │Multiple - cannot choose one Male │ 2│
2739 ╰───────────────────────────────────┴─────╯
2743 AT_SETUP([CTABLES FORMAT EMPTY])
2744 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2745 AT_DATA([ctables.sps],
2747 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2748 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2749 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2751 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2753 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2754 │ │ D5. ETHNICITY: Are you of │
2755 │ │ Hispanic or Latino origin or │
2757 │ ├───────────────┬───────────────┤
2759 │ ├───────────────┼───────────────┤
2761 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2762 │D5a. What would you say is Cuban │ 20│ 0│
2763 │your primary ethnic Mexican │ 311│ 0│
2764 │background? Spanish │ 48│ 0│
2765 │ South American │ 34│ 0│
2766 │ Central American│ 52│ 0│
2767 │ Puerto Rican, OR│ 78│ 0│
2768 │ Something else │ 68│ 0│
2769 │ Multiple - │ 7│ 0│
2770 │ cannot choose │ │ │
2772 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2775 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2776 │ │ D5. ETHNICITY: Are you of │
2777 │ │ Hispanic or Latino origin or │
2779 │ ├───────────────┬───────────────┤
2781 │ ├───────────────┼───────────────┤
2783 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2784 │D5a. What would you say is Cuban │ 20│ │
2785 │your primary ethnic Mexican │ 311│ │
2786 │background? Spanish │ 48│ │
2787 │ South American │ 34│ │
2788 │ Central American│ 52│ │
2789 │ Puerto Rican, OR│ 78│ │
2790 │ Something else │ 68│ │
2792 │ cannot choose │ │ │
2794 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2797 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2798 │ │ D5. ETHNICITY: Are you of │
2799 │ │ Hispanic or Latino origin or │
2801 │ ├───────────────┬───────────────┤
2803 │ ├───────────────┼───────────────┤
2805 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2806 │D5a. What would you say is Cuban │ 20│n/a │
2807 │your primary ethnic Mexican │ 311│n/a │
2808 │background? Spanish │ 48│n/a │
2809 │ South American │ 34│n/a │
2810 │ Central American│ 52│n/a │
2811 │ Puerto Rican, OR│ 78│n/a │
2812 │ Something else │ 68│n/a │
2813 │ Multiple - │ 7│n/a │
2814 │ cannot choose │ │ │
2816 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2820 AT_SETUP([CTABLES FORMAT MISSING])
2821 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2822 AT_DATA([ctables.sps],
2824 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2826 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2828 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2829 │ │ D5. ETHNICITY: Are you of │
2830 │ │ Hispanic or Latino origin or │
2832 │ ├───────────────┬───────────────┤
2834 │ ├───────────────┼───────────────┤
2835 │ │ Column % │ Column % │
2836 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2837 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2838 │your primary ethnic Mexican │ 50.3%│(no data) │
2839 │background? Spanish │ 7.8%│(no data) │
2840 │ South American │ 5.5%│(no data) │
2841 │ Central American│ 8.4%│(no data) │
2842 │ Puerto Rican, OR│ 12.6%│(no data) │
2843 │ Something else │ 11.0%│(no data) │
2844 │ Multiple - │ 1.1%│(no data) │
2845 │ cannot choose │ │ │
2847 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2851 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2852 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2853 AT_DATA([ctables.sps],
2855 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2856 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2857 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2859 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2861 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2863 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2864 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2865 │occasion? 1 │ 491│ 34.9%│
2885 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2888 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2890 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2891 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2892 │occasion? 1 │ 491│ 34.9%│
2912 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2915 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2917 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2918 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2919 │occasion? 1 │ 491│ 34.9%│
2939 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2943 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2944 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2945 AT_DATA([ctables.sps],
2947 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2949 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2961 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2962 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2963 maximumColumnWidth="192"
2964 minimumColumnWidth="96"
2968 AT_SETUP([CTABLES special formats])
2969 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2970 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2971 AT_DATA([ctables.sps],
2973 COMPUTE x = qnd3 - 4.
2974 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].
2976 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2978 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2979 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2980 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2981 │x│(3.0) │N=-3.0 │(-3.0) │(-3.0%)│8.0 │N=8.0 │(8.0) │(8.0%) │
2982 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2986 AT_SETUP([CTABLES TITLES])
2987 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2988 AT_DATA([ctables.sps],
2991 /VLABELS VARIABLES=qn1 DISPLAY=NONE
2992 /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2993 /TITLES TITLE='How often do you drive?'
2994 CAPTION='Generated )TIME on )DATE'
2997 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
2998 s&../../..&MM/DD/YY&'], [0], [dnl
2999 How often do you drive?
3000 ╭───────────────────────────────────┬─────────────────────────────────────────╮
3002 │ ├────────────────────┬────────────────────┤
3004 │ ├────────────────────┼────────────────────┤
3005 │ │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3006 │ │ you of Hispanic or │ you of Hispanic or │
3007 │ │ Latino origin or │ Latino origin or │
3008 │( ( 1. How often do you usually │ descent? │ descent? │
3009 │drive a car or other motor ├─────────┬──────────┼─────────┬──────────┤
3010 │vehicle?) ) BY S3a. GENDER: > D5. │ Yes │ No │ Yes │ No │
3011 │ETHNICITY: Are you of Hispanic or ├─────────┼──────────┼─────────┼──────────┤
3012 │Latino origin or descent? │ Count │ Count │ Count │ Count │
3013 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3014 │Every day │ 218│ 2066│ 166│ 2175│
3015 │Several days a week │ 44│ 391│ 45│ 782│
3016 │Once a week or less │ 16│ 109│ 12│ 223│
3017 │Only certain times a year │ 15│ 41│ 11│ 61│
3018 │Never │ 39│ 150│ 56│ 278│
3019 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3020 Generated HH:MM:SS on MM/DD/YY
3024 AT_SETUP([CTABLES area definitions])
3025 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3026 AT_DATA([ctables.sps],
3029 /VLABELS VARIABLES=ALL DISPLAY=NAME
3030 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLE.ID, LAYER.ID, SUBTABLE.ID]
3031 /SLABELS POSITION=ROW
3032 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROW.ID, LAYERROW.ID]
3033 /SLABELS POSITION=ROW
3034 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COL.ID, LAYERCOL.ID]
3035 /SLABELS POSITION=ROW.
3037 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3040 ╭─────────────────────────────┬─────────────┬──────╮
3042 │ ├──────┬──────┼───┬──┤
3044 │ ├──────┼──────┤ │ │
3045 │ │ QN86 │ QN86 │ │ │
3046 │ ├───┬──┼───┬──┤ │ │
3047 │ │Yes│No│Yes│No│Yes│No│
3048 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3049 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3050 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3051 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
3052 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3053 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3054 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3055 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
3056 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3057 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3058 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3059 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
3060 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3061 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3062 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
3063 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
3064 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3068 ╭─────────────────────────────┬─────────────┬──────╮
3070 │ ├──────┬──────┼───┬──┤
3072 │ ├──────┼──────┤ │ │
3073 │ │ QN86 │ QN86 │ │ │
3074 │ ├───┬──┼───┬──┤ │ │
3075 │ │Yes│No│Yes│No│Yes│No│
3076 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3077 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3078 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3079 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
3080 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3081 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3082 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3083 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
3084 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3085 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3086 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3087 │ Subtable ID│ 10│10│ 11│11│ 12│12│
3088 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
3089 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
3090 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
3091 │ Subtable ID│ 10│10│ 11│11│ 12│12│
3092 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3096 ╭──────────────────────────────┬─────────────┬──────╮
3098 │ ├──────┬──────┼───┬──┤
3100 │ ├──────┼──────┤ │ │
3101 │ │ QN86 │ QN86 │ │ │
3102 │ ├───┬──┼───┬──┤ │ │
3103 │ │Yes│No│Yes│No│Yes│No│
3104 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3105 │QN61 Yes QN57 Yes Row ID │ 1│ 1│ 2│ 2│ 3│ 3│
3106 │ Layer Row ID│ 1│ 1│ 1│ 1│ 2│ 2│
3107 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3108 │ No Row ID │ 4│ 4│ 5│ 5│ 6│ 6│
3109 │ Layer Row ID│ 3│ 3│ 3│ 3│ 4│ 4│
3110 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3111 │ No QN57 Yes Row ID │ 7│ 7│ 8│ 8│ 9│ 9│
3112 │ Layer Row ID│ 5│ 5│ 5│ 5│ 6│ 6│
3113 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3114 │ No Row ID │ 10│10│ 11│11│ 12│12│
3115 │ Layer Row ID│ 7│ 7│ 7│ 7│ 8│ 8│
3116 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3120 ╭──────────────────────────────┬─────────────┬──────╮
3122 │ ├──────┬──────┼───┬──┤
3124 │ ├──────┼──────┤ │ │
3125 │ │ QN86 │ QN86 │ │ │
3126 │ ├───┬──┼───┬──┤ │ │
3127 │ │Yes│No│Yes│No│Yes│No│
3128 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3129 │QN61 Yes QN57 Yes Row ID │ 13│13│ 14│14│ 15│15│
3130 │ Layer Row ID│ 9│ 9│ 9│ 9│ 10│10│
3131 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3132 │ No Row ID │ 16│16│ 17│17│ 18│18│
3133 │ Layer Row ID│ 11│11│ 11│11│ 12│12│
3134 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3135 │ No QN57 Yes Row ID │ 19│19│ 20│20│ 21│21│
3136 │ Layer Row ID│ 13│13│ 13│13│ 14│14│
3137 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
3138 │ No Row ID │ 22│22│ 23│23│ 24│24│
3139 │ Layer Row ID│ 15│15│ 15│15│ 16│16│
3140 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3144 ╭─────────────────────────────────┬─────────────┬──────╮
3146 │ ├──────┬──────┼───┬──┤
3148 │ ├──────┼──────┤ │ │
3149 │ │ QN86 │ QN86 │ │ │
3150 │ ├───┬──┼───┬──┤ │ │
3151 │ │Yes│No│Yes│No│Yes│No│
3152 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3153 │QN61 Yes QN57 Yes Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3154 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3155 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3156 │ No Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
3157 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3158 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3159 │ No QN57 Yes Column ID │ 7│ 8│ 9│10│ 11│12│
3160 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3161 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3162 │ No Column ID │ 7│ 8│ 9│10│ 11│12│
3163 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
3164 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3168 ╭─────────────────────────────────┬─────────────┬──────╮
3170 │ ├──────┬──────┼───┬──┤
3172 │ ├──────┼──────┤ │ │
3173 │ │ QN86 │ QN86 │ │ │
3174 │ ├───┬──┼───┬──┤ │ │
3175 │ │Yes│No│Yes│No│Yes│No│
3176 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3177 │QN61 Yes QN57 Yes Column ID │ 13│14│ 15│16│ 17│18│
3178 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3179 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3180 │ No Column ID │ 13│14│ 15│16│ 17│18│
3181 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3182 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3183 │ No QN57 Yes Column ID │ 19│20│ 21│22│ 23│24│
3184 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3185 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3186 │ No Column ID │ 19│20│ 21│22│ 23│24│
3187 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3188 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3192 AT_SETUP([CTABLES categorical summary functions])
3193 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3194 AT_DATA([ctables.sps],
3197 /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
3198 /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
3199 /SLABELS POSITION=ROW.
3201 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
3203 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
3204 │ │ D5a. What would you say is your primary ethnic background? │
3205 │ ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
3206 │ │ │ │ │ │ │ │ │ Multiple - │ │ │ │
3207 │ │ │ │ │ South │ Central │ Puerto │ Something│ cannot choose│ Don't│ │ │
3208 │ │Cuban│Mexican│Spanish│ American │ American │Rican, OR│ else │ one │ know │Refused│Total│
3209 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3210 │Region NE Count │ 6│ 8│ 8│ 11│ 7│ 39│ 23│ 2│ 0│ 1│ 105│
3211 │ Row % │ 5.7%│ 7.6%│ 7.6%│ 10.5%│ 6.7%│ 37.1%│ 21.9%│ 1.9%│ .0%│ 1.0%│ │
3212 │ Row │ 5.8%│ 7.7%│ 7.7%│ 10.6%│ 6.7%│ 37.5%│ 22.1%│ 1.9%│ .0%│ .0%│ │
3213 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3214 │ % │ │ │ │ │ │ │ │ │ │ │ │
3215 │ Row │ .4%│ .6%│ .6%│ .8%│ .5%│ 2.8%│ 1.6%│ .1%│ .0%│ .1%│ │
3216 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3217 │ % │ │ │ │ │ │ │ │ │ │ │ │
3218 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 104│
3219 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1409│
3220 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3221 │ MW Count │ 3│ 24│ 1│ 4│ 5│ 9│ 6│ 0│ 0│ 1│ 53│
3222 │ Row % │ 5.7%│ 45.3%│ 1.9%│ 7.5%│ 9.4%│ 17.0%│ 11.3%│ .0%│ .0%│ 1.9%│ │
3223 │ Row │ 5.8%│ 46.2%│ 1.9%│ 7.7%│ 9.6%│ 17.3%│ 11.5%│ .0%│ .0%│ .0%│ │
3224 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3225 │ % │ │ │ │ │ │ │ │ │ │ │ │
3226 │ Row │ .2%│ 1.5%│ .1%│ .2%│ .3%│ .5%│ .4%│ .0%│ .0%│ .1%│ │
3227 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3228 │ % │ │ │ │ │ │ │ │ │ │ │ │
3229 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 52│
3230 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1654│
3231 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3232 │ S Count │ 10│ 113│ 11│ 14│ 25│ 23│ 20│ 2│ 3│ 2│ 223│
3233 │ Row % │ 4.5%│ 50.7%│ 4.9%│ 6.3%│ 11.2%│ 10.3%│ 9.0%│ .9%│ 1.3%│ .9%│ │
3234 │ Row │ 4.6%│ 51.8%│ 5.0%│ 6.4%│ 11.5%│ 10.6%│ 9.2%│ .9%│ .0%│ .0%│ │
3235 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3236 │ % │ │ │ │ │ │ │ │ │ │ │ │
3237 │ Row │ .4%│ 4.7%│ .5%│ .6%│ 1.0%│ 1.0%│ .8%│ .1%│ .1%│ .1%│ │
3238 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3239 │ % │ │ │ │ │ │ │ │ │ │ │ │
3240 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 218│
3241 │ Total N│ │ │ │ │ │ │ │ │ │ │ 2390│
3242 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3243 │ W Count │ 1│ 166│ 28│ 5│ 15│ 7│ 19│ 3│ 0│ 1│ 245│
3244 │ Row % │ .4%│ 67.8%│ 11.4%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .4%│ │
3245 │ Row │ .4%│ 68.0%│ 11.5%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .0%│ │
3246 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3247 │ % │ │ │ │ │ │ │ │ │ │ │ │
3248 │ Row │ .1%│ 10.7%│ 1.8%│ .3%│ 1.0%│ .5%│ 1.2%│ .2%│ .0%│ .1%│ │
3249 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3250 │ % │ │ │ │ │ │ │ │ │ │ │ │
3251 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 244│
3252 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1546│
3253 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
3257 AT_SETUP([CTABLES scale summary functions])
3258 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3259 AT_DATA([ctables.sps],
3263 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
3264 CTABLES later, to make the results easier to verify.
3265 SPLIT FILE BY REGION.
3268 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
3269 /FORMAT NOTABLE /MISSING=INCLUDE.
3273 /VLABELS VARIABLE=qn19a DISPLAY=NAME /*XXX NONE yields an assertion failure
3274 /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, COLPCT.SUM]
3275 /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
3276 /SLABELS POSITION=ROW.
3278 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
3280 ╭────────────────┬────────╮
3282 ├────────────────┼────────┤
3285 │ ╶─────────┼────────┤
3287 │ ╶─────────┼────────┤
3289 │ ╶─────────┼────────┤
3291 │ ╶─────────┼────────┤
3293 │ ╶─────────┼────────┤
3295 │ ╶─────────┼────────┤
3297 │ ╶─────────┼────────┤
3299 │ ╶─────────┼────────┤
3301 │ ╶─────────┼────────┤
3303 │ ╶─────────┼────────┤
3305 ├────────────────┼────────┤
3308 │ ╶─────────┼────────┤
3310 │ ╶─────────┼────────┤
3312 │ ╶─────────┼────────┤
3314 │ ╶─────────┼────────┤
3316 │ ╶─────────┼────────┤
3318 │ ╶─────────┼────────┤
3320 │ ╶─────────┼────────┤
3322 │ ╶─────────┼────────┤
3324 │ ╶─────────┼────────┤
3326 │ ╶─────────┼────────┤
3328 ├────────────────┼────────┤
3331 │ ╶─────────┼────────┤
3333 │ ╶─────────┼────────┤
3335 │ ╶─────────┼────────┤
3337 │ ╶─────────┼────────┤
3339 │ ╶─────────┼────────┤
3341 │ ╶─────────┼────────┤
3343 │ ╶─────────┼────────┤
3345 │ ╶─────────┼────────┤
3347 │ ╶─────────┼────────┤
3349 │ ╶─────────┼────────┤
3351 ├────────────────┼────────┤
3354 │ ╶─────────┼────────┤
3356 │ ╶─────────┼────────┤
3358 │ ╶─────────┼────────┤
3360 │ ╶─────────┼────────┤
3362 │ ╶─────────┼────────┤
3364 │ ╶─────────┼────────┤
3366 │ ╶─────────┼────────┤
3368 │ ╶─────────┼────────┤
3370 │ ╶─────────┼────────┤
3372 │ ╶─────────┼────────┤
3374 ╰────────────────┴────────╯
3377 ╭───────────────────────────┬────────╮
3379 ├───────────────────────────┼────────┤
3380 │REGION NE Valid N │ 936│
3383 │ Std Error of Mean│ .14│
3386 │ Std Deviation │ 4.41│
3394 │ Column Sum % │ 21.8%│
3395 │ ╶────────────────────┼────────┤
3396 │ MW Valid N │ 1019│
3399 │ Std Error of Mean│ .16│
3402 │ Std Deviation │ 5.15│
3410 │ Column Sum % │ 24.3%│
3411 │ ╶────────────────────┼────────┤
3413 │ Missing │ 1114.00│
3415 │ Std Error of Mean│ .18│
3418 │ Std Deviation │ 6.44│
3426 │ Column Sum % │ 31.2%│
3427 │ ╶────────────────────┼────────┤
3431 │ Std Error of Mean│ .17│
3434 │ Std Deviation │ 5.25│
3442 │ Column Sum % │ 22.7%│
3443 ╰───────────────────────────┴────────╯
3448 AT_SETUP([CTABLES hidden scale VLABELS])
3449 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3450 AT_DATA([ctables.sps],
3453 /TABLE region BY qn19a + qn35
3454 /SLABELS POSITION=ROW.
3456 /VLABELS VARIABLE=qn19a DISPLAY=NONE
3457 /TABLE region BY qn19a + qn35
3458 /SLABELS POSITION=ROW.
3460 /VLABELS VARIABLE=qn35 DISPLAY=NONE
3461 /TABLE region BY qn19a + qn35
3462 /SLABELS POSITION=ROW.
3464 * This one in particular caused a crash because no categories were
3465 created on the column axis, so passing in 0 for the index was still
3466 too big for that number of categories. It was fixed by creating a
3467 name-only category for each variable despite the "NONE" request,
3468 then hiding the entire dimension's labels if all its labels were
3471 /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
3472 /TABLE region BY qn19a + qn35
3473 /SLABELS POSITION=ROW.
3475 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3477 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
3478 │ │ 19a. About how old were you│ 35. In the past thirty days, how│
3479 │ │ when you first starting │ many times have you driven a │
3480 │ │ drinking alcohol, not │ motor vehicle WITHIN TWO HOURS │
3481 │ │ counting small tastes or │ AFTER drinking alcoholic │
3482 │ │ sips of alcohol. │ beverages? │
3483 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
3484 │Region NE Mean│ 19.33│ 2│
3485 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3486 │ MW Mean│ 19.83│ 2│
3487 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3489 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3491 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
3494 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
3495 │ │ │ 35. In the past thirty days, how many times have you │
3496 │ │ │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
3497 │ │QN19A│ alcoholic beverages? │
3498 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
3499 │Region NE Mean│19.33│ 2│
3500 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3502 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3504 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3506 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
3509 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
3510 │ │ 19a. About how old were you when you first starting │ │
3511 │ │ drinking alcohol, not counting small tastes or sips of │ │
3513 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
3514 │Region NE Mean│ 19.33│ 2│
3515 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3516 │ MW Mean│ 19.83│ 2│
3517 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3519 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3521 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
3524 ╭──────────────┬───────╮
3525 │Region NE Mean│19.33 2│
3532 ╰──────────────┴───────╯
3536 AT_SETUP([CTABLES with SPLIT FILE])
3537 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3538 AT_DATA([ctables.sps],
3541 SORT CASES BY qns3a.
3543 CTABLES /TABLE qn105ba.
3545 * Layered split has no effect on output.
3546 SPLIT FILE BY qns3a.
3547 CTABLES /TABLE qn105ba.
3549 * Add column variable qns3a to compare against separate splits.
3550 CTABLES /TABLE qn105ba BY qns3a.
3552 * Separate splits are truly output separately.
3553 SPLIT FILE SEPARATE BY qns3a.
3554 CTABLES /TABLE qn105ba.
3556 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
3558 ╭────────────────────────────────────────────────────────────────────────┬─────╮
3560 ├────────────────────────────────────────────────────────────────────────┼─────┤
3561 │105b. How likely is it that drivers who have had too much Almost │ 700│
3562 │to drink to drive safely will A. Get stopped by the police? certain │ │
3563 │ Very likely │ 1502│
3570 ╰────────────────────────────────────────────────────────────────────────┴─────╯
3573 ╭────────────────────────────────────────────────────────────────────────┬─────╮
3575 ├────────────────────────────────────────────────────────────────────────┼─────┤
3576 │105b. How likely is it that drivers who have had too much Almost │ 700│
3577 │to drink to drive safely will A. Get stopped by the police? certain │ │
3578 │ Very likely │ 1502│
3585 ╰────────────────────────────────────────────────────────────────────────┴─────╯
3588 ╭─────────────────────────────────────────────────────────────────┬────────────╮
3594 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
3595 │105b. How likely is it that drivers who have had too Almost │ 297│ 403│
3596 │much to drink to drive safely will A. Get stopped by certain │ │ │
3597 │the police? Very likely │ 660│ 842│
3598 │ Somewhat │ 1174│ 1589│
3600 │ Somewhat │ 640│ 667│
3604 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
3607 ╭────────────┬─────╮
3609 ├────────────┼─────┤
3610 │S3a. GENDER:│Male │
3611 ╰────────────┴─────╯
3614 ╭────────────────────────────────────────────────────────────────────────┬─────╮
3616 ├────────────────────────────────────────────────────────────────────────┼─────┤
3617 │105b. How likely is it that drivers who have had too much Almost │ 297│
3618 │to drink to drive safely will A. Get stopped by the police? certain │ │
3619 │ Very likely │ 660│
3626 ╰────────────────────────────────────────────────────────────────────────┴─────╯
3629 ╭────────────┬──────╮
3631 ├────────────┼──────┤
3632 │S3a. GENDER:│Female│
3633 ╰────────────┴──────╯
3636 ╭────────────────────────────────────────────────────────────────────────┬─────╮
3638 ├────────────────────────────────────────────────────────────────────────┼─────┤
3639 │105b. How likely is it that drivers who have had too much Almost │ 403│
3640 │to drink to drive safely will A. Get stopped by the police? certain │ │
3641 │ Very likely │ 842│
3648 ╰────────────────────────────────────────────────────────────────────────┴─────╯