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
13 dnl * ascending/descending
16 dnl * THRU (numeric ranges)
19 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
20 dnl - HIDESMALLCOUNTS.
21 dnl - Date/time variables and values
22 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
23 dnl - TITLES: )DATE, )TIME, )TABLE.
25 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
26 dnl * MISSING, OTHERNM
27 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
31 dnl - Summary functions:
32 dnl * U-prefix for unweighted summaries.
33 dnl * areaPCT.SUM and UareaPCT.SUM functions.
34 dnl - SPLIT FILE with SEPARATE splits
35 dnl - Definition of columns/rows when labels are rotated from one axis to another.
38 dnl - Multiple response sets
39 dnl - MRSETS subcommand.
40 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
43 dnl - Summary functions:
44 dnl * .LCL and .UCL suffixes.
47 dnl * Data-dependent sorting.
49 AT_SETUP([CTABLES parsing])
50 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
51 AT_DATA([ctables.sps],
54 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
55 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
56 /FORMAT UNITS=CM EMPTY="(-)"
57 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
58 /VLABELS VARIABLES=qn17 DISPLAY=NAME
59 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
60 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
61 /VLABELS VARIABLES=qn20 DISPLAY=NONE
62 /MRSETS COUNTDUPLICATES=NO
63 /MRSETS COUNTDUPLICATES=YES
66 /WEIGHT VARIABLE=qns3a
68 /HIDESMALLCOUNTS COUNT=10
70 /SLABELS POSITION=COLUMN VISIBLE=YES
71 /SLABELS VISIBLE=NO POSITION=ROW
72 /SLABELS POSITION=LAYER
74 /CLABELS ROWLABELS=OPPOSITE
76 /CATEGORIES VARIABLES=qn1 qn17
77 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
78 POSITION=BEFORE EMPTY=INCLUDE.
79 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
80 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
81 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
83 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
86 ╭───────────────────┬────┬────╮
88 ├───────────────────┼────┼────┤
89 │Sa1. SAMPLE SOURCE:│5392│1607│
90 ╰───────────────────┴────┴────╯
94 ╭───────────────────┬─────╮
96 ├───────────────────┼─────┤
97 │Sa1. SAMPLE SOURCE:│ 5392│
98 ╰───────────────────┴─────╯
101 ╭────────────────────────┬─────╮
103 ├────────────────────────┼─────┤
104 │Sa1. SAMPLE SOURCE: RDD │ 5392│
106 ╰────────────────────────┴─────╯
109 ╭────────────────────────┬─────╮
111 ├────────────────────────┼─────┤
112 │Sa1. SAMPLE SOURCE: RDD │ 5392│
114 ╰────────────────────────┴─────╯
118 AT_SETUP([CTABLES parsing - negative])
119 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
120 AT_DATA([ctables.sps],
123 CTABLES /FORMAT MINCOLWIDTH='foo'.
124 CTABLES /TABLE qn1 [**].
125 CTABLES /TABLE qn1 [NOTAFUNCTION].
128 CTABLES /TABLE NOTAVAR.
130 CTABLES /TABLE string[S].
131 CTABLES /TABLE qn1 [PTILE 101].
132 CTABLES /TABLE qn1 [MEAN F0.1].
133 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
134 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
135 CTABLES /TABLE qn1 [MEAN TOTALS].
136 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
137 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
138 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
154 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
155 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
156 CTABLES /PCOMPUTE &k=EXPR([LO **]).
157 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
158 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
159 CTABLES /PCOMPUTE &k=EXPR([1**]).
160 CTABLES /PCOMPUTE &k=EXPR((1x)).
161 CTABLES /PCOMPUTE **k.
162 CTABLES /PCOMPUTE &1.
163 CTABLES /PCOMPUTE &k**.
164 CTABLES /PCOMPUTE &k=**.
165 CTABLES /PCOMPUTE &k=EXPR**.
166 CTABLES /PCOMPUTE &k=EXPR(1x).
167 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
168 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
169 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
170 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
173 CTABLES /FORMAT EMPTY=**.
174 CTABLES /FORMAT MISSING=**.
176 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
178 CTABLES /VLABELS VARIABLES=NOTAVAR.
179 CTABLES /VLABELS VARIABLES=qn1 **.
180 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
182 CTABLES /MRSETS COUNTDUPLICATES=**.
183 CTABLES /SMISSING **.
185 CTABLES /WEIGHT VARIABLE=NOTAVAR.
186 CTABLES /HIDESMALLCOUNTS COUNT=1.
188 CTABLES /HIDESMALLCOUNTS COUNT=2.
189 CTABLES /TABLE qn1**.
190 CTABLES /TABLE qn1 /SLABELS POSITION=**.
191 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
192 CTABLES /TABLE qn1 /SLABELS **.
193 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
194 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
195 CTABLES /TABLE qn1 /CLABELS **.
196 CTABLES /TABLE qn1 /CRITERIA **.
197 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
198 CTABLES /TABLE qn1 /TITLES **.
199 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
200 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
201 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
202 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
203 CTABLES /TABLE qn1 /SIGTEST **.
204 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
205 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
206 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
207 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
208 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
209 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
210 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
211 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
212 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
213 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
214 CTABLES /TABLE qn1 /COMPARETEST **.
215 CTABLES /TABLE qn1 / **.
216 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
217 CTABLES /TABLE qn20 > qnd1.
218 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
219 NUMERIC datetime (DATETIME17.0).
220 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
222 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
223 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
225 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
226 negative number for MINCOLWIDTH.
228 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
231 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
232 summary function name.
234 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
236 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
239 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
241 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
243 10 | CTABLES /TABLE string[S].
246 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
247 between 0 and 100 for PTILE.
249 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
250 requires a width between 1 and 40.
252 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
253 format NEGPAREN requires width 2 or greater.
255 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
256 format NEGPAREN requires width greater than decimals.
258 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
260 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
263 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
264 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
267 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
269 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
271 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
274 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
275 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
278 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
280 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
282 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
284 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
286 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
288 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
290 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
293 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
294 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
297 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
298 between 0 and 100 for PTILE.
300 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
303 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
306 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
309 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
312 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
314 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
317 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
320 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
321 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
323 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
324 LABEL, POSITION, or EMPTY.
326 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
327 integer for SUBTOTAL.
329 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
331 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
333 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
335 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
337 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
339 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
341 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
343 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
345 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
347 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
349 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
351 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
353 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
354 the previous definition.
355 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
356 | ^~~~~~~~~~~~~~~~~~~
358 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
359 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
360 | ^~~~~~~~~~~~~~~~~~~
362 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
365 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
366 Expecting summary function name.
368 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
369 between 0 and 100 for PTILE.
371 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
373 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
376 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
377 FORMAT, or HIDESOURCECATS.
379 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
381 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
383 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
384 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
386 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
389 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
392 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
394 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
397 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
398 DEFAULT, NAME, LABEL, BOTH, or NONE.
400 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
403 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
406 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
407 VARIABLE or LISTWISE.
409 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
412 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
414 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
415 greater for HIDESMALLCOUNTS COUNT.
417 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
418 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
419 HIDESMALLCOUNTS, or TABLE.
421 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
424 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
426 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
429 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
432 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
435 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
438 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
441 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
442 ROWLABELS, or COLLABELS.
444 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
447 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
448 in @<:@0,100@:}@ for CILEVEL.
450 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
451 CAPTION, CORNER, or TITLE.
453 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
456 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
457 in @<:@0,1@:}@ for ALPHA.
459 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
462 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
463 ALLVISIBLE or SUBTOTALS.
465 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
466 ALPHA, INCLUDEMRSETS, or CATEGORIES.
468 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
471 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
474 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
477 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
478 BONFERRONI, BH, or NONE.
480 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
483 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
486 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
487 ALLVISIBLE or SUBTOTALS.
489 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
492 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
495 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
498 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
499 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
502 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
503 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
505 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
508 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
509 97 | CTABLES /TABLE qn20 > qnd1.
512 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
513 97 | CTABLES /TABLE qn20 > qnd1.
516 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
517 97 | CTABLES /TABLE qn20 > qnd1.
520 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
521 categorical variables at the innermost nesting level.
522 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
523 | ^~~~~~~~~~~~~~~~~~~~
525 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
527 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
530 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
531 specification as format DATETIME: Day (123) must be between 1 and 31..
532 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
537 AT_SETUP([CTABLES parsing - more negative])
538 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
539 AT_DATA([ctables.sps],
541 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
542 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
543 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
546 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
547 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
549 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
551 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
552 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
553 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
554 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
556 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
557 CTABLES /PCOMPUTE &x=EXPR([**]).
558 CTABLES /PCOMPUTE &x=EXPR(**).
562 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
564 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
565 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
566 category not included in the category list.
567 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
572 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
573 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
577 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
578 list of categories here.
579 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
584 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
585 category not included in the category list.
586 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
591 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
592 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
596 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
597 variable's CATEGORIES specification.
599 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
600 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
601 subtotals by position, e.g. SUBTOTAL[1].
602 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
603 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
605 ^~~~~~~~~~~~~~~~~~~~~~~~
607 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
609 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
610 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
613 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
614 applied only to string variables, but this subcommand tries to apply it to
615 numeric variable QN1.
616 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
619 ctables.sps:8.53: error: CTABLES: This category specification may be applied
620 only to numeric variables, but this subcommand tries to apply it to string
622 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
625 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
626 based on a summary function.
628 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
629 moved to be categorical, but qnd1 is a scale variable.
631 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
632 moved to have the same width, but QN1 has width 0 and string has width 8.
634 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
635 moved to have the same value labels, but QN1 and QNSA1 have different value
638 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
639 moved to have the same category specifications, but QN105BA and QN105BB have
640 different category specifications.
642 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
643 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
644 this warning, insert parentheses.
645 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
648 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
651 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
653 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
655 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
656 variable must be specified.
658 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
660 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
662 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
665 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
667 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
670 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
672 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
677 AT_SETUP([CTABLES one categorical variable])
678 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
679 AT_DATA([ctables.sps],
682 CTABLES /TABLE BY qn1.
683 CTABLES /TABLE BY BY qn1.
685 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
687 ╭────────────────────────────────────────────────────────────────────────┬─────╮
689 ├────────────────────────────────────────────────────────────────────────┼─────┤
690 │ 1. How often do you usually drive a car or other Every day │ 4667│
691 │motor vehicle? Several days a week │ 1274│
692 │ Once a week or less │ 361│
693 │ Only certain times a │ 130│
696 ╰────────────────────────────────────────────────────────────────────────┴─────╯
699 ╭──────────────────────────────────────────────────────────────────────────────╮
700 │ 1. How often do you usually drive a car or other motor vehicle? │
701 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
702 │ │ Several days a │ Once a week or │ Only certain times a │ │
703 │Every day│ week │ less │ year │Never│
704 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
705 │ Count │ Count │ Count │ Count │Count│
706 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
707 │ 4667│ 1274│ 361│ 130│ 540│
708 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
720 AT_SETUP([CTABLES one string variable])
721 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
722 AT_DATA([ctables.sps],
725 MISSING VALUES licensed('DontKnow', 'Refused').
726 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
727 CTABLES /TABLE licensed.
728 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
729 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
730 * Notice that the string matching is case-sensitive.
731 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
732 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
734 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
735 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
737 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
739 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
740 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
742 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
744 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
754 ╭─────────────────┬─────┬───────╮
756 ├─────────────────┼─────┼───────┤
757 │licensed DontKnow│ 4│ │
761 │ Total │ 6999│ 6951│
762 ╰─────────────────┴─────┴───────╯
765 ╭──────────────┬─────╮
767 ├──────────────┼─────┤
768 │licensed Yes │ 6379│
771 ╰──────────────┴─────╯
774 ╭──────────────┬─────╮
776 ├──────────────┼─────┤
777 │licensed Yes │ 6379│
780 ╰──────────────┴─────╯
783 ╭────────────────┬─────╮
785 ├────────────────┼─────┤
790 ╰────────────────┴─────╯
793 ╭────────────────┬─────╮
795 ├────────────────┼─────┤
796 │licensed Yes │ 6379│
798 ╰────────────────┴─────╯
801 ╭────────────────┬─────╮
803 ├────────────────┼─────┤
804 │licensed Yes │ 6379│
806 ╰────────────────┴─────╯
810 AT_SETUP([CTABLES one scale variable])
811 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
812 AT_DATA([ctables.sps],
814 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
815 CTABLES /TABLE BY qnd1.
816 CTABLES /TABLE BY BY qnd1.
818 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
820 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
821 │ │ │ │ │ │ Std │ │ │
822 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
823 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
824 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
825 │age? │ │ │ │ │ │ │ │
826 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
829 ╭──────────────────────────╮
830 │D1. AGE: What is your age?│
831 ├──────────────────────────┤
833 ├──────────────────────────┤
835 ╰──────────────────────────╯
838 D1. AGE: What is your age?
847 AT_SETUP([CTABLES simple stacking])
848 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
849 AT_DATA([ctables.sps],
851 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
853 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
855 ╭───────────────────────────────────────────────────────────────┬──────────────╮
862 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
863 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
864 │too much to drink to drive safely will A. Get certain │ │ │
865 │stopped by the police? Very likely │ 21%│ 22%│
866 │ Somewhat │ 38%│ 42%│
868 │ Somewhat │ 21%│ 18%│
872 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
873 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
874 │too much to drink to drive safely will B. Have an certain │ │ │
875 │accident? Very likely │ 36%│ 45%│
876 │ Somewhat │ 39%│ 32%│
882 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
883 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
884 │too much to drink to drive safely will C. Be certain │ │ │
885 │convicted for drunk driving? Very likely │ 32%│ 28%│
886 │ Somewhat │ 27%│ 32%│
888 │ Somewhat │ 15%│ 15%│
892 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
893 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
894 │too much to drink to drive safely will D. Be certain │ │ │
895 │arrested for drunk driving? Very likely │ 26%│ 27%│
896 │ Somewhat │ 32%│ 35%│
898 │ Somewhat │ 17%│ 15%│
902 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
906 AT_SETUP([CTABLES show or hide empty categories])
907 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
908 AT_DATA([ctables.sps],
910 IF (qn105ba = 2) qn105ba = 1.
911 IF (qns3a = 1) qns3a = 2.
912 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
913 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
914 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
915 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
916 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
917 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
918 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
920 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
922 ╭──────────────────────────────────────────────────────────────┬───────────────╮
929 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
930 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
931 │too much to drink to drive safely will A. Get certain │ │ │
932 │stopped by the police? Very likely│ .│ 0%│
939 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
942 ╭──────────────────────────────────────────────────────────────┬───────────────╮
949 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
950 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
951 │too much to drink to drive safely will A. Get certain │ │ │
952 │stopped by the police? Somewhat │ .│ 40%│
958 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
961 ╭────────────────────────────────────────────────────────────────────┬─────────╮
968 ├────────────────────────────────────────────────────────────────────┼─────────┤
969 │105b. How likely is it that drivers who have had too Almost │ 32%│
970 │much to drink to drive safely will A. Get stopped by certain │ │
971 │the police? Very likely │ 0%│
978 ╰────────────────────────────────────────────────────────────────────┴─────────╯
981 ╭────────────────────────────────────────────────────────────────────┬─────────╮
988 ├────────────────────────────────────────────────────────────────────┼─────────┤
989 │105b. How likely is it that drivers who have had too Almost │ 32%│
990 │much to drink to drive safely will A. Get stopped by certain │ │
991 │the police? Somewhat │ 40%│
997 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1001 AT_SETUP([CTABLES simple nesting])
1002 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1003 AT_DATA([ctables.sps],
1005 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1006 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1007 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1008 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1009 /CLABELS ROW=OPPOSITE.
1011 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1013 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1016 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1017 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1018 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1019 │drive safely will A. Get stopped by Total │ 700│ 10%│
1020 │the police? ╶──────────────────────────┼─────┼──────┤
1021 │ Very S3a. Male │ 660│ 10%│
1022 │ likely GENDER: Female│ 842│ 12%│
1023 │ Total │ 1502│ 22%│
1024 │ ╶──────────────────────────┼─────┼──────┤
1025 │ Somewhat S3a. Male │ 1174│ 17%│
1026 │ likely GENDER: Female│ 1589│ 23%│
1027 │ Total │ 2763│ 40%│
1028 │ ╶──────────────────────────┼─────┼──────┤
1029 │ Somewhat S3a. Male │ 640│ 9%│
1030 │ unlikely GENDER: Female│ 667│ 10%│
1031 │ Total │ 1307│ 19%│
1032 │ ╶──────────────────────────┼─────┼──────┤
1033 │ Very S3a. Male │ 311│ 5%│
1034 │ unlikely GENDER: Female│ 298│ 4%│
1036 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1037 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1038 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1039 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1040 │ ╶──────────────────────────┼─────┼──────┤
1041 │ Very S3a. Male │ 1104│ 16%│
1042 │ likely GENDER: Female│ 1715│ 25%│
1043 │ Total │ 2819│ 41%│
1044 │ ╶──────────────────────────┼─────┼──────┤
1045 │ Somewhat S3a. Male │ 1203│ 17%│
1046 │ likely GENDER: Female│ 1214│ 18%│
1047 │ Total │ 2417│ 35%│
1048 │ ╶──────────────────────────┼─────┼──────┤
1049 │ Somewhat S3a. Male │ 262│ 4%│
1050 │ unlikely GENDER: Female│ 168│ 2%│
1052 │ ╶──────────────────────────┼─────┼──────┤
1053 │ Very S3a. Male │ 81│ 1%│
1054 │ unlikely GENDER: Female│ 59│ 1%│
1056 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1057 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1058 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1059 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1060 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1061 │ Very S3a. Male │ 988│ 14%│
1062 │ likely GENDER: Female│ 1049│ 15%│
1063 │ Total │ 2037│ 30%│
1064 │ ╶──────────────────────────┼─────┼──────┤
1065 │ Somewhat S3a. Male │ 822│ 12%│
1066 │ likely GENDER: Female│ 1210│ 18%│
1067 │ Total │ 2032│ 30%│
1068 │ ╶──────────────────────────┼─────┼──────┤
1069 │ Somewhat S3a. Male │ 446│ 7%│
1070 │ unlikely GENDER: Female│ 548│ 8%│
1072 │ ╶──────────────────────────┼─────┼──────┤
1073 │ Very S3a. Male │ 268│ 4%│
1074 │ unlikely GENDER: Female│ 354│ 5%│
1076 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1077 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1078 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1079 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1080 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1081 │ Very S3a. Male │ 805│ 12%│
1082 │ likely GENDER: Female│ 1029│ 15%│
1083 │ Total │ 1834│ 27%│
1084 │ ╶──────────────────────────┼─────┼──────┤
1085 │ Somewhat S3a. Male │ 975│ 14%│
1086 │ likely GENDER: Female│ 1332│ 19%│
1087 │ Total │ 2307│ 34%│
1088 │ ╶──────────────────────────┼─────┼──────┤
1089 │ Somewhat S3a. Male │ 535│ 8%│
1090 │ unlikely GENDER: Female│ 560│ 8%│
1091 │ Total │ 1095│ 16%│
1092 │ ╶──────────────────────────┼─────┼──────┤
1093 │ Very S3a. Male │ 270│ 4%│
1094 │ unlikely GENDER: Female│ 279│ 4%│
1096 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1099 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1100 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1101 │ │ certain│likely│ likely │ unlikely│unlikely│
1102 │ ├────────┼──────┼─────────┼─────────┼────────┤
1104 │ │ Table %│ % │ Table % │ Table % │ Table %│
1105 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1106 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1107 │GENDER: is it that drivers│ │ │ │ │ │
1108 │ who have had too │ │ │ │ │ │
1109 │ much to drink to │ │ │ │ │ │
1110 │ drive safely will │ │ │ │ │ │
1111 │ A. Get stopped by │ │ │ │ │ │
1112 │ the police? │ │ │ │ │ │
1113 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1114 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1115 │ is it that drivers│ │ │ │ │ │
1116 │ who have had too │ │ │ │ │ │
1117 │ much to drink to │ │ │ │ │ │
1118 │ drive safely will │ │ │ │ │ │
1119 │ A. Get stopped by │ │ │ │ │ │
1120 │ the police? │ │ │ │ │ │
1121 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1122 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1123 │ is it that drivers│ │ │ │ │ │
1124 │ who have had too │ │ │ │ │ │
1125 │ much to drink to │ │ │ │ │ │
1126 │ drive safely will │ │ │ │ │ │
1127 │ A. Get stopped by │ │ │ │ │ │
1128 │ the police? │ │ │ │ │ │
1129 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1130 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1131 │GENDER: is it that drivers│ │ │ │ │ │
1132 │ who have had too │ │ │ │ │ │
1133 │ much to drink to │ │ │ │ │ │
1134 │ drive safely will │ │ │ │ │ │
1135 │ B. Have an │ │ │ │ │ │
1136 │ accident? │ │ │ │ │ │
1137 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1138 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1139 │ is it that drivers│ │ │ │ │ │
1140 │ who have had too │ │ │ │ │ │
1141 │ much to drink to │ │ │ │ │ │
1142 │ drive safely will │ │ │ │ │ │
1143 │ B. Have an │ │ │ │ │ │
1144 │ accident? │ │ │ │ │ │
1145 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1146 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1147 │ is it that drivers│ │ │ │ │ │
1148 │ who have had too │ │ │ │ │ │
1149 │ much to drink to │ │ │ │ │ │
1150 │ drive safely will │ │ │ │ │ │
1151 │ B. Have an │ │ │ │ │ │
1152 │ accident? │ │ │ │ │ │
1153 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1154 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1155 │GENDER: is it that drivers│ │ │ │ │ │
1156 │ who have had too │ │ │ │ │ │
1157 │ much to drink to │ │ │ │ │ │
1158 │ drive safely will │ │ │ │ │ │
1159 │ C. Be convicted │ │ │ │ │ │
1160 │ for drunk driving?│ │ │ │ │ │
1161 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1162 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1163 │ is it that drivers│ │ │ │ │ │
1164 │ who have had too │ │ │ │ │ │
1165 │ much to drink to │ │ │ │ │ │
1166 │ drive safely will │ │ │ │ │ │
1167 │ C. Be convicted │ │ │ │ │ │
1168 │ for drunk driving?│ │ │ │ │ │
1169 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1170 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1171 │ is it that drivers│ │ │ │ │ │
1172 │ who have had too │ │ │ │ │ │
1173 │ much to drink to │ │ │ │ │ │
1174 │ drive safely will │ │ │ │ │ │
1175 │ C. Be convicted │ │ │ │ │ │
1176 │ for drunk driving?│ │ │ │ │ │
1177 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1178 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1179 │GENDER: is it that drivers│ │ │ │ │ │
1180 │ who have had too │ │ │ │ │ │
1181 │ much to drink to │ │ │ │ │ │
1182 │ drive safely will │ │ │ │ │ │
1183 │ D. Be arrested for│ │ │ │ │ │
1184 │ drunk driving? │ │ │ │ │ │
1185 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1186 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1187 │ is it that drivers│ │ │ │ │ │
1188 │ who have had too │ │ │ │ │ │
1189 │ much to drink to │ │ │ │ │ │
1190 │ drive safely will │ │ │ │ │ │
1191 │ D. Be arrested for│ │ │ │ │ │
1192 │ drunk driving? │ │ │ │ │ │
1193 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1194 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1195 │ is it that drivers│ │ │ │ │ │
1196 │ who have had too │ │ │ │ │ │
1197 │ much to drink to │ │ │ │ │ │
1198 │ drive safely will │ │ │ │ │ │
1199 │ D. Be arrested for│ │ │ │ │ │
1200 │ drunk driving? │ │ │ │ │ │
1201 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1205 AT_SETUP([CTABLES nesting and scale variables])
1206 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1207 AT_DATA([ctables.sps],
1209 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1210 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1211 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1212 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1213 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1215 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1217 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1223 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1224 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1225 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1227 │ Once a week or │ 44│ 54│
1229 │ Only certain │ 34│ 41│
1230 │ times a year │ │ │
1232 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1235 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1236 │ │Minimum│Maximum│Mean│
1237 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1238 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1239 │What is GENDER: months, has there been a │ │ │ │
1240 │your time when you felt you │ │ │ │
1241 │age? should cut down on your No │ 16│ 86│ 46│
1243 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1244 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1245 │ months, has there been a │ │ │ │
1246 │ time when you felt you │ │ │ │
1247 │ should cut down on your No │ 16│ 86│ 48│
1249 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1250 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1251 │What is GENDER: months, has there been a │ │ │ │
1252 │your time when people criticized No │ 16│ 86│ 46│
1253 │age? your drinking? │ │ │ │
1254 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1255 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1256 │ months, has there been a │ │ │ │
1257 │ time when people criticized No │ 16│ 86│ 48│
1258 │ your drinking? │ │ │ │
1259 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1262 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1263 │ │S1. Including yourself, how many members of this│
1264 │ │ household are age 16 or older? │
1265 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1266 │ │ │ │ │ │ │ │ 6 or │
1267 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1268 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1269 │ │Column│Column│Column│Column│Column│Column│Column│
1270 │ │ % │ % │ % │ % │ % │ % │ % │
1271 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1272 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1273 │SAMPLE How certain │ │ │ │ │ │ │ │
1274 │SOURCE: likely │ │ │ │ │ │ │ │
1275 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1276 │ that likely │ │ │ │ │ │ │ │
1277 │ drivers │ │ │ │ │ │ │ │
1278 │ who have │ │ │ │ │ │ │ │
1279 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1280 │ much to likely │ │ │ │ │ │ │ │
1281 │ drink to │ │ │ │ │ │ │ │
1282 │ drive │ │ │ │ │ │ │ │
1283 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1284 │ will A. unlikely│ │ │ │ │ │ │ │
1285 │ Get │ │ │ │ │ │ │ │
1286 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1287 │ by the unlikely│ │ │ │ │ │ │ │
1288 │ police? │ │ │ │ │ │ │ │
1289 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1292 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1295 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1296 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1297 │group typical month did you have one or more │ │ │
1298 │ alcoholic beverages to drink? │ │ │
1299 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1300 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1301 │ typical month did you have one or more │ │ │
1302 │ alcoholic beverages to drink? │ │ │
1303 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1304 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1305 │ typical month did you have one or more │ │ │
1306 │ alcoholic beverages to drink? │ │ │
1307 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1308 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1309 │ typical month did you have one or more │ │ │
1310 │ alcoholic beverages to drink? │ │ │
1311 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1312 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1313 │ typical month did you have one or more │ │ │
1314 │ alcoholic beverages to drink? │ │ │
1315 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1316 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1317 │ older typical month did you have one or more │ │ │
1318 │ alcoholic beverages to drink? │ │ │
1319 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1324 AT_SETUP([CTABLES SLABELS])
1325 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1326 AT_DATA([ctables.sps],
1328 CTABLES /TABLE qn1 [COUNT COLPCT].
1329 CTABLES /TABLE qn1 [COUNT COLPCT]
1330 /SLABELS POSITION=ROW.
1331 CTABLES /TABLE qn1 [COUNT COLPCT]
1332 /SLABELS POSITION=ROW VISIBLE=NO.
1334 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1336 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1339 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1340 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1341 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1342 │ Once a week or less│ 361│ 5.2%│
1343 │ Only certain times │ 130│ 1.9%│
1345 │ Never │ 540│ 7.7%│
1346 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1349 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1350 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1351 │other motor vehicle? Column │66.9%│
1353 │ ╶───────────────────────────┼─────┤
1354 │ Several days a week Count │ 1274│
1357 │ ╶───────────────────────────┼─────┤
1358 │ Once a week or less Count │ 361│
1361 │ ╶───────────────────────────┼─────┤
1362 │ Only certain times Count │ 130│
1363 │ a year Column │ 1.9%│
1365 │ ╶───────────────────────────┼─────┤
1366 │ Never Count │ 540│
1369 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1372 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1373 │ 1. How often do you usually drive a car or other Every day │ 4667│
1374 │motor vehicle? │66.9%│
1375 │ Several days a week │ 1274│
1377 │ Once a week or less │ 361│
1379 │ Only certain times a │ 130│
1383 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1387 AT_SETUP([CTABLES simple totals])
1388 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1389 AT_DATA([ctables.sps],
1392 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1393 DESCRIPTIVES qn18/STATISTICS=MEAN.
1394 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1395 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1397 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1399 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1401 ├────────────────────────────────────────────────────────────────────────┼─────┤
1402 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1403 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1406 │ Wine coolers │ 137│
1407 │ Hard liquor or │ 888│
1409 │ Flavored malt │ 83│
1411 │ Number responding │ 4221│
1412 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1414 Descriptive Statistics
1415 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1417 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1418 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1419 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1420 │Valid N (listwise) │6999│ │
1421 │Missing N (listwise) │2781│ │
1422 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1425 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1426 │ │ │ │ Valid│Total│
1427 │ │Mean│Count│ N │ N │
1428 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1429 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1430 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1431 │ you usually drink per sitting? │ │ │ │ │
1432 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1433 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1434 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1435 │ you usually drink per sitting? │ │ │ │ │
1436 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1437 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1438 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1439 │ you usually drink per sitting? │ │ │ │ │
1440 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1441 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1442 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1443 │ you usually drink per sitting? │ │ │ │ │
1444 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1445 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1446 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1447 │ you usually drink per sitting? │ │ │ │ │
1448 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1452 AT_SETUP([CTABLES subtotals])
1453 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1454 AT_DATA([ctables.sps],
1456 CTABLES /TABLE=qn105ba BY qns1
1457 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1458 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1459 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1460 CTABLES /TABLE=qn105ba BY qns1
1461 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1462 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1464 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1466 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1467 │ │ S1. Including yourself, how many members of this household │
1468 │ │ are age 16 or older? │
1469 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1470 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1471 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1472 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1473 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1474 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1475 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1476 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1477 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1478 │ likely │ │ │ │ │ │ │ │
1479 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1480 │ unlikely │ │ │ │ │ │ │ │
1481 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1482 │ unlikely │ │ │ │ │ │ │ │
1483 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1486 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1487 │ │ S1. Including yourself, how many members of this household │
1488 │ │ are age 16 or older? │
1489 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1490 │ │ │ │ │ │ │ │ 6 or │
1491 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1492 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1493 │ │ │ │ │ │ Column│ │ │
1494 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1495 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1496 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1497 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1498 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1499 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1500 │ likely │ │ │ │ │ │ │ │
1501 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1502 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1503 │ unlikely │ │ │ │ │ │ │ │
1504 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1505 │ unlikely │ │ │ │ │ │ │ │
1506 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1507 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1510 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1511 │ │ S1. Including yourself, how many members of this household │
1512 │ │ are age 16 or older? │
1513 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1514 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1515 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1516 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1517 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1518 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1519 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1520 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1521 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1522 │ likely │ │ │ │ │ │ │ │
1523 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1524 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1525 │ unlikely │ │ │ │ │ │ │ │
1526 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1527 │ unlikely │ │ │ │ │ │ │ │
1528 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1529 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1533 AT_SETUP([CTABLES PCOMPUTE])
1534 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1535 AT_DATA([ctables.sps],
1538 /PCOMPUTE &x=EXPR([3] + [4])
1539 /PCOMPUTE &y=EXPR([4] + [5])
1540 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1541 /PPROPERTIES &y LABEL='4+5'
1542 /TABLE=qn105ba BY qns1
1543 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1545 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1547 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1548 │ │ S1. Including yourself, how many members of this household │
1549 │ │ are age 16 or older? │
1550 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1551 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1552 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1553 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1554 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1555 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1556 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1557 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1558 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1559 │ likely │ │ │ │ │ │ │ │
1560 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1561 │ unlikely │ │ │ │ │ │ │ │
1562 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1563 │ unlikely │ │ │ │ │ │ │ │
1564 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1568 AT_SETUP([CTABLES CLABELS])
1569 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1570 AT_DATA([ctables.sps],
1572 CTABLES /TABLE AgeGroup BY qns3a.
1573 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1574 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1575 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1576 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1579 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1581 ╭───────────────────────┬────────────╮
1587 ├───────────────────────┼─────┼──────┤
1588 │Age group 15 or younger│ 0│ 0│
1589 │ 16 to 25 │ 594│ 505│
1590 │ 26 to 35 │ 476│ 491│
1591 │ 36 to 45 │ 489│ 548│
1592 │ 46 to 55 │ 526│ 649│
1593 │ 56 to 65 │ 516│ 731│
1594 │ 66 or older │ 531│ 943│
1595 ╰───────────────────────┴─────┴──────╯
1598 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1600 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1602 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1603 │ │ 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 │
1604 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1605 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1606 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1607 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1608 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1609 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1610 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1613 ╭──────────────────────────────┬────────────╮
1617 ├──────────────────────────────┼────────────┤
1618 │Age group 15 or younger Male │ 0│
1620 │ ╶────────────────────┼────────────┤
1621 │ 16 to 25 Male │ 594│
1623 │ ╶────────────────────┼────────────┤
1624 │ 26 to 35 Male │ 476│
1626 │ ╶────────────────────┼────────────┤
1627 │ 36 to 45 Male │ 489│
1629 │ ╶────────────────────┼────────────┤
1630 │ 46 to 55 Male │ 526│
1632 │ ╶────────────────────┼────────────┤
1633 │ 56 to 65 Male │ 516│
1635 │ ╶────────────────────┼────────────┤
1636 │ 66 or older Male │ 531│
1638 ╰──────────────────────────────┴────────────╯
1642 ╭─────────┬────────────╮
1648 ├─────────┼─────┼──────┤
1650 ╰─────────┴─────┴──────╯
1654 ╭─────────┬────────────╮
1660 ├─────────┼─────┼──────┤
1661 │Age group│ 594│ 505│
1662 ╰─────────┴─────┴──────╯
1666 ╭─────────┬────────────╮
1672 ├─────────┼─────┼──────┤
1673 │Age group│ 476│ 491│
1674 ╰─────────┴─────┴──────╯
1678 ╭─────────┬────────────╮
1684 ├─────────┼─────┼──────┤
1685 │Age group│ 489│ 548│
1686 ╰─────────┴─────┴──────╯
1690 ╭─────────┬────────────╮
1696 ├─────────┼─────┼──────┤
1697 │Age group│ 526│ 649│
1698 ╰─────────┴─────┴──────╯
1702 ╭─────────┬────────────╮
1708 ├─────────┼─────┼──────┤
1709 │Age group│ 516│ 731│
1710 ╰─────────┴─────┴──────╯
1714 ╭─────────┬────────────╮
1720 ├─────────┼─────┼──────┤
1721 │Age group│ 531│ 943│
1722 ╰─────────┴─────┴──────╯
1726 ╭───────────────────────┬────────────╮
1730 ├───────────────────────┼────────────┤
1731 │Age group 15 or younger│ 0│
1737 │ 66 or older │ 531│
1738 ╰───────────────────────┴────────────╯
1742 ╭───────────────────────┬────────────╮
1746 ├───────────────────────┼────────────┤
1747 │Age group 15 or younger│ 0│
1753 │ 66 or older │ 943│
1754 ╰───────────────────────┴────────────╯
1758 AT_SETUP([CTABLES missing values])
1759 AT_DATA([ctables.sps],
1760 [[DATA LIST LIST NOTABLE/x y.
1799 MISSING VALUES x (1, 2) y (2, 3).
1800 VARIABLE LEVEL ALL (NOMINAL).
1802 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1803 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1804 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1805 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1806 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1807 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1808 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1809 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1810 /CATEGORIES VARIABLES=ALL TOTAL=YES
1811 /SLABELS POSITION=ROW.
1812 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1813 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1814 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1815 /SLABELS POSITION=ROW.
1816 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1817 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1818 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1819 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1820 /SLABELS POSITION=ROW.
1822 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1824 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1825 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1826 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1827 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1828 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1829 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1830 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1831 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1832 dnl Note that Column Total N % doesn't add up to 100 because missing
1833 dnl values are included in the total but not shown as a category and this
1834 dnl is expected behavior.
1837 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1838 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1839 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1840 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1841 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1842 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1843 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1844 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1845 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1846 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1847 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1848 dnl values are included in the total but not shown as a category and this
1849 dnl is expected behavior.
1852 ╭────────────────────────┬───────────────────────────╮
1854 │ ├──────┬──────┬──────┬──────┤
1855 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1856 ├────────────────────────┼──────┼──────┼──────┼──────┤
1857 │x 3.00 Count │ 1│ 1│ 1│ 3│
1858 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1859 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1860 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1861 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1862 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1863 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1864 │ Valid N │ │ │ │ 3│
1865 │ Total N │ │ │ │ 6│
1866 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1867 │ 4.00 Count │ 1│ 1│ 1│ 3│
1868 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1869 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1870 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1871 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1872 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1873 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1874 │ Valid N │ │ │ │ 3│
1875 │ Total N │ │ │ │ 6│
1876 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1877 │ 5.00 Count │ 1│ 1│ 1│ 3│
1878 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1879 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1880 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1881 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1882 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1883 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1884 │ Valid N │ │ │ │ 3│
1885 │ Total N │ │ │ │ 6│
1886 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1887 │ Total Count │ 3│ 3│ 3│ 9│
1888 │ Column % │100.0%│100.0%│100.0%│ .│
1889 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1890 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1891 │ Row % │ .│ .│ .│ .│
1892 │ Row Valid N % │ .│ .│ .│ .│
1893 │ Row Total N % │ .│ .│ .│ .│
1894 │ Valid N │ 3│ 3│ 3│ 9│
1895 │ Total N │ 6│ 6│ 6│ 36│
1896 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1899 ╭────────────────────────┬─────────────────────────────────────────╮
1901 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1902 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1903 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1904 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1905 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1906 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1907 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1908 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1909 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1910 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1911 │ Valid N │ │ │ │ │ │ 0│
1912 │ Total N │ │ │ │ │ │ 6│
1913 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1914 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1915 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1916 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1917 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1918 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1919 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1920 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1921 │ Valid N │ │ │ │ │ │ 0│
1922 │ Total N │ │ │ │ │ │ 6│
1923 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1924 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1925 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1926 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1927 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1928 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1929 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1930 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1931 │ Valid N │ │ │ │ │ │ 3│
1932 │ Total N │ │ │ │ │ │ 6│
1933 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1934 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1935 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1936 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1937 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1938 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1939 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1940 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1941 │ Valid N │ │ │ │ │ │ 3│
1942 │ Total N │ │ │ │ │ │ 6│
1943 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1944 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1945 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1946 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1947 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1948 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1949 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1950 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1951 │ Valid N │ │ │ │ │ │ 3│
1952 │ Total N │ │ │ │ │ │ 6│
1953 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1954 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1955 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1956 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1957 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1958 │ Row % │ .│ .│ .│ .│ .│ .│
1959 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1960 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1961 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1962 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1963 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1966 ╭────────────────────────┬──────────────────────────────────╮
1968 │ ├──────┬──────┬──────┬──────┬──────┤
1969 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1970 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1971 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1972 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1973 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1974 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1975 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1976 │ Row Valid N % │ .│ .│ .│ .│ .│
1977 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1978 │ Valid N │ │ │ │ │ 0│
1979 │ Total N │ │ │ │ │ 6│
1980 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1981 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1982 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1983 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1984 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1985 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1986 │ Row Valid N % │ .│ .│ .│ .│ .│
1987 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1988 │ Valid N │ │ │ │ │ 0│
1989 │ Total N │ │ │ │ │ 6│
1990 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1991 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1992 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1993 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1994 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1995 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1996 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1997 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1998 │ Valid N │ │ │ │ │ 3│
1999 │ Total N │ │ │ │ │ 6│
2000 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2001 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2002 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2003 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2004 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2005 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2006 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2007 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2008 │ Valid N │ │ │ │ │ 3│
2009 │ Total N │ │ │ │ │ 6│
2010 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2011 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2012 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2013 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2014 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2015 │ Row % │ .│ .│ .│ .│ .│
2016 │ Row Valid N % │ .│ .│ .│ .│ .│
2017 │ Row Total N % │ .│ .│ .│ .│ .│
2018 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2019 │ Total N │ 5│ 5│ 5│ 5│ 30│
2020 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2024 AT_SETUP([CTABLES SMISSING=LISTWISE])
2025 AT_KEYWORDS([SMISSING LISTWISE])
2026 AT_DATA([ctables.sps],
2027 [[DATA LIST LIST NOTABLE/x y z.
2035 VARIABLE LEVEL x (NOMINAL).
2037 CTABLES /TABLE (y + z) > x.
2038 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2040 * The following doesn't come out as listwise because the tables are
2041 separate, not linked by an > operator.
2042 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2044 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2074 AT_SETUP([CTABLES VLABELS])
2075 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2076 AT_DATA([ctables.sps],
2078 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2079 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2080 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2081 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2082 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2084 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2086 ╭────────────────────────────────────────────────────────────────┬────────────╮
2092 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2093 │D5a. What would you say is your primary Cuban │ 13│ 7│
2094 │ethnic background? Mexican │ 175│ 136│
2096 │ South American │ 21│ 13│
2097 │ Central American │ 27│ 25│
2098 │ Puerto Rican, OR │ 37│ 41│
2099 │ Something else │ 35│ 33│
2100 │ Multiple - cannot │ 2│ 5│
2102 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2105 ╭──────────────────────────────────┬────────────╮
2111 ├──────────────────────────────────┼─────┼──────┤
2112 │QND5A Cuban │ 13│ 7│
2113 │ Mexican │ 175│ 136│
2115 │ South American │ 21│ 13│
2116 │ Central American │ 27│ 25│
2117 │ Puerto Rican, OR │ 37│ 41│
2118 │ Something else │ 35│ 33│
2119 │ Multiple - cannot choose one│ 2│ 5│
2120 ╰──────────────────────────────────┴─────┴──────╯
2123 ╭────────────────────────────────────────────────────────────────┬────────────╮
2129 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2130 │D5a. What would you say is your primary Cuban │ 13│ 7│
2131 │ethnic background? Mexican │ 175│ 136│
2133 │ South American │ 21│ 13│
2134 │ Central American │ 27│ 25│
2135 │ Puerto Rican, OR │ 37│ 41│
2136 │ Something else │ 35│ 33│
2137 │ Multiple - cannot │ 2│ 5│
2139 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2142 ╭────────────────────────────────────────────────────────────┬────────────────╮
2145 │ ├───────┬────────┤
2147 │ ├───────┼────────┤
2149 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2150 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2151 │primary ethnic background? Mexican │ 175│ 136│
2153 │ South American │ 21│ 13│
2154 │ Central American │ 27│ 25│
2155 │ Puerto Rican, OR │ 37│ 41│
2156 │ Something else │ 35│ 33│
2157 │ Multiple - cannot │ 2│ 5│
2159 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2162 ╭────────────────────────────┬─────┬──────╮
2166 ├────────────────────────────┼─────┼──────┤
2168 │Mexican │ 175│ 136│
2170 │South American │ 21│ 13│
2171 │Central American │ 27│ 25│
2172 │Puerto Rican, OR │ 37│ 41│
2173 │Something else │ 35│ 33│
2174 │Multiple - cannot choose one│ 2│ 5│
2175 ╰────────────────────────────┴─────┴──────╯
2179 AT_SETUP([CTABLES FORMAT=EMPTY])
2180 AT_KEYWORDS([FORMAT EMPTY])
2181 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2182 AT_DATA([ctables.sps],
2184 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2185 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2186 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2188 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2190 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2191 │ │ D5. ETHNICITY: Are you of │
2192 │ │ Hispanic or Latino origin or │
2194 │ ├───────────────┬───────────────┤
2196 │ ├───────────────┼───────────────┤
2198 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2199 │D5a. What would you say is Cuban │ 20│ 0│
2200 │your primary ethnic Mexican │ 311│ 0│
2201 │background? Spanish │ 48│ 0│
2202 │ South American │ 34│ 0│
2203 │ Central American│ 52│ 0│
2204 │ Puerto Rican, OR│ 78│ 0│
2205 │ Something else │ 68│ 0│
2206 │ Multiple - │ 7│ 0│
2207 │ cannot choose │ │ │
2209 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2212 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2213 │ │ D5. ETHNICITY: Are you of │
2214 │ │ Hispanic or Latino origin or │
2216 │ ├───────────────┬───────────────┤
2218 │ ├───────────────┼───────────────┤
2220 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2221 │D5a. What would you say is Cuban │ 20│ │
2222 │your primary ethnic Mexican │ 311│ │
2223 │background? Spanish │ 48│ │
2224 │ South American │ 34│ │
2225 │ Central American│ 52│ │
2226 │ Puerto Rican, OR│ 78│ │
2227 │ Something else │ 68│ │
2229 │ cannot choose │ │ │
2231 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2234 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2235 │ │ D5. ETHNICITY: Are you of │
2236 │ │ Hispanic or Latino origin or │
2238 │ ├───────────────┬───────────────┤
2240 │ ├───────────────┼───────────────┤
2242 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2243 │D5a. What would you say is Cuban │ 20│n/a │
2244 │your primary ethnic Mexican │ 311│n/a │
2245 │background? Spanish │ 48│n/a │
2246 │ South American │ 34│n/a │
2247 │ Central American│ 52│n/a │
2248 │ Puerto Rican, OR│ 78│n/a │
2249 │ Something else │ 68│n/a │
2250 │ Multiple - │ 7│n/a │
2251 │ cannot choose │ │ │
2253 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2257 AT_SETUP([CTABLES FORMAT=MISSING])
2258 AT_KEYWORDS([FORMAT MISSING])
2259 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2260 AT_DATA([ctables.sps],
2262 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2264 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2266 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2267 │ │ D5. ETHNICITY: Are you of │
2268 │ │ Hispanic or Latino origin or │
2270 │ ├───────────────┬───────────────┤
2272 │ ├───────────────┼───────────────┤
2273 │ │ Column % │ Column % │
2274 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2275 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2276 │your primary ethnic Mexican │ 50.3%│(no data) │
2277 │background? Spanish │ 7.8%│(no data) │
2278 │ South American │ 5.5%│(no data) │
2279 │ Central American│ 8.4%│(no data) │
2280 │ Puerto Rican, OR│ 12.6%│(no data) │
2281 │ Something else │ 11.0%│(no data) │
2282 │ Multiple - │ 1.1%│(no data) │
2283 │ cannot choose │ │ │
2285 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯