3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Testing details of missing value handling in summaries.
7 dnl - Test WEIGHT and adjustment weights.
8 dnl - Summary functions:
9 dnl * Separate summary functions for totals and subtotals.
10 dnl * )CILEVEL in summary label specification
14 dnl * ascending/descending
17 dnl * THRU (numeric ranges)
20 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
23 dnl - HIDESMALLCOUNTS.
24 dnl - Date/time variables and values
25 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
26 dnl - TITLES: )DATE, )TIME, )TABLE.
28 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
29 dnl * MISSING, OTHERNM
30 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
34 dnl - Summary functions:
35 dnl * U-prefix for unweighted summaries.
36 dnl * areaPCT.SUM and UareaPCT.SUM functions.
37 dnl - SPLIT FILE with SEPARATE splits
38 dnl - Definition of columns/rows when labels are rotated from one axis to another.
41 dnl - Multiple response sets
42 dnl - MRSETS subcommand.
43 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
46 dnl - Summary functions:
47 dnl * .LCL and .UCL suffixes.
50 dnl * Data-dependent sorting.
52 AT_SETUP([CTABLES parsing])
53 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
54 AT_DATA([ctables.sps],
57 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
58 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
59 /FORMAT UNITS=CM EMPTY="(-)"
60 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
61 /VLABELS VARIABLES=qn17 DISPLAY=NAME
62 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
63 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
64 /VLABELS VARIABLES=qn20 DISPLAY=NONE
65 /MRSETS COUNTDUPLICATES=NO
66 /MRSETS COUNTDUPLICATES=YES
69 /WEIGHT VARIABLE=qns3a
71 /HIDESMALLCOUNTS COUNT=10
73 /SLABELS POSITION=COLUMN VISIBLE=YES
74 /SLABELS VISIBLE=NO POSITION=ROW
75 /SLABELS POSITION=LAYER
77 /CLABELS ROWLABELS=OPPOSITE
79 /CATEGORIES VARIABLES=qn1 qn17
80 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
81 POSITION=BEFORE EMPTY=INCLUDE.
82 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
83 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
84 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
86 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
89 ╭───────────────────┬────┬────╮
91 ├───────────────────┼────┼────┤
92 │Sa1. SAMPLE SOURCE:│5392│1607│
93 ╰───────────────────┴────┴────╯
97 ╭───────────────────┬─────╮
99 ├───────────────────┼─────┤
100 │Sa1. SAMPLE SOURCE:│ 5392│
101 ╰───────────────────┴─────╯
104 ╭────────────────────────┬─────╮
106 ├────────────────────────┼─────┤
107 │Sa1. SAMPLE SOURCE: RDD │ 5392│
109 ╰────────────────────────┴─────╯
112 ╭────────────────────────┬─────╮
114 ├────────────────────────┼─────┤
115 │Sa1. SAMPLE SOURCE: RDD │ 5392│
117 ╰────────────────────────┴─────╯
121 AT_SETUP([CTABLES parsing - negative])
122 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
123 AT_DATA([ctables.sps],
126 CTABLES /FORMAT MINCOLWIDTH='foo'.
127 CTABLES /TABLE qn1 [**].
128 CTABLES /TABLE qn1 [NOTAFUNCTION].
131 CTABLES /TABLE NOTAVAR.
133 CTABLES /TABLE string[S].
134 CTABLES /TABLE qn1 [PTILE 101].
135 CTABLES /TABLE qn1 [MEAN F0.1].
136 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
137 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
138 CTABLES /TABLE qn1 [MEAN TOTALS].
139 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
155 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
156 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
157 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
158 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
159 CTABLES /PCOMPUTE &k=EXPR([LO **]).
160 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
161 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
162 CTABLES /PCOMPUTE &k=EXPR([1**]).
163 CTABLES /PCOMPUTE &k=EXPR((1x)).
164 CTABLES /PCOMPUTE **k.
165 CTABLES /PCOMPUTE &1.
166 CTABLES /PCOMPUTE &k**.
167 CTABLES /PCOMPUTE &k=**.
168 CTABLES /PCOMPUTE &k=EXPR**.
169 CTABLES /PCOMPUTE &k=EXPR(1x).
170 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
174 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
175 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
176 CTABLES /FORMAT EMPTY=**.
177 CTABLES /FORMAT MISSING=**.
179 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
181 CTABLES /VLABELS VARIABLES=NOTAVAR.
182 CTABLES /VLABELS VARIABLES=qn1 **.
183 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
185 CTABLES /MRSETS COUNTDUPLICATES=**.
186 CTABLES /SMISSING **.
188 CTABLES /WEIGHT VARIABLE=NOTAVAR.
189 CTABLES /HIDESMALLCOUNTS COUNT=1.
191 CTABLES /HIDESMALLCOUNTS COUNT=2.
192 CTABLES /TABLE qn1**.
193 CTABLES /TABLE qn1 /SLABELS POSITION=**.
194 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
195 CTABLES /TABLE qn1 /SLABELS **.
196 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
197 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
198 CTABLES /TABLE qn1 /CLABELS **.
199 CTABLES /TABLE qn1 /CRITERIA **.
200 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
201 CTABLES /TABLE qn1 /TITLES **.
202 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
203 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
204 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
205 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
206 CTABLES /TABLE qn1 /SIGTEST **.
207 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
208 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
209 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
210 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
211 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
212 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
213 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
214 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
215 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
216 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
217 CTABLES /TABLE qn1 /COMPARETEST **.
218 CTABLES /TABLE qn1 / **.
219 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
220 CTABLES /TABLE qn20 > qnd1.
221 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
222 NUMERIC datetime (DATETIME17.0).
223 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
225 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
226 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
228 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
229 negative number for MINCOLWIDTH.
231 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
234 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
235 summary function name.
237 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
239 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
242 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
244 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
246 10 | CTABLES /TABLE string[S].
249 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
250 between 0 and 100 for PTILE.
252 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
253 requires a width between 1 and 40.
255 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
256 format NEGPAREN requires width 2 or greater.
258 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
259 format NEGPAREN requires width greater than decimals.
261 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
263 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
266 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
267 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
270 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
272 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
274 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
277 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
278 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
281 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
283 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
285 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
287 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
289 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
291 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
293 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
296 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
297 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
300 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
301 between 0 and 100 for PTILE.
303 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
306 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
309 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
312 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
315 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
317 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
320 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
323 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
324 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
326 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
327 LABEL, POSITION, or EMPTY.
329 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
330 integer for SUBTOTAL.
332 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
334 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
336 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
338 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
340 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
342 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
344 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
346 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
348 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
350 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
352 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
354 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
356 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
357 the previous definition.
358 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
359 | ^~~~~~~~~~~~~~~~~~~
361 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
362 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
363 | ^~~~~~~~~~~~~~~~~~~
365 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
368 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
369 Expecting summary function name.
371 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
372 between 0 and 100 for PTILE.
374 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
376 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
379 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
380 FORMAT, or HIDESOURCECATS.
382 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
384 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
386 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
387 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
389 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
392 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
395 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
397 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
400 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
401 DEFAULT, NAME, LABEL, BOTH, or NONE.
403 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
406 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
409 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
410 VARIABLE or LISTWISE.
412 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
415 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
417 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
418 greater for HIDESMALLCOUNTS COUNT.
420 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
421 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
422 HIDESMALLCOUNTS, or TABLE.
424 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
427 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
429 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
432 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
435 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
438 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
441 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
444 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
445 ROWLABELS, or COLLABELS.
447 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
450 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
451 in @<:@0,100@:}@ for CILEVEL.
453 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
454 CAPTION, CORNER, or TITLE.
456 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
459 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
460 in @<:@0,1@:}@ for ALPHA.
462 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
465 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
466 ALLVISIBLE or SUBTOTALS.
468 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
469 ALPHA, INCLUDEMRSETS, or CATEGORIES.
471 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
474 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
477 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
480 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
481 BONFERRONI, BH, or NONE.
483 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
486 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
489 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
490 ALLVISIBLE or SUBTOTALS.
492 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
495 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
498 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
501 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
502 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
505 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
506 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
508 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
511 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
512 97 | CTABLES /TABLE qn20 > qnd1.
515 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
516 97 | CTABLES /TABLE qn20 > qnd1.
519 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
520 97 | CTABLES /TABLE qn20 > qnd1.
523 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
524 categorical variables at the innermost nesting level.
525 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
526 | ^~~~~~~~~~~~~~~~~~~~
528 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
530 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
533 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
534 specification as format DATETIME: Day (123) must be between 1 and 31..
535 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
540 AT_SETUP([CTABLES parsing - more negative])
541 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
542 AT_DATA([ctables.sps],
544 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
545 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
546 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
549 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
550 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
552 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
554 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
555 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
556 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
557 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
559 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
560 CTABLES /PCOMPUTE &x=EXPR([**]).
561 CTABLES /PCOMPUTE &x=EXPR(**).
565 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
567 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
568 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
569 category not included in the category list.
570 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
575 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
576 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
580 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
581 list of categories here.
582 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
587 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
588 category not included in the category list.
589 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
594 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
595 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
599 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
600 variable's CATEGORIES specification.
602 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
603 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
604 subtotals by position, e.g. SUBTOTAL[1].
605 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
606 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
608 ^~~~~~~~~~~~~~~~~~~~~~~~
610 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
612 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
613 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
616 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
617 applied only to string variables, but this subcommand tries to apply it to
618 numeric variable QN1.
619 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
622 ctables.sps:8.53: error: CTABLES: This category specification may be applied
623 only to numeric variables, but this subcommand tries to apply it to string
625 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
628 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
629 based on a summary function.
631 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
632 moved to be categorical, but qnd1 is a scale variable.
634 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
635 moved to have the same width, but QN1 has width 0 and string has width 8.
637 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
638 moved to have the same value labels, but QN1 and QNSA1 have different value
641 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
642 moved to have the same category specifications, but QN105BA and QN105BB have
643 different category specifications.
645 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
646 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
647 this warning, insert parentheses.
648 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
651 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
654 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
656 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
658 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
659 variable must be specified.
661 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
663 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
665 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
668 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
670 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
673 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
675 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
680 AT_SETUP([CTABLES one categorical variable])
681 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
682 AT_DATA([ctables.sps],
685 CTABLES /TABLE BY qn1.
686 CTABLES /TABLE BY BY qn1.
688 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
690 ╭────────────────────────────────────────────────────────────────────────┬─────╮
692 ├────────────────────────────────────────────────────────────────────────┼─────┤
693 │ 1. How often do you usually drive a car or other Every day │ 4667│
694 │motor vehicle? Several days a week │ 1274│
695 │ Once a week or less │ 361│
696 │ Only certain times a │ 130│
699 ╰────────────────────────────────────────────────────────────────────────┴─────╯
702 ╭──────────────────────────────────────────────────────────────────────────────╮
703 │ 1. How often do you usually drive a car or other motor vehicle? │
704 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
705 │ │ Several days a │ Once a week or │ Only certain times a │ │
706 │Every day│ week │ less │ year │Never│
707 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
708 │ Count │ Count │ Count │ Count │Count│
709 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
710 │ 4667│ 1274│ 361│ 130│ 540│
711 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
723 AT_SETUP([CTABLES one string variable])
724 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
725 AT_DATA([ctables.sps],
728 MISSING VALUES licensed('DontKnow', 'Refused').
729 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
730 CTABLES /TABLE licensed.
731 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
732 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
733 * Notice that the string matching is case-sensitive.
734 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
735 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
737 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
738 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
740 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
742 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
743 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
745 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
747 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
757 ╭─────────────────┬─────┬───────╮
759 ├─────────────────┼─────┼───────┤
760 │licensed DontKnow│ 4│ │
764 │ Total │ 6999│ 6951│
765 ╰─────────────────┴─────┴───────╯
768 ╭──────────────┬─────╮
770 ├──────────────┼─────┤
771 │licensed Yes │ 6379│
774 ╰──────────────┴─────╯
777 ╭──────────────┬─────╮
779 ├──────────────┼─────┤
780 │licensed Yes │ 6379│
783 ╰──────────────┴─────╯
786 ╭────────────────┬─────╮
788 ├────────────────┼─────┤
793 ╰────────────────┴─────╯
796 ╭────────────────┬─────╮
798 ├────────────────┼─────┤
799 │licensed Yes │ 6379│
801 ╰────────────────┴─────╯
804 ╭────────────────┬─────╮
806 ├────────────────┼─────┤
807 │licensed Yes │ 6379│
809 ╰────────────────┴─────╯
813 AT_SETUP([CTABLES one scale variable])
814 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
815 AT_DATA([ctables.sps],
817 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
818 CTABLES /TABLE BY qnd1.
819 CTABLES /TABLE BY BY qnd1.
821 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
823 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
824 │ │ │ │ │ │ Std │ │ │
825 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
826 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
827 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
828 │age? │ │ │ │ │ │ │ │
829 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
832 ╭──────────────────────────╮
833 │D1. AGE: What is your age?│
834 ├──────────────────────────┤
836 ├──────────────────────────┤
838 ╰──────────────────────────╯
841 D1. AGE: What is your age?
850 AT_SETUP([CTABLES simple stacking])
851 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
852 AT_DATA([ctables.sps],
854 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
856 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
858 ╭───────────────────────────────────────────────────────────────┬──────────────╮
865 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
866 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
867 │too much to drink to drive safely will A. Get certain │ │ │
868 │stopped by the police? Very likely │ 21%│ 22%│
869 │ Somewhat │ 38%│ 42%│
871 │ Somewhat │ 21%│ 18%│
875 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
876 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
877 │too much to drink to drive safely will B. Have an certain │ │ │
878 │accident? Very likely │ 36%│ 45%│
879 │ Somewhat │ 39%│ 32%│
885 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
886 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
887 │too much to drink to drive safely will C. Be certain │ │ │
888 │convicted for drunk driving? Very likely │ 32%│ 28%│
889 │ Somewhat │ 27%│ 32%│
891 │ Somewhat │ 15%│ 15%│
895 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
896 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
897 │too much to drink to drive safely will D. Be certain │ │ │
898 │arrested for drunk driving? Very likely │ 26%│ 27%│
899 │ Somewhat │ 32%│ 35%│
901 │ Somewhat │ 17%│ 15%│
905 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
909 AT_SETUP([CTABLES show or hide empty categories])
910 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
911 AT_DATA([ctables.sps],
913 IF (qn105ba = 2) qn105ba = 1.
914 IF (qns3a = 1) qns3a = 2.
915 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
916 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
917 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
918 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
919 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
920 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
921 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
923 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
925 ╭──────────────────────────────────────────────────────────────┬───────────────╮
932 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
933 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
934 │too much to drink to drive safely will A. Get certain │ │ │
935 │stopped by the police? Very likely│ .│ 0%│
942 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
945 ╭──────────────────────────────────────────────────────────────┬───────────────╮
952 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
953 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
954 │too much to drink to drive safely will A. Get certain │ │ │
955 │stopped by the police? Somewhat │ .│ 40%│
961 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
964 ╭────────────────────────────────────────────────────────────────────┬─────────╮
971 ├────────────────────────────────────────────────────────────────────┼─────────┤
972 │105b. How likely is it that drivers who have had too Almost │ 32%│
973 │much to drink to drive safely will A. Get stopped by certain │ │
974 │the police? Very likely │ 0%│
981 ╰────────────────────────────────────────────────────────────────────┴─────────╯
984 ╭────────────────────────────────────────────────────────────────────┬─────────╮
991 ├────────────────────────────────────────────────────────────────────┼─────────┤
992 │105b. How likely is it that drivers who have had too Almost │ 32%│
993 │much to drink to drive safely will A. Get stopped by certain │ │
994 │the police? Somewhat │ 40%│
1000 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1004 AT_SETUP([CTABLES simple nesting])
1005 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1006 AT_DATA([ctables.sps],
1008 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1009 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1010 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1011 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1012 /CLABELS ROW=OPPOSITE.
1014 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1016 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1019 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1020 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1021 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1022 │drive safely will A. Get stopped by Total │ 700│ 10%│
1023 │the police? ╶──────────────────────────┼─────┼──────┤
1024 │ Very S3a. Male │ 660│ 10%│
1025 │ likely GENDER: Female│ 842│ 12%│
1026 │ Total │ 1502│ 22%│
1027 │ ╶──────────────────────────┼─────┼──────┤
1028 │ Somewhat S3a. Male │ 1174│ 17%│
1029 │ likely GENDER: Female│ 1589│ 23%│
1030 │ Total │ 2763│ 40%│
1031 │ ╶──────────────────────────┼─────┼──────┤
1032 │ Somewhat S3a. Male │ 640│ 9%│
1033 │ unlikely GENDER: Female│ 667│ 10%│
1034 │ Total │ 1307│ 19%│
1035 │ ╶──────────────────────────┼─────┼──────┤
1036 │ Very S3a. Male │ 311│ 5%│
1037 │ unlikely GENDER: Female│ 298│ 4%│
1039 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1040 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1041 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1042 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1043 │ ╶──────────────────────────┼─────┼──────┤
1044 │ Very S3a. Male │ 1104│ 16%│
1045 │ likely GENDER: Female│ 1715│ 25%│
1046 │ Total │ 2819│ 41%│
1047 │ ╶──────────────────────────┼─────┼──────┤
1048 │ Somewhat S3a. Male │ 1203│ 17%│
1049 │ likely GENDER: Female│ 1214│ 18%│
1050 │ Total │ 2417│ 35%│
1051 │ ╶──────────────────────────┼─────┼──────┤
1052 │ Somewhat S3a. Male │ 262│ 4%│
1053 │ unlikely GENDER: Female│ 168│ 2%│
1055 │ ╶──────────────────────────┼─────┼──────┤
1056 │ Very S3a. Male │ 81│ 1%│
1057 │ unlikely GENDER: Female│ 59│ 1%│
1059 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1060 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1061 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1062 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1063 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1064 │ Very S3a. Male │ 988│ 14%│
1065 │ likely GENDER: Female│ 1049│ 15%│
1066 │ Total │ 2037│ 30%│
1067 │ ╶──────────────────────────┼─────┼──────┤
1068 │ Somewhat S3a. Male │ 822│ 12%│
1069 │ likely GENDER: Female│ 1210│ 18%│
1070 │ Total │ 2032│ 30%│
1071 │ ╶──────────────────────────┼─────┼──────┤
1072 │ Somewhat S3a. Male │ 446│ 7%│
1073 │ unlikely GENDER: Female│ 548│ 8%│
1075 │ ╶──────────────────────────┼─────┼──────┤
1076 │ Very S3a. Male │ 268│ 4%│
1077 │ unlikely GENDER: Female│ 354│ 5%│
1079 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1080 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1081 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1082 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1083 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1084 │ Very S3a. Male │ 805│ 12%│
1085 │ likely GENDER: Female│ 1029│ 15%│
1086 │ Total │ 1834│ 27%│
1087 │ ╶──────────────────────────┼─────┼──────┤
1088 │ Somewhat S3a. Male │ 975│ 14%│
1089 │ likely GENDER: Female│ 1332│ 19%│
1090 │ Total │ 2307│ 34%│
1091 │ ╶──────────────────────────┼─────┼──────┤
1092 │ Somewhat S3a. Male │ 535│ 8%│
1093 │ unlikely GENDER: Female│ 560│ 8%│
1094 │ Total │ 1095│ 16%│
1095 │ ╶──────────────────────────┼─────┼──────┤
1096 │ Very S3a. Male │ 270│ 4%│
1097 │ unlikely GENDER: Female│ 279│ 4%│
1099 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1102 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1103 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1104 │ │ certain│likely│ likely │ unlikely│unlikely│
1105 │ ├────────┼──────┼─────────┼─────────┼────────┤
1107 │ │ Table %│ % │ Table % │ Table % │ Table %│
1108 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1109 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1110 │GENDER: is it that drivers│ │ │ │ │ │
1111 │ who have had too │ │ │ │ │ │
1112 │ much to drink to │ │ │ │ │ │
1113 │ drive safely will │ │ │ │ │ │
1114 │ A. Get stopped by │ │ │ │ │ │
1115 │ the police? │ │ │ │ │ │
1116 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1117 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1118 │ is it that drivers│ │ │ │ │ │
1119 │ who have had too │ │ │ │ │ │
1120 │ much to drink to │ │ │ │ │ │
1121 │ drive safely will │ │ │ │ │ │
1122 │ A. Get stopped by │ │ │ │ │ │
1123 │ the police? │ │ │ │ │ │
1124 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1125 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1126 │ is it that drivers│ │ │ │ │ │
1127 │ who have had too │ │ │ │ │ │
1128 │ much to drink to │ │ │ │ │ │
1129 │ drive safely will │ │ │ │ │ │
1130 │ A. Get stopped by │ │ │ │ │ │
1131 │ the police? │ │ │ │ │ │
1132 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1133 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1134 │GENDER: is it that drivers│ │ │ │ │ │
1135 │ who have had too │ │ │ │ │ │
1136 │ much to drink to │ │ │ │ │ │
1137 │ drive safely will │ │ │ │ │ │
1138 │ B. Have an │ │ │ │ │ │
1139 │ accident? │ │ │ │ │ │
1140 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1141 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1142 │ is it that drivers│ │ │ │ │ │
1143 │ who have had too │ │ │ │ │ │
1144 │ much to drink to │ │ │ │ │ │
1145 │ drive safely will │ │ │ │ │ │
1146 │ B. Have an │ │ │ │ │ │
1147 │ accident? │ │ │ │ │ │
1148 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1149 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1150 │ is it that drivers│ │ │ │ │ │
1151 │ who have had too │ │ │ │ │ │
1152 │ much to drink to │ │ │ │ │ │
1153 │ drive safely will │ │ │ │ │ │
1154 │ B. Have an │ │ │ │ │ │
1155 │ accident? │ │ │ │ │ │
1156 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1157 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1158 │GENDER: is it that drivers│ │ │ │ │ │
1159 │ who have had too │ │ │ │ │ │
1160 │ much to drink to │ │ │ │ │ │
1161 │ drive safely will │ │ │ │ │ │
1162 │ C. Be convicted │ │ │ │ │ │
1163 │ for drunk driving?│ │ │ │ │ │
1164 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1165 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1166 │ is it that drivers│ │ │ │ │ │
1167 │ who have had too │ │ │ │ │ │
1168 │ much to drink to │ │ │ │ │ │
1169 │ drive safely will │ │ │ │ │ │
1170 │ C. Be convicted │ │ │ │ │ │
1171 │ for drunk driving?│ │ │ │ │ │
1172 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1173 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1174 │ is it that drivers│ │ │ │ │ │
1175 │ who have had too │ │ │ │ │ │
1176 │ much to drink to │ │ │ │ │ │
1177 │ drive safely will │ │ │ │ │ │
1178 │ C. Be convicted │ │ │ │ │ │
1179 │ for drunk driving?│ │ │ │ │ │
1180 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1181 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1182 │GENDER: is it that drivers│ │ │ │ │ │
1183 │ who have had too │ │ │ │ │ │
1184 │ much to drink to │ │ │ │ │ │
1185 │ drive safely will │ │ │ │ │ │
1186 │ D. Be arrested for│ │ │ │ │ │
1187 │ drunk driving? │ │ │ │ │ │
1188 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1189 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1190 │ is it that drivers│ │ │ │ │ │
1191 │ who have had too │ │ │ │ │ │
1192 │ much to drink to │ │ │ │ │ │
1193 │ drive safely will │ │ │ │ │ │
1194 │ D. Be arrested for│ │ │ │ │ │
1195 │ drunk driving? │ │ │ │ │ │
1196 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1197 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1198 │ is it that drivers│ │ │ │ │ │
1199 │ who have had too │ │ │ │ │ │
1200 │ much to drink to │ │ │ │ │ │
1201 │ drive safely will │ │ │ │ │ │
1202 │ D. Be arrested for│ │ │ │ │ │
1203 │ drunk driving? │ │ │ │ │ │
1204 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1208 AT_SETUP([CTABLES nesting and scale variables])
1209 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1210 AT_DATA([ctables.sps],
1212 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1213 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1214 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1215 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1216 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1218 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1220 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1226 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1227 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1228 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1230 │ Once a week or │ 44│ 54│
1232 │ Only certain │ 34│ 41│
1233 │ times a year │ │ │
1235 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1238 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1239 │ │Minimum│Maximum│Mean│
1240 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1241 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1242 │What is GENDER: months, has there been a │ │ │ │
1243 │your time when you felt you │ │ │ │
1244 │age? should cut down on your No │ 16│ 86│ 46│
1246 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1247 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1248 │ months, has there been a │ │ │ │
1249 │ time when you felt you │ │ │ │
1250 │ should cut down on your No │ 16│ 86│ 48│
1252 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1253 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1254 │What is GENDER: months, has there been a │ │ │ │
1255 │your time when people criticized No │ 16│ 86│ 46│
1256 │age? your drinking? │ │ │ │
1257 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1258 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1259 │ months, has there been a │ │ │ │
1260 │ time when people criticized No │ 16│ 86│ 48│
1261 │ your drinking? │ │ │ │
1262 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1265 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1266 │ │S1. Including yourself, how many members of this│
1267 │ │ household are age 16 or older? │
1268 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1269 │ │ │ │ │ │ │ │ 6 or │
1270 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1271 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1272 │ │Column│Column│Column│Column│Column│Column│Column│
1273 │ │ % │ % │ % │ % │ % │ % │ % │
1274 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1275 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1276 │SAMPLE How certain │ │ │ │ │ │ │ │
1277 │SOURCE: likely │ │ │ │ │ │ │ │
1278 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1279 │ that likely │ │ │ │ │ │ │ │
1280 │ drivers │ │ │ │ │ │ │ │
1281 │ who have │ │ │ │ │ │ │ │
1282 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1283 │ much to likely │ │ │ │ │ │ │ │
1284 │ drink to │ │ │ │ │ │ │ │
1285 │ drive │ │ │ │ │ │ │ │
1286 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1287 │ will A. unlikely│ │ │ │ │ │ │ │
1288 │ Get │ │ │ │ │ │ │ │
1289 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1290 │ by the unlikely│ │ │ │ │ │ │ │
1291 │ police? │ │ │ │ │ │ │ │
1292 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1295 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1298 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1299 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1300 │group typical month did you have one or more │ │ │
1301 │ alcoholic beverages to drink? │ │ │
1302 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1303 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1304 │ typical month did you have one or more │ │ │
1305 │ alcoholic beverages to drink? │ │ │
1306 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1307 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1308 │ typical month did you have one or more │ │ │
1309 │ alcoholic beverages to drink? │ │ │
1310 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1311 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1312 │ typical month did you have one or more │ │ │
1313 │ alcoholic beverages to drink? │ │ │
1314 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1315 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1316 │ typical month did you have one or more │ │ │
1317 │ alcoholic beverages to drink? │ │ │
1318 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1319 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1320 │ older typical month did you have one or more │ │ │
1321 │ alcoholic beverages to drink? │ │ │
1322 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1327 AT_SETUP([CTABLES SLABELS])
1328 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1329 AT_DATA([ctables.sps],
1331 CTABLES /TABLE qn1 [COUNT COLPCT].
1332 CTABLES /TABLE qn1 [COUNT COLPCT]
1333 /SLABELS POSITION=ROW.
1334 CTABLES /TABLE qn1 [COUNT COLPCT]
1335 /SLABELS POSITION=ROW VISIBLE=NO.
1337 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1339 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1342 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1343 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1344 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1345 │ Once a week or less│ 361│ 5.2%│
1346 │ Only certain times │ 130│ 1.9%│
1348 │ Never │ 540│ 7.7%│
1349 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1352 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1353 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1354 │other motor vehicle? Column │66.9%│
1356 │ ╶───────────────────────────┼─────┤
1357 │ Several days a week Count │ 1274│
1360 │ ╶───────────────────────────┼─────┤
1361 │ Once a week or less Count │ 361│
1364 │ ╶───────────────────────────┼─────┤
1365 │ Only certain times Count │ 130│
1366 │ a year Column │ 1.9%│
1368 │ ╶───────────────────────────┼─────┤
1369 │ Never Count │ 540│
1372 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1375 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1376 │ 1. How often do you usually drive a car or other Every day │ 4667│
1377 │motor vehicle? │66.9%│
1378 │ Several days a week │ 1274│
1380 │ Once a week or less │ 361│
1382 │ Only certain times a │ 130│
1386 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1390 AT_SETUP([CTABLES simple totals])
1391 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1392 AT_DATA([ctables.sps],
1395 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1396 DESCRIPTIVES qn18/STATISTICS=MEAN.
1397 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1398 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1400 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1402 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1404 ├────────────────────────────────────────────────────────────────────────┼─────┤
1405 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1406 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1409 │ Wine coolers │ 137│
1410 │ Hard liquor or │ 888│
1412 │ Flavored malt │ 83│
1414 │ Number responding │ 4221│
1415 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1417 Descriptive Statistics
1418 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1420 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1421 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1422 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1423 │Valid N (listwise) │6999│ │
1424 │Missing N (listwise) │2781│ │
1425 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1428 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1429 │ │ │ │ Valid│Total│
1430 │ │Mean│Count│ N │ N │
1431 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1432 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1433 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1434 │ you usually drink per sitting? │ │ │ │ │
1435 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1436 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1437 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1438 │ you usually drink per sitting? │ │ │ │ │
1439 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1440 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1441 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1442 │ you usually drink per sitting? │ │ │ │ │
1443 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1444 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1445 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1446 │ you usually drink per sitting? │ │ │ │ │
1447 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1448 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1449 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1450 │ you usually drink per sitting? │ │ │ │ │
1451 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1455 AT_SETUP([CTABLES subtotals])
1456 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1457 AT_DATA([ctables.sps],
1459 CTABLES /TABLE=qn105ba BY qns1
1460 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1461 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1462 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1463 CTABLES /TABLE=qn105ba BY qns1
1464 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1465 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1467 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1469 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1470 │ │ S1. Including yourself, how many members of this household │
1471 │ │ are age 16 or older? │
1472 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1473 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1474 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1475 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1476 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1477 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1478 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1479 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1480 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1481 │ likely │ │ │ │ │ │ │ │
1482 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1483 │ unlikely │ │ │ │ │ │ │ │
1484 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1485 │ unlikely │ │ │ │ │ │ │ │
1486 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1489 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1490 │ │ S1. Including yourself, how many members of this household │
1491 │ │ are age 16 or older? │
1492 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1493 │ │ │ │ │ │ │ │ 6 or │
1494 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1495 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1496 │ │ │ │ │ │ Column│ │ │
1497 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1498 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1499 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1500 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1501 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1502 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1503 │ likely │ │ │ │ │ │ │ │
1504 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1505 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1506 │ unlikely │ │ │ │ │ │ │ │
1507 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1508 │ unlikely │ │ │ │ │ │ │ │
1509 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1510 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1513 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1514 │ │ S1. Including yourself, how many members of this household │
1515 │ │ are age 16 or older? │
1516 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1517 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1518 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1519 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1520 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1521 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1522 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1523 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1524 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1525 │ likely │ │ │ │ │ │ │ │
1526 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1527 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1528 │ unlikely │ │ │ │ │ │ │ │
1529 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1530 │ unlikely │ │ │ │ │ │ │ │
1531 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1532 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1536 AT_SETUP([CTABLES PCOMPUTE])
1537 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1538 AT_DATA([ctables.sps],
1541 /PCOMPUTE &x=EXPR([3] + [4])
1542 /PCOMPUTE &y=EXPR([4] + [5])
1543 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1544 /PPROPERTIES &y LABEL='4+5'
1545 /TABLE=qn105ba BY qns1
1546 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1548 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1550 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1551 │ │ S1. Including yourself, how many members of this household │
1552 │ │ are age 16 or older? │
1553 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1554 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1555 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1556 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1557 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1558 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1559 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1560 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1561 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1562 │ likely │ │ │ │ │ │ │ │
1563 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1564 │ unlikely │ │ │ │ │ │ │ │
1565 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1566 │ unlikely │ │ │ │ │ │ │ │
1567 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1571 AT_SETUP([CTABLES CLABELS])
1572 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1573 AT_DATA([ctables.sps],
1575 CTABLES /TABLE AgeGroup BY qns3a.
1576 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1577 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1578 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1579 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1582 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1584 ╭───────────────────────┬────────────╮
1590 ├───────────────────────┼─────┼──────┤
1591 │Age group 15 or younger│ 0│ 0│
1592 │ 16 to 25 │ 594│ 505│
1593 │ 26 to 35 │ 476│ 491│
1594 │ 36 to 45 │ 489│ 548│
1595 │ 46 to 55 │ 526│ 649│
1596 │ 56 to 65 │ 516│ 731│
1597 │ 66 or older │ 531│ 943│
1598 ╰───────────────────────┴─────┴──────╯
1601 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1603 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1605 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1606 │ │ 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 │
1607 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1608 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1609 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1610 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1611 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1612 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1613 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1616 ╭──────────────────────────────┬────────────╮
1620 ├──────────────────────────────┼────────────┤
1621 │Age group 15 or younger Male │ 0│
1623 │ ╶────────────────────┼────────────┤
1624 │ 16 to 25 Male │ 594│
1626 │ ╶────────────────────┼────────────┤
1627 │ 26 to 35 Male │ 476│
1629 │ ╶────────────────────┼────────────┤
1630 │ 36 to 45 Male │ 489│
1632 │ ╶────────────────────┼────────────┤
1633 │ 46 to 55 Male │ 526│
1635 │ ╶────────────────────┼────────────┤
1636 │ 56 to 65 Male │ 516│
1638 │ ╶────────────────────┼────────────┤
1639 │ 66 or older Male │ 531│
1641 ╰──────────────────────────────┴────────────╯
1645 ╭─────────┬────────────╮
1651 ├─────────┼─────┼──────┤
1653 ╰─────────┴─────┴──────╯
1657 ╭─────────┬────────────╮
1663 ├─────────┼─────┼──────┤
1664 │Age group│ 594│ 505│
1665 ╰─────────┴─────┴──────╯
1669 ╭─────────┬────────────╮
1675 ├─────────┼─────┼──────┤
1676 │Age group│ 476│ 491│
1677 ╰─────────┴─────┴──────╯
1681 ╭─────────┬────────────╮
1687 ├─────────┼─────┼──────┤
1688 │Age group│ 489│ 548│
1689 ╰─────────┴─────┴──────╯
1693 ╭─────────┬────────────╮
1699 ├─────────┼─────┼──────┤
1700 │Age group│ 526│ 649│
1701 ╰─────────┴─────┴──────╯
1705 ╭─────────┬────────────╮
1711 ├─────────┼─────┼──────┤
1712 │Age group│ 516│ 731│
1713 ╰─────────┴─────┴──────╯
1717 ╭─────────┬────────────╮
1723 ├─────────┼─────┼──────┤
1724 │Age group│ 531│ 943│
1725 ╰─────────┴─────┴──────╯
1729 ╭───────────────────────┬────────────╮
1733 ├───────────────────────┼────────────┤
1734 │Age group 15 or younger│ 0│
1740 │ 66 or older │ 531│
1741 ╰───────────────────────┴────────────╯
1745 ╭───────────────────────┬────────────╮
1749 ├───────────────────────┼────────────┤
1750 │Age group 15 or younger│ 0│
1756 │ 66 or older │ 943│
1757 ╰───────────────────────┴────────────╯
1761 AT_SETUP([CTABLES missing values])
1762 AT_DATA([ctables.sps],
1763 [[DATA LIST LIST NOTABLE/x y.
1802 MISSING VALUES x (1, 2) y (2, 3).
1803 VARIABLE LEVEL ALL (NOMINAL).
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.
1808 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1809 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1810 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1811 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1812 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1813 /CATEGORIES VARIABLES=ALL TOTAL=YES
1814 /SLABELS POSITION=ROW.
1815 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1816 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1817 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1818 /SLABELS POSITION=ROW.
1819 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1820 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1821 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1822 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1823 /SLABELS POSITION=ROW.
1825 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1827 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1828 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1829 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1830 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1831 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1832 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1833 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1834 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1835 dnl Note that Column Total N % doesn't add up to 100 because missing
1836 dnl values are included in the total but not shown as a category and this
1837 dnl is expected behavior.
1840 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1841 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1842 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1843 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1844 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1845 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1846 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1847 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1848 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1849 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1850 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1851 dnl values are included in the total but not shown as a category and this
1852 dnl is expected behavior.
1855 ╭────────────────────────┬───────────────────────────╮
1857 │ ├──────┬──────┬──────┬──────┤
1858 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1859 ├────────────────────────┼──────┼──────┼──────┼──────┤
1860 │x 3.00 Count │ 1│ 1│ 1│ 3│
1861 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1862 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1863 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1864 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1865 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1866 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1867 │ Valid N │ │ │ │ 3│
1868 │ Total N │ │ │ │ 6│
1869 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1870 │ 4.00 Count │ 1│ 1│ 1│ 3│
1871 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1872 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1873 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1874 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1875 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1876 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1877 │ Valid N │ │ │ │ 3│
1878 │ Total N │ │ │ │ 6│
1879 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1880 │ 5.00 Count │ 1│ 1│ 1│ 3│
1881 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1882 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1883 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1884 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1885 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1886 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1887 │ Valid N │ │ │ │ 3│
1888 │ Total N │ │ │ │ 6│
1889 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1890 │ Total Count │ 3│ 3│ 3│ 9│
1891 │ Column % │100.0%│100.0%│100.0%│ .│
1892 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1893 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1894 │ Row % │ .│ .│ .│ .│
1895 │ Row Valid N % │ .│ .│ .│ .│
1896 │ Row Total N % │ .│ .│ .│ .│
1897 │ Valid N │ 3│ 3│ 3│ 9│
1898 │ Total N │ 6│ 6│ 6│ 36│
1899 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1902 ╭────────────────────────┬─────────────────────────────────────────╮
1904 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1905 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1906 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1907 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1908 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1909 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1910 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1911 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1912 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1913 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1914 │ Valid N │ │ │ │ │ │ 0│
1915 │ Total N │ │ │ │ │ │ 6│
1916 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1917 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1918 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1919 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1920 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1921 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1922 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1923 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1924 │ Valid N │ │ │ │ │ │ 0│
1925 │ Total N │ │ │ │ │ │ 6│
1926 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1927 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1928 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1929 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1930 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1931 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1932 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1933 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1934 │ Valid N │ │ │ │ │ │ 3│
1935 │ Total N │ │ │ │ │ │ 6│
1936 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1937 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1938 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1939 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1940 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1941 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1942 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1943 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1944 │ Valid N │ │ │ │ │ │ 3│
1945 │ Total N │ │ │ │ │ │ 6│
1946 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1947 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1948 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1949 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1950 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1951 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1952 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1953 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1954 │ Valid N │ │ │ │ │ │ 3│
1955 │ Total N │ │ │ │ │ │ 6│
1956 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1957 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1958 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1959 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1960 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1961 │ Row % │ .│ .│ .│ .│ .│ .│
1962 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1963 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1964 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1965 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1966 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1969 ╭────────────────────────┬──────────────────────────────────╮
1971 │ ├──────┬──────┬──────┬──────┬──────┤
1972 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1973 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1974 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1975 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1976 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1977 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1978 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1979 │ Row Valid N % │ .│ .│ .│ .│ .│
1980 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1981 │ Valid N │ │ │ │ │ 0│
1982 │ Total N │ │ │ │ │ 6│
1983 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1984 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1985 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1986 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1987 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1988 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1989 │ Row Valid N % │ .│ .│ .│ .│ .│
1990 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1991 │ Valid N │ │ │ │ │ 0│
1992 │ Total N │ │ │ │ │ 6│
1993 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1994 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1995 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1996 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1997 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1998 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1999 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2000 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2001 │ Valid N │ │ │ │ │ 3│
2002 │ Total N │ │ │ │ │ 6│
2003 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2004 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2005 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2006 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2007 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2008 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2009 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2010 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2011 │ Valid N │ │ │ │ │ 3│
2012 │ Total N │ │ │ │ │ 6│
2013 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2014 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2015 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2016 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2017 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2018 │ Row % │ .│ .│ .│ .│ .│
2019 │ Row Valid N % │ .│ .│ .│ .│ .│
2020 │ Row Total N % │ .│ .│ .│ .│ .│
2021 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2022 │ Total N │ 5│ 5│ 5│ 5│ 30│
2023 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2027 AT_SETUP([CTABLES SMISSING=LISTWISE])
2028 AT_KEYWORDS([SMISSING LISTWISE])
2029 AT_DATA([ctables.sps],
2030 [[DATA LIST LIST NOTABLE/x y z.
2038 VARIABLE LEVEL x (NOMINAL).
2040 CTABLES /TABLE (y + z) > x.
2041 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2043 * The following doesn't come out as listwise because the tables are
2044 separate, not linked by an > operator.
2045 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2047 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl