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
12 dnl * THRU (numeric ranges)
14 dnl - Date/time variables and values
16 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
17 dnl * MISSING, OTHERNM
18 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
20 dnl - Summary functions:
21 dnl * U-prefix for unweighted summaries.
22 dnl * areaPCT.SUM and UareaPCT.SUM functions.
23 dnl - SPLIT FILE with SEPARATE splits
24 dnl - Definition of columns/rows when labels are rotated from one axis to another.
27 dnl - Multiple response sets
28 dnl - MRSETS subcommand.
29 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
32 dnl - Summary functions:
33 dnl * .LCL and .UCL suffixes.
36 dnl * Data-dependent sorting.
38 AT_SETUP([CTABLES parsing])
39 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
40 AT_DATA([ctables.sps],
43 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
44 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
45 /FORMAT UNITS=CM EMPTY="(-)"
46 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
47 /VLABELS VARIABLES=qn17 DISPLAY=NAME
48 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
49 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
50 /VLABELS VARIABLES=qn20 DISPLAY=NONE
51 /MRSETS COUNTDUPLICATES=NO
52 /MRSETS COUNTDUPLICATES=YES
55 /WEIGHT VARIABLE=qns3a
57 /HIDESMALLCOUNTS COUNT=10
59 /SLABELS POSITION=COLUMN VISIBLE=YES
60 /SLABELS VISIBLE=NO POSITION=ROW
61 /SLABELS POSITION=LAYER
63 /CLABELS ROWLABELS=OPPOSITE
65 /CATEGORIES VARIABLES=qn1 qn17
66 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
67 POSITION=BEFORE EMPTY=INCLUDE.
68 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
69 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
70 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
72 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
75 ╭───────────────────┬────┬────╮
77 ├───────────────────┼────┼────┤
78 │Sa1. SAMPLE SOURCE:│5392│1607│
79 ╰───────────────────┴────┴────╯
83 ╭───────────────────┬─────╮
85 ├───────────────────┼─────┤
86 │Sa1. SAMPLE SOURCE:│ 5392│
87 ╰───────────────────┴─────╯
90 ╭────────────────────────┬─────╮
92 ├────────────────────────┼─────┤
93 │Sa1. SAMPLE SOURCE: RDD │ 5392│
95 ╰────────────────────────┴─────╯
98 ╭────────────────────────┬─────╮
100 ├────────────────────────┼─────┤
101 │Sa1. SAMPLE SOURCE: RDD │ 5392│
103 ╰────────────────────────┴─────╯
107 AT_SETUP([CTABLES parsing - negative])
108 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
109 AT_DATA([ctables.sps],
112 CTABLES /FORMAT MINCOLWIDTH='foo'.
113 CTABLES /TABLE qn1 [**].
114 CTABLES /TABLE qn1 [NOTAFUNCTION].
117 CTABLES /TABLE NOTAVAR.
119 CTABLES /TABLE string[S].
120 CTABLES /TABLE qn1 [PTILE 101].
121 CTABLES /TABLE qn1 [MEAN F0.1].
122 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
123 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
124 CTABLES /TABLE qn1 [MEAN TOTALS].
125 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
127 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
128 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
129 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
130 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
131 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
132 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
133 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
134 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
135 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
136 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
137 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
138 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
143 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
144 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
145 CTABLES /PCOMPUTE &k=EXPR([LO **]).
146 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
147 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
148 CTABLES /PCOMPUTE &k=EXPR([1**]).
149 CTABLES /PCOMPUTE &k=EXPR((1x)).
150 CTABLES /PCOMPUTE **k.
151 CTABLES /PCOMPUTE &1.
152 CTABLES /PCOMPUTE &k**.
153 CTABLES /PCOMPUTE &k=**.
154 CTABLES /PCOMPUTE &k=EXPR**.
155 CTABLES /PCOMPUTE &k=EXPR(1x).
156 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
157 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
158 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
159 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
160 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
161 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
162 CTABLES /FORMAT EMPTY=**.
163 CTABLES /FORMAT MISSING=**.
165 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
167 CTABLES /VLABELS VARIABLES=NOTAVAR.
168 CTABLES /VLABELS VARIABLES=qn1 **.
169 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
171 CTABLES /MRSETS COUNTDUPLICATES=**.
172 CTABLES /SMISSING **.
174 CTABLES /WEIGHT VARIABLE=NOTAVAR.
175 CTABLES /HIDESMALLCOUNTS COUNT=1.
177 CTABLES /HIDESMALLCOUNTS COUNT=2.
178 CTABLES /TABLE qn1**.
179 CTABLES /TABLE qn1 /SLABELS POSITION=**.
180 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
181 CTABLES /TABLE qn1 /SLABELS **.
182 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
183 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
184 CTABLES /TABLE qn1 /CLABELS **.
185 CTABLES /TABLE qn1 /CRITERIA **.
186 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
187 CTABLES /TABLE qn1 /TITLES **.
188 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
189 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
190 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
191 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
192 CTABLES /TABLE qn1 /SIGTEST **.
193 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
194 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
195 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
196 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
197 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
198 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
199 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
200 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
201 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
202 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
203 CTABLES /TABLE qn1 /COMPARETEST **.
204 CTABLES /TABLE qn1 / **.
205 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
206 CTABLES /TABLE qn20 > qnd1.
207 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
208 NUMERIC datetime (DATETIME17.0).
209 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
211 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
212 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
214 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
215 negative number for MINCOLWIDTH.
217 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
220 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
221 summary function name.
223 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
225 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
228 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
230 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
232 10 | CTABLES /TABLE string[S].
235 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
236 between 0 and 100 for PTILE.
238 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
239 requires a width between 1 and 40.
241 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
242 format NEGPAREN requires width 2 or greater.
244 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
245 format NEGPAREN requires width greater than decimals.
247 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
249 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
252 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
253 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
256 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
258 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
260 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
263 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
264 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
267 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
269 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
271 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
273 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
275 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
277 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
279 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
282 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
283 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
286 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
287 between 0 and 100 for PTILE.
289 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
292 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
295 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
298 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
301 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
303 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
306 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
309 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
310 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
312 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
313 LABEL, POSITION, or EMPTY.
315 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
316 integer for SUBTOTAL.
318 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
320 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
322 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
324 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
326 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
328 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
330 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
332 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
334 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
336 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
338 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
340 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
342 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
343 the previous definition.
344 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
345 | ^~~~~~~~~~~~~~~~~~~
347 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
348 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
349 | ^~~~~~~~~~~~~~~~~~~
351 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
354 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
355 Expecting summary function name.
357 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
358 between 0 and 100 for PTILE.
360 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
362 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
365 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
366 FORMAT, or HIDESOURCECATS.
368 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
370 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
372 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
373 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
375 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
378 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
381 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
383 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
386 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
387 DEFAULT, NAME, LABEL, BOTH, or NONE.
389 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
392 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
395 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
396 VARIABLE or LISTWISE.
398 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
401 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
403 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
404 greater for HIDESMALLCOUNTS COUNT.
406 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
407 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
408 HIDESMALLCOUNTS, or TABLE.
410 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
413 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
415 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
418 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
421 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
424 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
427 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
430 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
431 ROWLABELS, or COLLABELS.
433 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
436 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
437 in @<:@0,100@:}@ for CILEVEL.
439 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
440 CAPTION, CORNER, or TITLE.
442 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
445 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
446 in @<:@0,1@:}@ for ALPHA.
448 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
451 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
452 ALLVISIBLE or SUBTOTALS.
454 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
455 ALPHA, INCLUDEMRSETS, or CATEGORIES.
457 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
460 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
463 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
466 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
467 BONFERRONI, BH, or NONE.
469 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
472 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
475 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
476 ALLVISIBLE or SUBTOTALS.
478 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
481 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
484 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
487 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
488 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
491 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
492 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
494 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
497 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
498 97 | CTABLES /TABLE qn20 > qnd1.
501 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
502 97 | CTABLES /TABLE qn20 > qnd1.
505 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
506 97 | CTABLES /TABLE qn20 > qnd1.
509 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
510 categorical variables at the innermost nesting level.
511 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
512 | ^~~~~~~~~~~~~~~~~~~~
514 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
516 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
519 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
520 specification as format DATETIME: Day (123) must be between 1 and 31..
521 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
526 AT_SETUP([CTABLES parsing - more negative])
527 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
528 AT_DATA([ctables.sps],
530 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
531 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
532 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
535 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
536 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
538 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
540 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
541 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
542 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
543 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
545 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
546 CTABLES /PCOMPUTE &x=EXPR([**]).
547 CTABLES /PCOMPUTE &x=EXPR(**).
551 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
553 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
554 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
555 category not included in the category list.
556 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
561 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
562 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
566 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
567 list of categories here.
568 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
573 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
574 category not included in the category list.
575 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
580 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
581 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
585 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
586 variable's CATEGORIES specification.
588 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
589 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
590 subtotals by position, e.g. SUBTOTAL[1].
591 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
592 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
594 ^~~~~~~~~~~~~~~~~~~~~~~~
596 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
598 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
599 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
602 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
603 applied only to string variables, but this subcommand tries to apply it to
604 numeric variable QN1.
605 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
608 ctables.sps:8.53: error: CTABLES: This category specification may be applied
609 only to numeric variables, but this subcommand tries to apply it to string
611 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
614 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
615 based on a summary function.
617 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
618 moved to be categorical, but qnd1 is a scale variable.
620 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
621 moved to have the same width, but QN1 has width 0 and string has width 8.
623 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
624 moved to have the same value labels, but QN1 and QNSA1 have different value
627 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
628 moved to have the same category specifications, but QN105BA and QN105BB have
629 different category specifications.
631 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
632 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
633 this warning, insert parentheses.
634 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
637 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
640 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
642 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
644 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
645 variable must be specified.
647 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
649 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
651 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
654 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
656 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
659 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
661 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
664 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
665 has a summary even if the syntax does not explicitly specify one.
666 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
671 AT_SETUP([CTABLES one categorical variable])
672 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
673 AT_DATA([ctables.sps],
676 CTABLES /TABLE BY qn1.
677 CTABLES /TABLE BY BY qn1.
679 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
681 ╭────────────────────────────────────────────────────────────────────────┬─────╮
683 ├────────────────────────────────────────────────────────────────────────┼─────┤
684 │ 1. How often do you usually drive a car or other Every day │ 4667│
685 │motor vehicle? Several days a week │ 1274│
686 │ Once a week or less │ 361│
687 │ Only certain times a │ 130│
690 ╰────────────────────────────────────────────────────────────────────────┴─────╯
693 ╭──────────────────────────────────────────────────────────────────────────────╮
694 │ 1. How often do you usually drive a car or other motor vehicle? │
695 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
696 │ │ Several days a │ Once a week or │ Only certain times a │ │
697 │Every day│ week │ less │ year │Never│
698 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
699 │ Count │ Count │ Count │ Count │Count│
700 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
701 │ 4667│ 1274│ 361│ 130│ 540│
702 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
714 AT_SETUP([CTABLES one string variable])
715 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
716 AT_DATA([ctables.sps],
719 MISSING VALUES licensed('DontKnow', 'Refused').
720 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
721 CTABLES /TABLE licensed.
722 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
723 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
724 * Notice that the string matching is case-sensitive.
725 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
726 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
728 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
729 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
731 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
733 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
734 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
736 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
738 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
748 ╭─────────────────┬─────┬───────╮
750 ├─────────────────┼─────┼───────┤
751 │licensed DontKnow│ 4│ │
755 │ Total │ 6999│ 6951│
756 ╰─────────────────┴─────┴───────╯
759 ╭──────────────┬─────╮
761 ├──────────────┼─────┤
762 │licensed Yes │ 6379│
765 ╰──────────────┴─────╯
768 ╭──────────────┬─────╮
770 ├──────────────┼─────┤
771 │licensed Yes │ 6379│
774 ╰──────────────┴─────╯
777 ╭────────────────┬─────╮
779 ├────────────────┼─────┤
784 ╰────────────────┴─────╯
787 ╭────────────────┬─────╮
789 ├────────────────┼─────┤
790 │licensed Yes │ 6379│
792 ╰────────────────┴─────╯
795 ╭────────────────┬─────╮
797 ├────────────────┼─────┤
798 │licensed Yes │ 6379│
800 ╰────────────────┴─────╯
804 AT_SETUP([CTABLES one scale variable])
805 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
806 AT_DATA([ctables.sps],
808 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
809 CTABLES /TABLE BY qnd1.
810 CTABLES /TABLE BY BY qnd1.
812 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
814 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
815 │ │ │ │ │ │ Std │ │ │
816 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
817 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
818 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
819 │age? │ │ │ │ │ │ │ │
820 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
823 ╭──────────────────────────╮
824 │D1. AGE: What is your age?│
825 ├──────────────────────────┤
827 ├──────────────────────────┤
829 ╰──────────────────────────╯
832 D1. AGE: What is your age?
841 AT_SETUP([CTABLES simple stacking])
842 AT_KEYWORDS([stack stacked])
843 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
844 AT_DATA([ctables.sps],
846 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
848 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
850 ╭───────────────────────────────────────────────────────────────┬──────────────╮
857 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
858 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
859 │too much to drink to drive safely will A. Get certain │ │ │
860 │stopped by the police? Very likely │ 21%│ 22%│
861 │ Somewhat │ 38%│ 42%│
863 │ Somewhat │ 21%│ 18%│
867 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
868 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
869 │too much to drink to drive safely will B. Have an certain │ │ │
870 │accident? Very likely │ 36%│ 45%│
871 │ Somewhat │ 39%│ 32%│
877 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
878 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
879 │too much to drink to drive safely will C. Be certain │ │ │
880 │convicted for drunk driving? Very likely │ 32%│ 28%│
881 │ Somewhat │ 27%│ 32%│
883 │ Somewhat │ 15%│ 15%│
887 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
888 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
889 │too much to drink to drive safely will D. Be certain │ │ │
890 │arrested for drunk driving? Very likely │ 26%│ 27%│
891 │ Somewhat │ 32%│ 35%│
893 │ Somewhat │ 17%│ 15%│
897 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
901 AT_SETUP([CTABLES show or hide empty categories])
902 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
903 AT_DATA([ctables.sps],
905 IF (qn105ba = 2) qn105ba = 1.
906 IF (qns3a = 1) qns3a = 2.
907 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
908 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
909 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
910 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
911 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
912 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
913 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
915 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
917 ╭──────────────────────────────────────────────────────────────┬───────────────╮
924 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
925 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
926 │too much to drink to drive safely will A. Get certain │ │ │
927 │stopped by the police? Very likely│ .│ 0%│
934 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
937 ╭──────────────────────────────────────────────────────────────┬───────────────╮
944 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
945 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
946 │too much to drink to drive safely will A. Get certain │ │ │
947 │stopped by the police? Somewhat │ .│ 40%│
953 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
956 ╭────────────────────────────────────────────────────────────────────┬─────────╮
963 ├────────────────────────────────────────────────────────────────────┼─────────┤
964 │105b. How likely is it that drivers who have had too Almost │ 32%│
965 │much to drink to drive safely will A. Get stopped by certain │ │
966 │the police? Very likely │ 0%│
973 ╰────────────────────────────────────────────────────────────────────┴─────────╯
976 ╭────────────────────────────────────────────────────────────────────┬─────────╮
983 ├────────────────────────────────────────────────────────────────────┼─────────┤
984 │105b. How likely is it that drivers who have had too Almost │ 32%│
985 │much to drink to drive safely will A. Get stopped by certain │ │
986 │the police? Somewhat │ 40%│
992 ╰────────────────────────────────────────────────────────────────────┴─────────╯
996 AT_SETUP([CTABLES sorting categories])
997 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
998 AT_DATA([ctables.sps],
1000 IF (QND5A=6) QND5A=-1.
1001 IF (QND5A=5) QND5A=-2.
1002 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
1003 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
1004 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
1005 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
1007 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1009 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1011 ├────────────────────────────────────────────────────────────────────────┼─────┤
1012 │D5a. What would you say is your primary ethnic -2.00 │ 52│
1013 │background? -1.00 │ 78│
1017 │ South American │ 34│
1018 │ Central American │ 0│
1019 │ Puerto Rican, OR │ 0│
1020 │ Something else │ 68│
1021 │ Multiple - cannot choose│ 7│
1023 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1026 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1028 ├────────────────────────────────────────────────────────────────────────┼─────┤
1029 │D5a. What would you say is your primary ethnic Multiple - cannot choose│ 7│
1030 │background? one │ │
1031 │ Something else │ 68│
1032 │ Puerto Rican, OR │ 0│
1033 │ Central American │ 0│
1034 │ South American │ 34│
1040 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1043 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1045 ├────────────────────────────────────────────────────────────────────────┼─────┤
1046 │D5a. What would you say is your primary ethnic Central American │ 0│
1047 │background? Cuban │ 20│
1049 │ Multiple - cannot choose│ 7│
1051 │ Puerto Rican, OR │ 0│
1052 │ Something else │ 68│
1053 │ South American │ 34│
1057 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1060 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1062 ├────────────────────────────────────────────────────────────────────────┼─────┤
1063 │D5a. What would you say is your primary ethnic Spanish │ 48│
1064 │background? South American │ 34│
1065 │ Something else │ 68│
1066 │ Puerto Rican, OR │ 0│
1067 │ Multiple - cannot choose│ 7│
1071 │ Central American │ 0│
1074 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1078 AT_SETUP([CTABLES simple nesting])
1079 AT_KEYWORDS([nest nested])
1080 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1081 AT_DATA([ctables.sps],
1083 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1084 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1085 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1086 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1087 /CLABELS ROW=OPPOSITE.
1089 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1091 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1094 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1095 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1096 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1097 │drive safely will A. Get stopped by Total │ 700│ 10%│
1098 │the police? ╶──────────────────────────┼─────┼──────┤
1099 │ Very S3a. Male │ 660│ 10%│
1100 │ likely GENDER: Female│ 842│ 12%│
1101 │ Total │ 1502│ 22%│
1102 │ ╶──────────────────────────┼─────┼──────┤
1103 │ Somewhat S3a. Male │ 1174│ 17%│
1104 │ likely GENDER: Female│ 1589│ 23%│
1105 │ Total │ 2763│ 40%│
1106 │ ╶──────────────────────────┼─────┼──────┤
1107 │ Somewhat S3a. Male │ 640│ 9%│
1108 │ unlikely GENDER: Female│ 667│ 10%│
1109 │ Total │ 1307│ 19%│
1110 │ ╶──────────────────────────┼─────┼──────┤
1111 │ Very S3a. Male │ 311│ 5%│
1112 │ unlikely GENDER: Female│ 298│ 4%│
1114 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1115 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1116 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1117 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1118 │ ╶──────────────────────────┼─────┼──────┤
1119 │ Very S3a. Male │ 1104│ 16%│
1120 │ likely GENDER: Female│ 1715│ 25%│
1121 │ Total │ 2819│ 41%│
1122 │ ╶──────────────────────────┼─────┼──────┤
1123 │ Somewhat S3a. Male │ 1203│ 17%│
1124 │ likely GENDER: Female│ 1214│ 18%│
1125 │ Total │ 2417│ 35%│
1126 │ ╶──────────────────────────┼─────┼──────┤
1127 │ Somewhat S3a. Male │ 262│ 4%│
1128 │ unlikely GENDER: Female│ 168│ 2%│
1130 │ ╶──────────────────────────┼─────┼──────┤
1131 │ Very S3a. Male │ 81│ 1%│
1132 │ unlikely GENDER: Female│ 59│ 1%│
1134 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1135 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1136 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1137 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1138 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1139 │ Very S3a. Male │ 988│ 14%│
1140 │ likely GENDER: Female│ 1049│ 15%│
1141 │ Total │ 2037│ 30%│
1142 │ ╶──────────────────────────┼─────┼──────┤
1143 │ Somewhat S3a. Male │ 822│ 12%│
1144 │ likely GENDER: Female│ 1210│ 18%│
1145 │ Total │ 2032│ 30%│
1146 │ ╶──────────────────────────┼─────┼──────┤
1147 │ Somewhat S3a. Male │ 446│ 7%│
1148 │ unlikely GENDER: Female│ 548│ 8%│
1150 │ ╶──────────────────────────┼─────┼──────┤
1151 │ Very S3a. Male │ 268│ 4%│
1152 │ unlikely GENDER: Female│ 354│ 5%│
1154 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1155 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1156 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1157 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1158 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1159 │ Very S3a. Male │ 805│ 12%│
1160 │ likely GENDER: Female│ 1029│ 15%│
1161 │ Total │ 1834│ 27%│
1162 │ ╶──────────────────────────┼─────┼──────┤
1163 │ Somewhat S3a. Male │ 975│ 14%│
1164 │ likely GENDER: Female│ 1332│ 19%│
1165 │ Total │ 2307│ 34%│
1166 │ ╶──────────────────────────┼─────┼──────┤
1167 │ Somewhat S3a. Male │ 535│ 8%│
1168 │ unlikely GENDER: Female│ 560│ 8%│
1169 │ Total │ 1095│ 16%│
1170 │ ╶──────────────────────────┼─────┼──────┤
1171 │ Very S3a. Male │ 270│ 4%│
1172 │ unlikely GENDER: Female│ 279│ 4%│
1174 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1177 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1178 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1179 │ │ certain│likely│ likely │ unlikely│unlikely│
1180 │ ├────────┼──────┼─────────┼─────────┼────────┤
1182 │ │ Table %│ % │ Table % │ Table % │ Table %│
1183 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1184 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1185 │GENDER: is it that drivers│ │ │ │ │ │
1186 │ who have had too │ │ │ │ │ │
1187 │ much to drink to │ │ │ │ │ │
1188 │ drive safely will │ │ │ │ │ │
1189 │ A. Get stopped by │ │ │ │ │ │
1190 │ the police? │ │ │ │ │ │
1191 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1192 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1193 │ is it that drivers│ │ │ │ │ │
1194 │ who have had too │ │ │ │ │ │
1195 │ much to drink to │ │ │ │ │ │
1196 │ drive safely will │ │ │ │ │ │
1197 │ A. Get stopped by │ │ │ │ │ │
1198 │ the police? │ │ │ │ │ │
1199 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1200 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1201 │ is it that drivers│ │ │ │ │ │
1202 │ who have had too │ │ │ │ │ │
1203 │ much to drink to │ │ │ │ │ │
1204 │ drive safely will │ │ │ │ │ │
1205 │ A. Get stopped by │ │ │ │ │ │
1206 │ the police? │ │ │ │ │ │
1207 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1208 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1209 │GENDER: is it that drivers│ │ │ │ │ │
1210 │ who have had too │ │ │ │ │ │
1211 │ much to drink to │ │ │ │ │ │
1212 │ drive safely will │ │ │ │ │ │
1213 │ B. Have an │ │ │ │ │ │
1214 │ accident? │ │ │ │ │ │
1215 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1216 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1217 │ is it that drivers│ │ │ │ │ │
1218 │ who have had too │ │ │ │ │ │
1219 │ much to drink to │ │ │ │ │ │
1220 │ drive safely will │ │ │ │ │ │
1221 │ B. Have an │ │ │ │ │ │
1222 │ accident? │ │ │ │ │ │
1223 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1224 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1225 │ is it that drivers│ │ │ │ │ │
1226 │ who have had too │ │ │ │ │ │
1227 │ much to drink to │ │ │ │ │ │
1228 │ drive safely will │ │ │ │ │ │
1229 │ B. Have an │ │ │ │ │ │
1230 │ accident? │ │ │ │ │ │
1231 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1232 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1233 │GENDER: is it that drivers│ │ │ │ │ │
1234 │ who have had too │ │ │ │ │ │
1235 │ much to drink to │ │ │ │ │ │
1236 │ drive safely will │ │ │ │ │ │
1237 │ C. Be convicted │ │ │ │ │ │
1238 │ for drunk driving?│ │ │ │ │ │
1239 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1240 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1241 │ is it that drivers│ │ │ │ │ │
1242 │ who have had too │ │ │ │ │ │
1243 │ much to drink to │ │ │ │ │ │
1244 │ drive safely will │ │ │ │ │ │
1245 │ C. Be convicted │ │ │ │ │ │
1246 │ for drunk driving?│ │ │ │ │ │
1247 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1248 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1249 │ is it that drivers│ │ │ │ │ │
1250 │ who have had too │ │ │ │ │ │
1251 │ much to drink to │ │ │ │ │ │
1252 │ drive safely will │ │ │ │ │ │
1253 │ C. Be convicted │ │ │ │ │ │
1254 │ for drunk driving?│ │ │ │ │ │
1255 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1256 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1257 │GENDER: is it that drivers│ │ │ │ │ │
1258 │ who have had too │ │ │ │ │ │
1259 │ much to drink to │ │ │ │ │ │
1260 │ drive safely will │ │ │ │ │ │
1261 │ D. Be arrested for│ │ │ │ │ │
1262 │ drunk driving? │ │ │ │ │ │
1263 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1264 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1265 │ is it that drivers│ │ │ │ │ │
1266 │ who have had too │ │ │ │ │ │
1267 │ much to drink to │ │ │ │ │ │
1268 │ drive safely will │ │ │ │ │ │
1269 │ D. Be arrested for│ │ │ │ │ │
1270 │ drunk driving? │ │ │ │ │ │
1271 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1272 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1273 │ is it that drivers│ │ │ │ │ │
1274 │ who have had too │ │ │ │ │ │
1275 │ much to drink to │ │ │ │ │ │
1276 │ drive safely will │ │ │ │ │ │
1277 │ D. Be arrested for│ │ │ │ │ │
1278 │ drunk driving? │ │ │ │ │ │
1279 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1283 AT_SETUP([CTABLES nesting and scale variables])
1284 AT_KEYWORDS([nest nested])
1285 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1286 AT_DATA([ctables.sps],
1288 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1289 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1290 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1291 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1292 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1294 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1296 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1302 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1303 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1304 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1306 │ Once a week or │ 44│ 54│
1308 │ Only certain │ 34│ 41│
1309 │ times a year │ │ │
1311 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1314 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1315 │ │Minimum│Maximum│Mean│
1316 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1317 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1318 │What is GENDER: months, has there been a │ │ │ │
1319 │your time when you felt you │ │ │ │
1320 │age? should cut down on your No │ 16│ 86│ 46│
1322 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1323 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1324 │ months, has there been a │ │ │ │
1325 │ time when you felt you │ │ │ │
1326 │ should cut down on your No │ 16│ 86│ 48│
1328 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1329 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1330 │What is GENDER: months, has there been a │ │ │ │
1331 │your time when people criticized No │ 16│ 86│ 46│
1332 │age? your drinking? │ │ │ │
1333 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1334 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1335 │ months, has there been a │ │ │ │
1336 │ time when people criticized No │ 16│ 86│ 48│
1337 │ your drinking? │ │ │ │
1338 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1341 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1342 │ │S1. Including yourself, how many members of this│
1343 │ │ household are age 16 or older? │
1344 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1345 │ │ │ │ │ │ │ │ 6 or │
1346 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1347 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1348 │ │Column│Column│Column│Column│Column│Column│Column│
1349 │ │ % │ % │ % │ % │ % │ % │ % │
1350 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1351 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1352 │SAMPLE How certain │ │ │ │ │ │ │ │
1353 │SOURCE: likely │ │ │ │ │ │ │ │
1354 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1355 │ that likely │ │ │ │ │ │ │ │
1356 │ drivers │ │ │ │ │ │ │ │
1357 │ who have │ │ │ │ │ │ │ │
1358 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1359 │ much to likely │ │ │ │ │ │ │ │
1360 │ drink to │ │ │ │ │ │ │ │
1361 │ drive │ │ │ │ │ │ │ │
1362 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1363 │ will A. unlikely│ │ │ │ │ │ │ │
1364 │ Get │ │ │ │ │ │ │ │
1365 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1366 │ by the unlikely│ │ │ │ │ │ │ │
1367 │ police? │ │ │ │ │ │ │ │
1368 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1371 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1374 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1375 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1376 │group typical month did you have one or more │ │ │
1377 │ alcoholic beverages to drink? │ │ │
1378 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1379 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1380 │ typical month did you have one or more │ │ │
1381 │ alcoholic beverages to drink? │ │ │
1382 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1383 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1384 │ typical month did you have one or more │ │ │
1385 │ alcoholic beverages to drink? │ │ │
1386 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1387 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1388 │ typical month did you have one or more │ │ │
1389 │ alcoholic beverages to drink? │ │ │
1390 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1391 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1392 │ typical month did you have one or more │ │ │
1393 │ alcoholic beverages to drink? │ │ │
1394 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1395 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1396 │ older typical month did you have one or more │ │ │
1397 │ alcoholic beverages to drink? │ │ │
1398 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1403 AT_SETUP([CTABLES SLABELS])
1404 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1405 AT_DATA([ctables.sps],
1407 CTABLES /TABLE qn1 [COUNT COLPCT].
1408 CTABLES /TABLE qn1 [COUNT COLPCT]
1409 /SLABELS POSITION=ROW.
1410 CTABLES /TABLE qn1 [COUNT COLPCT]
1411 /SLABELS POSITION=ROW VISIBLE=NO.
1413 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1415 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1418 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1419 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1420 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1421 │ Once a week or less│ 361│ 5.2%│
1422 │ Only certain times │ 130│ 1.9%│
1424 │ Never │ 540│ 7.7%│
1425 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1428 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1429 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1430 │other motor vehicle? Column │66.9%│
1432 │ ╶───────────────────────────┼─────┤
1433 │ Several days a week Count │ 1274│
1436 │ ╶───────────────────────────┼─────┤
1437 │ Once a week or less Count │ 361│
1440 │ ╶───────────────────────────┼─────┤
1441 │ Only certain times Count │ 130│
1442 │ a year Column │ 1.9%│
1444 │ ╶───────────────────────────┼─────┤
1445 │ Never Count │ 540│
1448 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1451 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1452 │ 1. How often do you usually drive a car or other Every day │ 4667│
1453 │motor vehicle? │66.9%│
1454 │ Several days a week │ 1274│
1456 │ Once a week or less │ 361│
1458 │ Only certain times a │ 130│
1462 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1466 AT_SETUP([CTABLES simple totals])
1467 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1468 AT_DATA([ctables.sps],
1471 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1472 DESCRIPTIVES qn18/STATISTICS=MEAN.
1473 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1474 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1476 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1478 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1480 ├────────────────────────────────────────────────────────────────────────┼─────┤
1481 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1482 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1485 │ Wine coolers │ 137│
1486 │ Hard liquor or │ 888│
1488 │ Flavored malt │ 83│
1490 │ Number responding │ 4221│
1491 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1493 Descriptive Statistics
1494 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1496 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1497 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1498 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1499 │Valid N (listwise) │6999│ │
1500 │Missing N (listwise) │2781│ │
1501 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1504 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1505 │ │ │ │ Valid│Total│
1506 │ │Mean│Count│ N │ N │
1507 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1508 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1509 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1510 │ you usually drink per sitting? │ │ │ │ │
1511 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1512 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1513 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1514 │ you usually drink per sitting? │ │ │ │ │
1515 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1516 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1517 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1518 │ you usually drink per sitting? │ │ │ │ │
1519 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1520 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1521 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1522 │ you usually drink per sitting? │ │ │ │ │
1523 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1524 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1525 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1526 │ you usually drink per sitting? │ │ │ │ │
1527 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1531 AT_SETUP([CTABLES subtotals])
1532 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1533 AT_DATA([ctables.sps],
1535 CTABLES /TABLE=qn105ba BY qns1
1536 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1537 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1538 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1539 CTABLES /TABLE=qn105ba BY qns1
1540 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1541 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1543 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1545 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1546 │ │ S1. Including yourself, how many members of this household │
1547 │ │ are age 16 or older? │
1548 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1549 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1550 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1551 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1552 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1553 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1554 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1555 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1556 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1557 │ likely │ │ │ │ │ │ │ │
1558 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1559 │ unlikely │ │ │ │ │ │ │ │
1560 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1561 │ unlikely │ │ │ │ │ │ │ │
1562 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1565 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1566 │ │ S1. Including yourself, how many members of this household │
1567 │ │ are age 16 or older? │
1568 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1569 │ │ │ │ │ │ │ │ 6 or │
1570 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1571 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1572 │ │ │ │ │ │ Column│ │ │
1573 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1574 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1575 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1576 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1577 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1578 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1579 │ likely │ │ │ │ │ │ │ │
1580 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1581 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1582 │ unlikely │ │ │ │ │ │ │ │
1583 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1584 │ unlikely │ │ │ │ │ │ │ │
1585 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1586 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1589 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1590 │ │ S1. Including yourself, how many members of this household │
1591 │ │ are age 16 or older? │
1592 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1593 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1594 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1595 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1596 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1597 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1598 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1599 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1600 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1601 │ likely │ │ │ │ │ │ │ │
1602 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1603 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1604 │ unlikely │ │ │ │ │ │ │ │
1605 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1606 │ unlikely │ │ │ │ │ │ │ │
1607 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1608 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1612 AT_SETUP([CTABLES PCOMPUTE])
1613 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1614 AT_DATA([ctables.sps],
1617 /PCOMPUTE &x=EXPR([3] + [4])
1618 /PCOMPUTE &y=EXPR([4] + [5])
1619 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1620 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1621 /TABLE=qn105ba BY qns1
1622 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1624 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1626 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1627 │ │ S1. Including yourself, how many members of this household │
1628 │ │ are age 16 or older? │
1629 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1630 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1631 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1632 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1633 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1634 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1635 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1636 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1637 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1638 │ likely │ │ │ │ │ │ │ │
1639 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1640 │ unlikely │ │ │ │ │ │ │ │
1641 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1642 │ unlikely │ │ │ │ │ │ │ │
1643 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1647 AT_SETUP([CTABLES CLABELS])
1648 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1649 AT_DATA([ctables.sps],
1651 CTABLES /TABLE AgeGroup BY qns3a.
1652 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1653 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1654 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1655 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1658 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1660 ╭───────────────────────┬────────────╮
1666 ├───────────────────────┼─────┼──────┤
1667 │Age group 15 or younger│ 0│ 0│
1668 │ 16 to 25 │ 594│ 505│
1669 │ 26 to 35 │ 476│ 491│
1670 │ 36 to 45 │ 489│ 548│
1671 │ 46 to 55 │ 526│ 649│
1672 │ 56 to 65 │ 516│ 731│
1673 │ 66 or older │ 531│ 943│
1674 ╰───────────────────────┴─────┴──────╯
1677 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1679 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1681 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1682 │ │ 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 │
1683 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1684 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1685 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1686 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1687 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1688 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1689 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1692 ╭──────────────────────────────┬────────────╮
1696 ├──────────────────────────────┼────────────┤
1697 │Age group 15 or younger Male │ 0│
1699 │ ╶────────────────────┼────────────┤
1700 │ 16 to 25 Male │ 594│
1702 │ ╶────────────────────┼────────────┤
1703 │ 26 to 35 Male │ 476│
1705 │ ╶────────────────────┼────────────┤
1706 │ 36 to 45 Male │ 489│
1708 │ ╶────────────────────┼────────────┤
1709 │ 46 to 55 Male │ 526│
1711 │ ╶────────────────────┼────────────┤
1712 │ 56 to 65 Male │ 516│
1714 │ ╶────────────────────┼────────────┤
1715 │ 66 or older Male │ 531│
1717 ╰──────────────────────────────┴────────────╯
1721 ╭─────────┬────────────╮
1727 ├─────────┼─────┼──────┤
1729 ╰─────────┴─────┴──────╯
1733 ╭─────────┬────────────╮
1739 ├─────────┼─────┼──────┤
1740 │Age group│ 594│ 505│
1741 ╰─────────┴─────┴──────╯
1745 ╭─────────┬────────────╮
1751 ├─────────┼─────┼──────┤
1752 │Age group│ 476│ 491│
1753 ╰─────────┴─────┴──────╯
1757 ╭─────────┬────────────╮
1763 ├─────────┼─────┼──────┤
1764 │Age group│ 489│ 548│
1765 ╰─────────┴─────┴──────╯
1769 ╭─────────┬────────────╮
1775 ├─────────┼─────┼──────┤
1776 │Age group│ 526│ 649│
1777 ╰─────────┴─────┴──────╯
1781 ╭─────────┬────────────╮
1787 ├─────────┼─────┼──────┤
1788 │Age group│ 516│ 731│
1789 ╰─────────┴─────┴──────╯
1793 ╭─────────┬────────────╮
1799 ├─────────┼─────┼──────┤
1800 │Age group│ 531│ 943│
1801 ╰─────────┴─────┴──────╯
1805 ╭───────────────────────┬────────────╮
1809 ├───────────────────────┼────────────┤
1810 │Age group 15 or younger│ 0│
1816 │ 66 or older │ 531│
1817 ╰───────────────────────┴────────────╯
1821 ╭───────────────────────┬────────────╮
1825 ├───────────────────────┼────────────┤
1826 │Age group 15 or younger│ 0│
1832 │ 66 or older │ 943│
1833 ╰───────────────────────┴────────────╯
1837 AT_SETUP([CTABLES missing values])
1838 AT_DATA([ctables.sps],
1839 [[DATA LIST LIST NOTABLE/x y.
1878 MISSING VALUES x (1, 2) y (2, 3).
1879 VARIABLE LEVEL ALL (NOMINAL).
1881 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1882 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1883 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1884 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1885 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1886 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1887 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1888 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1889 /CATEGORIES VARIABLES=ALL TOTAL=YES
1890 /SLABELS POSITION=ROW.
1891 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1892 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1893 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1894 /SLABELS POSITION=ROW.
1895 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1896 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1897 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1898 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1899 /SLABELS POSITION=ROW.
1901 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1903 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1904 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1905 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1906 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1907 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1908 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1909 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1910 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1911 dnl Note that Column Total N % doesn't add up to 100 because missing
1912 dnl values are included in the total but not shown as a category and this
1913 dnl is expected behavior.
1916 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1917 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1918 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1919 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1920 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1921 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1922 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1923 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1924 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1925 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1926 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1927 dnl values are included in the total but not shown as a category and this
1928 dnl is expected behavior.
1931 ╭────────────────────────┬───────────────────────────╮
1933 │ ├──────┬──────┬──────┬──────┤
1934 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1935 ├────────────────────────┼──────┼──────┼──────┼──────┤
1936 │x 3.00 Count │ 1│ 1│ 1│ 3│
1937 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1938 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1939 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1940 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1941 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1942 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1943 │ Valid N │ │ │ │ 3│
1944 │ Total N │ │ │ │ 6│
1945 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1946 │ 4.00 Count │ 1│ 1│ 1│ 3│
1947 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1948 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1949 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1950 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1951 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1952 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1953 │ Valid N │ │ │ │ 3│
1954 │ Total N │ │ │ │ 6│
1955 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1956 │ 5.00 Count │ 1│ 1│ 1│ 3│
1957 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1958 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1959 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1960 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1961 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1962 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1963 │ Valid N │ │ │ │ 3│
1964 │ Total N │ │ │ │ 6│
1965 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1966 │ Total Count │ 3│ 3│ 3│ 9│
1967 │ Column % │100.0%│100.0%│100.0%│ .│
1968 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1969 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1970 │ Row % │ .│ .│ .│ .│
1971 │ Row Valid N % │ .│ .│ .│ .│
1972 │ Row Total N % │ .│ .│ .│ .│
1973 │ Valid N │ 3│ 3│ 3│ 9│
1974 │ Total N │ 6│ 6│ 6│ 36│
1975 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1978 ╭────────────────────────┬─────────────────────────────────────────╮
1980 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1981 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1982 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1983 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1984 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1985 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1986 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1987 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1988 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1989 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1990 │ Valid N │ │ │ │ │ │ 0│
1991 │ Total N │ │ │ │ │ │ 6│
1992 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1993 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1994 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1995 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1996 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1997 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1998 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1999 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2000 │ Valid N │ │ │ │ │ │ 0│
2001 │ Total N │ │ │ │ │ │ 6│
2002 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2003 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2004 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2005 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2006 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2007 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2008 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2009 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2010 │ Valid N │ │ │ │ │ │ 3│
2011 │ Total N │ │ │ │ │ │ 6│
2012 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2013 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2014 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2015 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2016 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2017 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2018 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2019 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2020 │ Valid N │ │ │ │ │ │ 3│
2021 │ Total N │ │ │ │ │ │ 6│
2022 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2023 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2024 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2025 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2026 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2027 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2028 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2029 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2030 │ Valid N │ │ │ │ │ │ 3│
2031 │ Total N │ │ │ │ │ │ 6│
2032 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2033 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
2034 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2035 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
2036 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2037 │ Row % │ .│ .│ .│ .│ .│ .│
2038 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2039 │ Row Total N % │ .│ .│ .│ .│ .│ .│
2040 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
2041 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
2042 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2045 ╭────────────────────────┬──────────────────────────────────╮
2047 │ ├──────┬──────┬──────┬──────┬──────┤
2048 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2049 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2050 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
2051 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2052 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2053 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2054 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2055 │ Row Valid N % │ .│ .│ .│ .│ .│
2056 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2057 │ Valid N │ │ │ │ │ 0│
2058 │ Total N │ │ │ │ │ 6│
2059 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2060 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
2061 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2062 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2063 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2064 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2065 │ Row Valid N % │ .│ .│ .│ .│ .│
2066 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2067 │ Valid N │ │ │ │ │ 0│
2068 │ Total N │ │ │ │ │ 6│
2069 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2070 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
2071 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2072 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2073 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2074 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2075 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2076 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2077 │ Valid N │ │ │ │ │ 3│
2078 │ Total N │ │ │ │ │ 6│
2079 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2080 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2081 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2082 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2083 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2084 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2085 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2086 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2087 │ Valid N │ │ │ │ │ 3│
2088 │ Total N │ │ │ │ │ 6│
2089 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2090 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2091 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2092 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2093 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2094 │ Row % │ .│ .│ .│ .│ .│
2095 │ Row Valid N % │ .│ .│ .│ .│ .│
2096 │ Row Total N % │ .│ .│ .│ .│ .│
2097 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2098 │ Total N │ 5│ 5│ 5│ 5│ 30│
2099 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2103 AT_SETUP([CTABLES SMISSING=LISTWISE])
2104 AT_KEYWORDS([SMISSING LISTWISE])
2105 AT_DATA([ctables.sps],
2106 [[DATA LIST LIST NOTABLE/x y z.
2114 VARIABLE LEVEL x (NOMINAL).
2116 CTABLES /TABLE (y + z) > x.
2117 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2119 * The following doesn't come out as listwise because the tables are
2120 separate, not linked by an > operator.
2121 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2123 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2153 AT_SETUP([CTABLES VLABELS - variables on different axes])
2154 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2155 AT_DATA([ctables.sps],
2157 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2158 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2159 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2160 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2161 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2163 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2165 ╭────────────────────────────────────────────────────────────────┬────────────╮
2171 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2172 │D5a. What would you say is your primary Cuban │ 13│ 7│
2173 │ethnic background? Mexican │ 175│ 136│
2175 │ South American │ 21│ 13│
2176 │ Central American │ 27│ 25│
2177 │ Puerto Rican, OR │ 37│ 41│
2178 │ Something else │ 35│ 33│
2179 │ Multiple - cannot │ 2│ 5│
2181 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2184 ╭──────────────────────────────────┬────────────╮
2190 ├──────────────────────────────────┼─────┼──────┤
2191 │QND5A Cuban │ 13│ 7│
2192 │ Mexican │ 175│ 136│
2194 │ South American │ 21│ 13│
2195 │ Central American │ 27│ 25│
2196 │ Puerto Rican, OR │ 37│ 41│
2197 │ Something else │ 35│ 33│
2198 │ Multiple - cannot choose one│ 2│ 5│
2199 ╰──────────────────────────────────┴─────┴──────╯
2202 ╭────────────────────────────────────────────────────────────────┬────────────╮
2208 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2209 │D5a. What would you say is your primary Cuban │ 13│ 7│
2210 │ethnic background? Mexican │ 175│ 136│
2212 │ South American │ 21│ 13│
2213 │ Central American │ 27│ 25│
2214 │ Puerto Rican, OR │ 37│ 41│
2215 │ Something else │ 35│ 33│
2216 │ Multiple - cannot │ 2│ 5│
2218 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2221 ╭────────────────────────────────────────────────────────────┬────────────────╮
2224 │ ├───────┬────────┤
2226 │ ├───────┼────────┤
2228 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2229 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2230 │primary ethnic background? Mexican │ 175│ 136│
2232 │ South American │ 21│ 13│
2233 │ Central American │ 27│ 25│
2234 │ Puerto Rican, OR │ 37│ 41│
2235 │ Something else │ 35│ 33│
2236 │ Multiple - cannot │ 2│ 5│
2238 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2241 ╭────────────────────────────┬─────┬──────╮
2245 ├────────────────────────────┼─────┼──────┤
2247 │Mexican │ 175│ 136│
2249 │South American │ 21│ 13│
2250 │Central American │ 27│ 25│
2251 │Puerto Rican, OR │ 37│ 41│
2252 │Something else │ 35│ 33│
2253 │Multiple - cannot choose one│ 2│ 5│
2254 ╰────────────────────────────┴─────┴──────╯
2258 AT_SETUP([CTABLES VLABELS - stacked variables])
2259 AT_KEYWORDS([stack stacking])
2260 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2261 AT_DATA([ctables.sps],
2263 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2264 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2265 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2266 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2267 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2269 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2271 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2273 ├───────────────────────────────────────────────────────────────────────┼─────┤
2274 │D5a. What would you say is your primary ethnic Cuban │ 20│
2275 │background? Mexican │ 311│
2277 │ South American │ 34│
2278 │ Central American │ 52│
2279 │ Puerto Rican, OR │ 78│
2280 │ Something else │ 68│
2281 │ Multiple - cannot │ 7│
2283 ├───────────────────────────────────────────────────────────────────────┼─────┤
2286 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2289 ╭─────────────────────────────────────────┬─────╮
2291 ├─────────────────────────────────────────┼─────┤
2295 │ South American │ 34│
2296 │ Central American │ 52│
2297 │ Puerto Rican, OR │ 78│
2298 │ Something else │ 68│
2299 │ Multiple - cannot choose one│ 7│
2300 ├─────────────────────────────────────────┼─────┤
2301 │S3a. GENDER: Male │ 3132│
2303 ╰─────────────────────────────────────────┴─────╯
2306 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2308 ├───────────────────────────────────────────────────────────────────────┼─────┤
2309 │D5a. What would you say is your primary ethnic Cuban │ 20│
2310 │background? Mexican │ 311│
2312 │ South American │ 34│
2313 │ Central American │ 52│
2314 │ Puerto Rican, OR │ 78│
2315 │ Something else │ 68│
2316 │ Multiple - cannot │ 7│
2318 ├───────────────────────────────────────────────────────────────────────┼─────┤
2320 ├───────────────────────────────────────────────────────────────────────┼─────┤
2322 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2325 ╭─────────────────────────────┬─────╮
2327 ├─────────────────────────────┼─────┤
2329 ├─────────────────────────────┼─────┤
2331 ├─────────────────────────────┼─────┤
2333 ├─────────────────────────────┼─────┤
2334 │South American │ 34│
2335 ├─────────────────────────────┼─────┤
2336 │Central American │ 52│
2337 ├─────────────────────────────┼─────┤
2338 │Puerto Rican, OR │ 78│
2339 ├─────────────────────────────┼─────┤
2340 │Something else │ 68│
2341 ├─────────────────────────────┼─────┤
2342 │Multiple - cannot choose one │ 7│
2343 ├─────────────────────────────┼─────┤
2344 │S3a. GENDER: Male │ 3132│
2346 ╰─────────────────────────────┴─────╯
2349 ╭────────────────────────────┬─────╮
2351 ├────────────────────────────┼─────┤
2355 │South American │ 34│
2356 │Central American │ 52│
2357 │Puerto Rican, OR │ 78│
2358 │Something else │ 68│
2359 │Multiple - cannot choose one│ 7│
2362 ╰────────────────────────────┴─────╯
2366 AT_SETUP([CTABLES VLABELS - nested variables])
2367 AT_KEYWORDS([nest nesting])
2368 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2369 AT_DATA([ctables.sps],
2371 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2372 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2373 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2374 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2375 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2377 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2379 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2381 ├───────────────────────────────────────────────────────────────────────┼─────┤
2382 │D5a. What would you say is your Cuban QNS3A Male │ 13│
2383 │primary ethnic background? Female│ 7│
2384 │ ╶─────────────────────────────────┼─────┤
2385 │ Mexican QNS3A Male │ 175│
2387 │ ╶─────────────────────────────────┼─────┤
2388 │ Spanish QNS3A Male │ 20│
2390 │ ╶─────────────────────────────────┼─────┤
2391 │ South American QNS3A Male │ 21│
2393 │ ╶─────────────────────────────────┼─────┤
2394 │ Central American QNS3A Male │ 27│
2396 │ ╶─────────────────────────────────┼─────┤
2397 │ Puerto Rican, OR QNS3A Male │ 37│
2399 │ ╶─────────────────────────────────┼─────┤
2400 │ Something else QNS3A Male │ 35│
2402 │ ╶─────────────────────────────────┼─────┤
2403 │ Multiple - cannot QNS3A Male │ 2│
2404 │ choose one Female│ 5│
2405 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2408 ╭──────────────────────────────────────────────────────┬─────╮
2410 ├──────────────────────────────────────────────────────┼─────┤
2411 │QND5A Cuban S3a. GENDER: Male │ 13│
2413 │ ╶────────────────────────────────────────────────┼─────┤
2414 │ Mexican S3a. GENDER: Male │ 175│
2416 │ ╶────────────────────────────────────────────────┼─────┤
2417 │ Spanish S3a. GENDER: Male │ 20│
2419 │ ╶────────────────────────────────────────────────┼─────┤
2420 │ South American S3a. GENDER: Male │ 21│
2422 │ ╶────────────────────────────────────────────────┼─────┤
2423 │ Central American S3a. GENDER: Male │ 27│
2425 │ ╶────────────────────────────────────────────────┼─────┤
2426 │ Puerto Rican, OR S3a. GENDER: Male │ 37│
2428 │ ╶────────────────────────────────────────────────┼─────┤
2429 │ Something else S3a. GENDER: Male │ 35│
2431 │ ╶────────────────────────────────────────────────┼─────┤
2432 │ Multiple - cannot choose one S3a. GENDER: Male │ 2│
2434 ╰──────────────────────────────────────────────────────┴─────╯
2437 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2439 ├───────────────────────────────────────────────────────────────────────┼─────┤
2440 │D5a. What would you say is your primary Cuban Male │ 13│
2441 │ethnic background? Female│ 7│
2442 │ ╶────────────────────────────┼─────┤
2443 │ Mexican Male │ 175│
2445 │ ╶────────────────────────────┼─────┤
2446 │ Spanish Male │ 20│
2448 │ ╶────────────────────────────┼─────┤
2449 │ South American Male │ 21│
2451 │ ╶────────────────────────────┼─────┤
2452 │ Central American Male │ 27│
2454 │ ╶────────────────────────────┼─────┤
2455 │ Puerto Rican, OR Male │ 37│
2457 │ ╶────────────────────────────┼─────┤
2458 │ Something else Male │ 35│
2460 │ ╶────────────────────────────┼─────┤
2461 │ Multiple - cannot Male │ 2│
2462 │ choose one Female│ 5│
2463 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2466 ╭────────────────────────────────────────────────┬─────╮
2468 ├────────────────────────────────────────────────┼─────┤
2469 │Cuban S3a. GENDER: Male │ 13│
2471 ├────────────────────────────────────────────────┼─────┤
2472 │Mexican S3a. GENDER: Male │ 175│
2474 ├────────────────────────────────────────────────┼─────┤
2475 │Spanish S3a. GENDER: Male │ 20│
2477 ├────────────────────────────────────────────────┼─────┤
2478 │South American S3a. GENDER: Male │ 21│
2480 ├────────────────────────────────────────────────┼─────┤
2481 │Central American S3a. GENDER: Male │ 27│
2483 ├────────────────────────────────────────────────┼─────┤
2484 │Puerto Rican, OR S3a. GENDER: Male │ 37│
2486 ├────────────────────────────────────────────────┼─────┤
2487 │Something else S3a. GENDER: Male │ 35│
2489 ├────────────────────────────────────────────────┼─────┤
2490 │Multiple - cannot choose one S3a. GENDER: Male │ 2│
2492 ╰────────────────────────────────────────────────┴─────╯
2495 ╭───────────────────────────────────┬─────╮
2497 ├───────────────────────────────────┼─────┤
2500 ├───────────────────────────────────┼─────┤
2501 │Mexican Male │ 175│
2503 ├───────────────────────────────────┼─────┤
2506 ├───────────────────────────────────┼─────┤
2507 │South American Male │ 21│
2509 ├───────────────────────────────────┼─────┤
2510 │Central American Male │ 27│
2512 ├───────────────────────────────────┼─────┤
2513 │Puerto Rican, OR Male │ 37│
2515 ├───────────────────────────────────┼─────┤
2516 │Something else Male │ 35│
2518 ├───────────────────────────────────┼─────┤
2519 │Multiple - cannot choose one Male │ 2│
2521 ╰───────────────────────────────────┴─────╯
2525 AT_SETUP([CTABLES FORMAT EMPTY])
2526 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2527 AT_DATA([ctables.sps],
2529 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2530 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2531 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2533 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2535 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2536 │ │ D5. ETHNICITY: Are you of │
2537 │ │ Hispanic or Latino origin or │
2539 │ ├───────────────┬───────────────┤
2541 │ ├───────────────┼───────────────┤
2543 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2544 │D5a. What would you say is Cuban │ 20│ 0│
2545 │your primary ethnic Mexican │ 311│ 0│
2546 │background? Spanish │ 48│ 0│
2547 │ South American │ 34│ 0│
2548 │ Central American│ 52│ 0│
2549 │ Puerto Rican, OR│ 78│ 0│
2550 │ Something else │ 68│ 0│
2551 │ Multiple - │ 7│ 0│
2552 │ cannot choose │ │ │
2554 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2557 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2558 │ │ D5. ETHNICITY: Are you of │
2559 │ │ Hispanic or Latino origin or │
2561 │ ├───────────────┬───────────────┤
2563 │ ├───────────────┼───────────────┤
2565 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2566 │D5a. What would you say is Cuban │ 20│ │
2567 │your primary ethnic Mexican │ 311│ │
2568 │background? Spanish │ 48│ │
2569 │ South American │ 34│ │
2570 │ Central American│ 52│ │
2571 │ Puerto Rican, OR│ 78│ │
2572 │ Something else │ 68│ │
2574 │ cannot choose │ │ │
2576 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2579 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2580 │ │ D5. ETHNICITY: Are you of │
2581 │ │ Hispanic or Latino origin or │
2583 │ ├───────────────┬───────────────┤
2585 │ ├───────────────┼───────────────┤
2587 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2588 │D5a. What would you say is Cuban │ 20│n/a │
2589 │your primary ethnic Mexican │ 311│n/a │
2590 │background? Spanish │ 48│n/a │
2591 │ South American │ 34│n/a │
2592 │ Central American│ 52│n/a │
2593 │ Puerto Rican, OR│ 78│n/a │
2594 │ Something else │ 68│n/a │
2595 │ Multiple - │ 7│n/a │
2596 │ cannot choose │ │ │
2598 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2602 AT_SETUP([CTABLES FORMAT MISSING])
2603 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2604 AT_DATA([ctables.sps],
2606 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2608 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2610 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2611 │ │ D5. ETHNICITY: Are you of │
2612 │ │ Hispanic or Latino origin or │
2614 │ ├───────────────┬───────────────┤
2616 │ ├───────────────┼───────────────┤
2617 │ │ Column % │ Column % │
2618 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2619 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2620 │your primary ethnic Mexican │ 50.3%│(no data) │
2621 │background? Spanish │ 7.8%│(no data) │
2622 │ South American │ 5.5%│(no data) │
2623 │ Central American│ 8.4%│(no data) │
2624 │ Puerto Rican, OR│ 12.6%│(no data) │
2625 │ Something else │ 11.0%│(no data) │
2626 │ Multiple - │ 1.1%│(no data) │
2627 │ cannot choose │ │ │
2629 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2633 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2634 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2635 AT_DATA([ctables.sps],
2637 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2638 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2639 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2641 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2643 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2645 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2646 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2647 │occasion? 1 │ 491│ 34.9%│
2667 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2670 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2672 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2673 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2674 │occasion? 1 │ 491│ 34.9%│
2694 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2697 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2699 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2700 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2701 │occasion? 1 │ 491│ 34.9%│
2721 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2725 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2726 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2727 AT_DATA([ctables.sps],
2729 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2731 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2743 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2744 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2745 maximumColumnWidth="192"
2746 minimumColumnWidth="96"
2750 AT_SETUP([CTABLES special formats])
2751 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2752 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2753 AT_DATA([ctables.sps],
2755 COMPUTE x = qnd3 - 4.
2756 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].
2758 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2760 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2761 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2762 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2763 │x│(3.0) │N=-3.0 │(-3.0) │(-3.0%)│8.0 │N=8.0 │(8.0) │(8.0%) │
2764 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2768 AT_SETUP([CTABLES TITLES])
2769 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2770 AT_DATA([ctables.sps],
2773 /VLABELS VARIABLES=qn1 DISPLAY=NONE
2774 /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2775 /TITLES TITLE='How often do you drive?'
2776 CAPTION='Generated )TIME on )DATE'
2779 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
2780 s&../../..&MM/DD/YY&'], [0], [dnl
2781 How often do you drive?
2782 ╭───────────────────────────────────┬─────────────────────────────────────────╮
2784 │ ├────────────────────┬────────────────────┤
2786 │ ├────────────────────┼────────────────────┤
2787 │ │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
2788 │ │ you of Hispanic or │ you of Hispanic or │
2789 │ │ Latino origin or │ Latino origin or │
2790 │( ( 1. How often do you usually │ descent? │ descent? │
2791 │drive a car or other motor ├─────────┬──────────┼─────────┬──────────┤
2792 │vehicle?) ) BY S3a. GENDER: > D5. │ Yes │ No │ Yes │ No │
2793 │ETHNICITY: Are you of Hispanic or ├─────────┼──────────┼─────────┼──────────┤
2794 │Latino origin or descent? │ Count │ Count │ Count │ Count │
2795 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
2796 │Every day │ 218│ 2066│ 166│ 2175│
2797 │Several days a week │ 44│ 391│ 45│ 782│
2798 │Once a week or less │ 16│ 109│ 12│ 223│
2799 │Only certain times a year │ 15│ 41│ 11│ 61│
2800 │Never │ 39│ 150│ 56│ 278│
2801 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
2802 Generated HH:MM:SS on MM/DD/YY
2806 AT_SETUP([CTABLES area definitions])
2807 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2808 AT_DATA([ctables.sps],
2811 /VLABELS VARIABLES=ALL DISPLAY=NAME
2812 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLE.ID, LAYER.ID, SUBTABLE.ID]
2813 /SLABELS POSITION=ROW
2814 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROW.ID, LAYERROW.ID]
2815 /SLABELS POSITION=ROW
2816 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COL.ID, LAYERCOL.ID]
2817 /SLABELS POSITION=ROW.
2819 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
2822 ╭─────────────────────────────┬─────────────┬──────╮
2824 │ ├──────┬──────┼───┬──┤
2826 │ ├──────┼──────┤ │ │
2827 │ │ QN86 │ QN86 │ │ │
2828 │ ├───┬──┼───┬──┤ │ │
2829 │ │Yes│No│Yes│No│Yes│No│
2830 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
2831 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2832 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2833 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
2834 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2835 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2836 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2837 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
2838 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
2839 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2840 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2841 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
2842 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2843 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2844 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2845 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
2846 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
2850 ╭─────────────────────────────┬─────────────┬──────╮
2852 │ ├──────┬──────┼───┬──┤
2854 │ ├──────┼──────┤ │ │
2855 │ │ QN86 │ QN86 │ │ │
2856 │ ├───┬──┼───┬──┤ │ │
2857 │ │Yes│No│Yes│No│Yes│No│
2858 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
2859 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2860 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2861 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
2862 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2863 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2864 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2865 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
2866 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
2867 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2868 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2869 │ Subtable ID│ 10│10│ 11│11│ 12│12│
2870 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2871 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2872 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2873 │ Subtable ID│ 10│10│ 11│11│ 12│12│
2874 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
2878 ╭──────────────────────────────┬─────────────┬──────╮
2880 │ ├──────┬──────┼───┬──┤
2882 │ ├──────┼──────┤ │ │
2883 │ │ QN86 │ QN86 │ │ │
2884 │ ├───┬──┼───┬──┤ │ │
2885 │ │Yes│No│Yes│No│Yes│No│
2886 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
2887 │QN61 Yes QN57 Yes Row ID │ 1│ 1│ 2│ 2│ 3│ 3│
2888 │ Layer Row ID│ 1│ 1│ 1│ 1│ 2│ 2│
2889 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2890 │ No Row ID │ 4│ 4│ 5│ 5│ 6│ 6│
2891 │ Layer Row ID│ 3│ 3│ 3│ 3│ 4│ 4│
2892 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
2893 │ No QN57 Yes Row ID │ 7│ 7│ 8│ 8│ 9│ 9│
2894 │ Layer Row ID│ 5│ 5│ 5│ 5│ 6│ 6│
2895 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2896 │ No Row ID │ 10│10│ 11│11│ 12│12│
2897 │ Layer Row ID│ 7│ 7│ 7│ 7│ 8│ 8│
2898 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
2902 ╭──────────────────────────────┬─────────────┬──────╮
2904 │ ├──────┬──────┼───┬──┤
2906 │ ├──────┼──────┤ │ │
2907 │ │ QN86 │ QN86 │ │ │
2908 │ ├───┬──┼───┬──┤ │ │
2909 │ │Yes│No│Yes│No│Yes│No│
2910 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
2911 │QN61 Yes QN57 Yes Row ID │ 13│13│ 14│14│ 15│15│
2912 │ Layer Row ID│ 9│ 9│ 9│ 9│ 10│10│
2913 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2914 │ No Row ID │ 16│16│ 17│17│ 18│18│
2915 │ Layer Row ID│ 11│11│ 11│11│ 12│12│
2916 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
2917 │ No QN57 Yes Row ID │ 19│19│ 20│20│ 21│21│
2918 │ Layer Row ID│ 13│13│ 13│13│ 14│14│
2919 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2920 │ No Row ID │ 22│22│ 23│23│ 24│24│
2921 │ Layer Row ID│ 15│15│ 15│15│ 16│16│
2922 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
2926 ╭─────────────────────────────────┬─────────────┬──────╮
2928 │ ├──────┬──────┼───┬──┤
2930 │ ├──────┼──────┤ │ │
2931 │ │ QN86 │ QN86 │ │ │
2932 │ ├───┬──┼───┬──┤ │ │
2933 │ │Yes│No│Yes│No│Yes│No│
2934 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
2935 │QN61 Yes QN57 Yes Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
2936 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2937 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2938 │ No Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
2939 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2940 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
2941 │ No QN57 Yes Column ID │ 7│ 8│ 9│10│ 11│12│
2942 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2943 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2944 │ No Column ID │ 7│ 8│ 9│10│ 11│12│
2945 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2946 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
2950 ╭─────────────────────────────────┬─────────────┬──────╮
2952 │ ├──────┬──────┼───┬──┤
2954 │ ├──────┼──────┤ │ │
2955 │ │ QN86 │ QN86 │ │ │
2956 │ ├───┬──┼───┬──┤ │ │
2957 │ │Yes│No│Yes│No│Yes│No│
2958 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
2959 │QN61 Yes QN57 Yes Column ID │ 13│14│ 15│16│ 17│18│
2960 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2961 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2962 │ No Column ID │ 13│14│ 15│16│ 17│18│
2963 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2964 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
2965 │ No QN57 Yes Column ID │ 19│20│ 21│22│ 23│24│
2966 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2967 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2968 │ No Column ID │ 19│20│ 21│22│ 23│24│
2969 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2970 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
2974 AT_SETUP([CTABLES categorical summary functions])
2975 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2976 AT_DATA([ctables.sps],
2979 /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
2980 /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
2981 /SLABELS POSITION=ROW.
2983 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2985 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
2986 │ │ D5a. What would you say is your primary ethnic background? │
2987 │ ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
2988 │ │ │ │ │ │ │ │ │ Multiple - │ │ │ │
2989 │ │ │ │ │ South │ Central │ Puerto │ Something│ cannot choose│ Don't│ │ │
2990 │ │Cuban│Mexican│Spanish│ American │ American │Rican, OR│ else │ one │ know │Refused│Total│
2991 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
2992 │Region NE Count │ 6│ 8│ 8│ 11│ 7│ 39│ 23│ 2│ 0│ 1│ 105│
2993 │ Row % │ 5.7%│ 7.6%│ 7.6%│ 10.5%│ 6.7%│ 37.1%│ 21.9%│ 1.9%│ .0%│ 1.0%│ │
2994 │ Row │ 5.8%│ 7.7%│ 7.7%│ 10.6%│ 6.7%│ 37.5%│ 22.1%│ 1.9%│ .0%│ .0%│ │
2995 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
2996 │ % │ │ │ │ │ │ │ │ │ │ │ │
2997 │ Row │ .4%│ .6%│ .6%│ .8%│ .5%│ 2.8%│ 1.6%│ .1%│ .0%│ .1%│ │
2998 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
2999 │ % │ │ │ │ │ │ │ │ │ │ │ │
3000 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 104│
3001 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1409│
3002 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3003 │ MW Count │ 3│ 24│ 1│ 4│ 5│ 9│ 6│ 0│ 0│ 1│ 53│
3004 │ Row % │ 5.7%│ 45.3%│ 1.9%│ 7.5%│ 9.4%│ 17.0%│ 11.3%│ .0%│ .0%│ 1.9%│ │
3005 │ Row │ 5.8%│ 46.2%│ 1.9%│ 7.7%│ 9.6%│ 17.3%│ 11.5%│ .0%│ .0%│ .0%│ │
3006 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3007 │ % │ │ │ │ │ │ │ │ │ │ │ │
3008 │ Row │ .2%│ 1.5%│ .1%│ .2%│ .3%│ .5%│ .4%│ .0%│ .0%│ .1%│ │
3009 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3010 │ % │ │ │ │ │ │ │ │ │ │ │ │
3011 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 52│
3012 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1654│
3013 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3014 │ S Count │ 10│ 113│ 11│ 14│ 25│ 23│ 20│ 2│ 3│ 2│ 223│
3015 │ Row % │ 4.5%│ 50.7%│ 4.9%│ 6.3%│ 11.2%│ 10.3%│ 9.0%│ .9%│ 1.3%│ .9%│ │
3016 │ Row │ 4.6%│ 51.8%│ 5.0%│ 6.4%│ 11.5%│ 10.6%│ 9.2%│ .9%│ .0%│ .0%│ │
3017 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3018 │ % │ │ │ │ │ │ │ │ │ │ │ │
3019 │ Row │ .4%│ 4.7%│ .5%│ .6%│ 1.0%│ 1.0%│ .8%│ .1%│ .1%│ .1%│ │
3020 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3021 │ % │ │ │ │ │ │ │ │ │ │ │ │
3022 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 218│
3023 │ Total N│ │ │ │ │ │ │ │ │ │ │ 2390│
3024 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3025 │ W Count │ 1│ 166│ 28│ 5│ 15│ 7│ 19│ 3│ 0│ 1│ 245│
3026 │ Row % │ .4%│ 67.8%│ 11.4%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .4%│ │
3027 │ Row │ .4%│ 68.0%│ 11.5%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .0%│ │
3028 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3029 │ % │ │ │ │ │ │ │ │ │ │ │ │
3030 │ Row │ .1%│ 10.7%│ 1.8%│ .3%│ 1.0%│ .5%│ 1.2%│ .2%│ .0%│ .1%│ │
3031 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3032 │ % │ │ │ │ │ │ │ │ │ │ │ │
3033 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 244│
3034 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1546│
3035 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
3040 AT_SETUP([CTABLES scale summary functions])
3041 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3042 AT_DATA([ctables.sps],
3046 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
3047 CTABLES later, to make the results easier to verify.
3048 SPLIT FILE BY REGION.
3051 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
3052 /FORMAT NOTABLE /MISSING=INCLUDE.
3056 /VLABELS VARIABLE=qn19a DISPLAY=NAME /*XXX NONE yields an assertion failure
3057 /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, COLPCT.SUM]
3058 /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
3059 /SLABELS POSITION=ROW.
3061 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
3063 ╭────────────────┬────────╮
3065 ├────────────────┼────────┤
3068 │ ╶─────────┼────────┤
3070 │ ╶─────────┼────────┤
3072 │ ╶─────────┼────────┤
3074 │ ╶─────────┼────────┤
3076 │ ╶─────────┼────────┤
3078 │ ╶─────────┼────────┤
3080 │ ╶─────────┼────────┤
3082 │ ╶─────────┼────────┤
3084 │ ╶─────────┼────────┤
3086 │ ╶─────────┼────────┤
3088 ├────────────────┼────────┤
3091 │ ╶─────────┼────────┤
3093 │ ╶─────────┼────────┤
3095 │ ╶─────────┼────────┤
3097 │ ╶─────────┼────────┤
3099 │ ╶─────────┼────────┤
3101 │ ╶─────────┼────────┤
3103 │ ╶─────────┼────────┤
3105 │ ╶─────────┼────────┤
3107 │ ╶─────────┼────────┤
3109 │ ╶─────────┼────────┤
3111 ├────────────────┼────────┤
3114 │ ╶─────────┼────────┤
3116 │ ╶─────────┼────────┤
3118 │ ╶─────────┼────────┤
3120 │ ╶─────────┼────────┤
3122 │ ╶─────────┼────────┤
3124 │ ╶─────────┼────────┤
3126 │ ╶─────────┼────────┤
3128 │ ╶─────────┼────────┤
3130 │ ╶─────────┼────────┤
3132 │ ╶─────────┼────────┤
3134 ├────────────────┼────────┤
3137 │ ╶─────────┼────────┤
3139 │ ╶─────────┼────────┤
3141 │ ╶─────────┼────────┤
3143 │ ╶─────────┼────────┤
3145 │ ╶─────────┼────────┤
3147 │ ╶─────────┼────────┤
3149 │ ╶─────────┼────────┤
3151 │ ╶─────────┼────────┤
3153 │ ╶─────────┼────────┤
3155 │ ╶─────────┼────────┤
3157 ╰────────────────┴────────╯
3160 ╭───────────────────────────┬────────╮
3162 ├───────────────────────────┼────────┤
3163 │REGION NE Valid N │ 936│
3166 │ Std Error of Mean│ .14│
3169 │ Std Deviation │ 4.41│
3177 │ Column Sum % │ 21.8%│
3178 │ ╶────────────────────┼────────┤
3179 │ MW Valid N │ 1019│
3182 │ Std Error of Mean│ .16│
3185 │ Std Deviation │ 5.15│
3193 │ Column Sum % │ 24.3%│
3194 │ ╶────────────────────┼────────┤
3196 │ Missing │ 1114.00│
3198 │ Std Error of Mean│ .18│
3201 │ Std Deviation │ 6.44│
3209 │ Column Sum % │ 31.2%│
3210 │ ╶────────────────────┼────────┤
3214 │ Std Error of Mean│ .17│
3217 │ Std Deviation │ 5.25│
3225 │ Column Sum % │ 22.7%│
3226 ╰───────────────────────────┴────────╯
3231 AT_SETUP([CTABLES hidden scale VLABELS])
3232 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3233 AT_DATA([ctables.sps],
3236 /TABLE region BY qn19a + qn35
3237 /SLABELS POSITION=ROW.
3239 /VLABELS VARIABLE=qn19a DISPLAY=NONE
3240 /TABLE region BY qn19a + qn35
3241 /SLABELS POSITION=ROW.
3243 /VLABELS VARIABLE=qn35 DISPLAY=NONE
3244 /TABLE region BY qn19a + qn35
3245 /SLABELS POSITION=ROW.
3247 * This one in particular caused a crash because no categories were
3248 created on the column axis, so passing in 0 for the index was still
3249 too big for that number of categories. It was fixed by creating a
3250 name-only category for each variable despite the "NONE" request,
3251 then hiding the entire dimension's labels if all its labels were
3254 /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
3255 /TABLE region BY qn19a + qn35
3256 /SLABELS POSITION=ROW.
3258 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3260 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
3261 │ │ 19a. About how old were you│ 35. In the past thirty days, how│
3262 │ │ when you first starting │ many times have you driven a │
3263 │ │ drinking alcohol, not │ motor vehicle WITHIN TWO HOURS │
3264 │ │ counting small tastes or │ AFTER drinking alcoholic │
3265 │ │ sips of alcohol. │ beverages? │
3266 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
3267 │Region NE Mean│ 19.33│ 2│
3268 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3269 │ MW Mean│ 19.83│ 2│
3270 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3272 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3274 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
3277 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
3278 │ │ │ 35. In the past thirty days, how many times have you │
3279 │ │ │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
3280 │ │QN19A│ alcoholic beverages? │
3281 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
3282 │Region NE Mean│19.33│ 2│
3283 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3285 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3287 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3289 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
3292 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
3293 │ │ 19a. About how old were you when you first starting │ │
3294 │ │ drinking alcohol, not counting small tastes or sips of │ │
3296 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
3297 │Region NE Mean│ 19.33│ 2│
3298 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3299 │ MW Mean│ 19.83│ 2│
3300 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3302 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3304 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
3307 ╭──────────────┬───────╮
3308 │Region NE Mean│19.33 2│
3315 ╰──────────────┴───────╯