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.
22 dnl - HIDESMALLCOUNTS.
23 dnl - Date/time variables and values
24 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
25 dnl - TITLES: )DATE, )TIME, )TABLE.
27 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
28 dnl * MISSING, OTHERNM
29 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
33 dnl - Summary functions:
34 dnl * U-prefix for unweighted summaries.
35 dnl * areaPCT.SUM and UareaPCT.SUM functions.
36 dnl - SPLIT FILE with SEPARATE splits
37 dnl - Definition of columns/rows when labels are rotated from one axis to another.
40 dnl - Multiple response sets
41 dnl - MRSETS subcommand.
42 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
45 dnl - Summary functions:
46 dnl * .LCL and .UCL suffixes.
49 dnl * Data-dependent sorting.
51 AT_SETUP([CTABLES parsing])
52 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
53 AT_DATA([ctables.sps],
56 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
57 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
58 /FORMAT UNITS=CM EMPTY="(-)"
59 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
60 /VLABELS VARIABLES=qn17 DISPLAY=NAME
61 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
62 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
63 /VLABELS VARIABLES=qn20 DISPLAY=NONE
64 /MRSETS COUNTDUPLICATES=NO
65 /MRSETS COUNTDUPLICATES=YES
68 /WEIGHT VARIABLE=qns3a
70 /HIDESMALLCOUNTS COUNT=10
72 /SLABELS POSITION=COLUMN VISIBLE=YES
73 /SLABELS VISIBLE=NO POSITION=ROW
74 /SLABELS POSITION=LAYER
76 /CLABELS ROWLABELS=OPPOSITE
78 /CATEGORIES VARIABLES=qn1 qn17
79 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
80 POSITION=BEFORE EMPTY=INCLUDE.
81 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
82 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
83 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
85 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
88 ╭───────────────────┬────┬────╮
90 ├───────────────────┼────┼────┤
91 │Sa1. SAMPLE SOURCE:│5392│1607│
92 ╰───────────────────┴────┴────╯
96 ╭───────────────────┬─────╮
98 ├───────────────────┼─────┤
99 │Sa1. SAMPLE SOURCE:│ 5392│
100 ╰───────────────────┴─────╯
103 ╭────────────────────────┬─────╮
105 ├────────────────────────┼─────┤
106 │Sa1. SAMPLE SOURCE: RDD │ 5392│
108 ╰────────────────────────┴─────╯
111 ╭────────────────────────┬─────╮
113 ├────────────────────────┼─────┤
114 │Sa1. SAMPLE SOURCE: RDD │ 5392│
116 ╰────────────────────────┴─────╯
120 AT_SETUP([CTABLES parsing - negative])
121 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
122 AT_DATA([ctables.sps],
125 CTABLES /FORMAT MINCOLWIDTH='foo'.
126 CTABLES /TABLE qn1 [**].
127 CTABLES /TABLE qn1 [NOTAFUNCTION].
130 CTABLES /TABLE NOTAVAR.
132 CTABLES /TABLE string[S].
133 CTABLES /TABLE qn1 [PTILE 101].
134 CTABLES /TABLE qn1 [MEAN F0.1].
135 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
136 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
137 CTABLES /TABLE qn1 [MEAN TOTALS].
138 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
155 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
156 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
157 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
158 CTABLES /PCOMPUTE &k=EXPR([LO **]).
159 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
160 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
161 CTABLES /PCOMPUTE &k=EXPR([1**]).
162 CTABLES /PCOMPUTE &k=EXPR((1x)).
163 CTABLES /PCOMPUTE **k.
164 CTABLES /PCOMPUTE &1.
165 CTABLES /PCOMPUTE &k**.
166 CTABLES /PCOMPUTE &k=**.
167 CTABLES /PCOMPUTE &k=EXPR**.
168 CTABLES /PCOMPUTE &k=EXPR(1x).
169 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
170 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
174 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
175 CTABLES /FORMAT EMPTY=**.
176 CTABLES /FORMAT MISSING=**.
178 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
180 CTABLES /VLABELS VARIABLES=NOTAVAR.
181 CTABLES /VLABELS VARIABLES=qn1 **.
182 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
184 CTABLES /MRSETS COUNTDUPLICATES=**.
185 CTABLES /SMISSING **.
187 CTABLES /WEIGHT VARIABLE=NOTAVAR.
188 CTABLES /HIDESMALLCOUNTS COUNT=1.
190 CTABLES /HIDESMALLCOUNTS COUNT=2.
191 CTABLES /TABLE qn1**.
192 CTABLES /TABLE qn1 /SLABELS POSITION=**.
193 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
194 CTABLES /TABLE qn1 /SLABELS **.
195 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
196 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
197 CTABLES /TABLE qn1 /CLABELS **.
198 CTABLES /TABLE qn1 /CRITERIA **.
199 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
200 CTABLES /TABLE qn1 /TITLES **.
201 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
202 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
203 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
204 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
205 CTABLES /TABLE qn1 /SIGTEST **.
206 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
207 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
208 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
209 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
210 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
211 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
212 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
213 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
214 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
215 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
216 CTABLES /TABLE qn1 /COMPARETEST **.
217 CTABLES /TABLE qn1 / **.
218 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
219 CTABLES /TABLE qn20 > qnd1.
220 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
221 NUMERIC datetime (DATETIME17.0).
222 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
224 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
225 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
227 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
228 negative number for MINCOLWIDTH.
230 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
233 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
234 summary function name.
236 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
238 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
241 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
243 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
245 10 | CTABLES /TABLE string[S].
248 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
249 between 0 and 100 for PTILE.
251 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
252 requires a width between 1 and 40.
254 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
255 format NEGPAREN requires width 2 or greater.
257 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
258 format NEGPAREN requires width greater than decimals.
260 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
262 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
265 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
266 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
269 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
271 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
273 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
276 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
277 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
280 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
282 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
284 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
286 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
288 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
290 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
292 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
295 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
296 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
299 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
300 between 0 and 100 for PTILE.
302 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
305 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
308 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
311 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
314 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
316 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
319 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
322 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
323 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
325 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
326 LABEL, POSITION, or EMPTY.
328 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
329 integer for SUBTOTAL.
331 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
333 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
335 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
337 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
339 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
341 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
343 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
345 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
347 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
349 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
351 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
353 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
355 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
356 the previous definition.
357 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
358 | ^~~~~~~~~~~~~~~~~~~
360 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
361 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
362 | ^~~~~~~~~~~~~~~~~~~
364 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
367 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
368 Expecting summary function name.
370 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
371 between 0 and 100 for PTILE.
373 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
375 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
378 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
379 FORMAT, or HIDESOURCECATS.
381 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
383 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
385 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
386 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
388 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
391 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
394 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
396 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
399 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
400 DEFAULT, NAME, LABEL, BOTH, or NONE.
402 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
405 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
408 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
409 VARIABLE or LISTWISE.
411 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
414 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
416 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
417 greater for HIDESMALLCOUNTS COUNT.
419 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
420 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
421 HIDESMALLCOUNTS, or TABLE.
423 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
426 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
428 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
431 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
434 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
437 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
440 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
443 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
444 ROWLABELS, or COLLABELS.
446 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
449 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
450 in @<:@0,100@:}@ for CILEVEL.
452 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
453 CAPTION, CORNER, or TITLE.
455 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
458 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
459 in @<:@0,1@:}@ for ALPHA.
461 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
464 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
465 ALLVISIBLE or SUBTOTALS.
467 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
468 ALPHA, INCLUDEMRSETS, or CATEGORIES.
470 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
473 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
476 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
479 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
480 BONFERRONI, BH, or NONE.
482 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
485 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
488 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
489 ALLVISIBLE or SUBTOTALS.
491 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
494 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
497 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
500 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
501 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
504 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
505 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
507 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
510 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
511 97 | CTABLES /TABLE qn20 > qnd1.
514 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
515 97 | CTABLES /TABLE qn20 > qnd1.
518 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
519 97 | CTABLES /TABLE qn20 > qnd1.
522 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
523 categorical variables at the innermost nesting level.
524 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
525 | ^~~~~~~~~~~~~~~~~~~~
527 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
529 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
532 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
533 specification as format DATETIME: Day (123) must be between 1 and 31..
534 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
539 AT_SETUP([CTABLES parsing - more negative])
540 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
541 AT_DATA([ctables.sps],
543 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
544 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
545 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
548 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
549 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
551 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
553 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
554 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
555 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
556 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
558 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
559 CTABLES /PCOMPUTE &x=EXPR([**]).
560 CTABLES /PCOMPUTE &x=EXPR(**).
564 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
566 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
567 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
568 category not included in the category list.
569 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
574 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
575 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
579 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
580 list of categories here.
581 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
586 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
587 category not included in the category list.
588 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
593 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
594 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
598 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
599 variable's CATEGORIES specification.
601 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
602 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
603 subtotals by position, e.g. SUBTOTAL[1].
604 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
605 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
607 ^~~~~~~~~~~~~~~~~~~~~~~~
609 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
611 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
612 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
615 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
616 applied only to string variables, but this subcommand tries to apply it to
617 numeric variable QN1.
618 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
621 ctables.sps:8.53: error: CTABLES: This category specification may be applied
622 only to numeric variables, but this subcommand tries to apply it to string
624 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
627 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
628 based on a summary function.
630 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
631 moved to be categorical, but qnd1 is a scale variable.
633 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
634 moved to have the same width, but QN1 has width 0 and string has width 8.
636 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
637 moved to have the same value labels, but QN1 and QNSA1 have different value
640 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
641 moved to have the same category specifications, but QN105BA and QN105BB have
642 different category specifications.
644 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
645 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
646 this warning, insert parentheses.
647 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
650 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
653 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
655 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
657 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
658 variable must be specified.
660 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
662 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
664 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
667 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
669 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
672 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
674 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
679 AT_SETUP([CTABLES one categorical variable])
680 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
681 AT_DATA([ctables.sps],
684 CTABLES /TABLE BY qn1.
685 CTABLES /TABLE BY BY qn1.
687 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
689 ╭────────────────────────────────────────────────────────────────────────┬─────╮
691 ├────────────────────────────────────────────────────────────────────────┼─────┤
692 │ 1. How often do you usually drive a car or other Every day │ 4667│
693 │motor vehicle? Several days a week │ 1274│
694 │ Once a week or less │ 361│
695 │ Only certain times a │ 130│
698 ╰────────────────────────────────────────────────────────────────────────┴─────╯
701 ╭──────────────────────────────────────────────────────────────────────────────╮
702 │ 1. How often do you usually drive a car or other motor vehicle? │
703 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
704 │ │ Several days a │ Once a week or │ Only certain times a │ │
705 │Every day│ week │ less │ year │Never│
706 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
707 │ Count │ Count │ Count │ Count │Count│
708 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
709 │ 4667│ 1274│ 361│ 130│ 540│
710 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
722 AT_SETUP([CTABLES one string variable])
723 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
724 AT_DATA([ctables.sps],
727 MISSING VALUES licensed('DontKnow', 'Refused').
728 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
729 CTABLES /TABLE licensed.
730 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
731 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
732 * Notice that the string matching is case-sensitive.
733 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
734 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
736 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
737 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
739 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
741 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
742 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
744 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
746 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
756 ╭─────────────────┬─────┬───────╮
758 ├─────────────────┼─────┼───────┤
759 │licensed DontKnow│ 4│ │
763 │ Total │ 6999│ 6951│
764 ╰─────────────────┴─────┴───────╯
767 ╭──────────────┬─────╮
769 ├──────────────┼─────┤
770 │licensed Yes │ 6379│
773 ╰──────────────┴─────╯
776 ╭──────────────┬─────╮
778 ├──────────────┼─────┤
779 │licensed Yes │ 6379│
782 ╰──────────────┴─────╯
785 ╭────────────────┬─────╮
787 ├────────────────┼─────┤
792 ╰────────────────┴─────╯
795 ╭────────────────┬─────╮
797 ├────────────────┼─────┤
798 │licensed Yes │ 6379│
800 ╰────────────────┴─────╯
803 ╭────────────────┬─────╮
805 ├────────────────┼─────┤
806 │licensed Yes │ 6379│
808 ╰────────────────┴─────╯
812 AT_SETUP([CTABLES one scale variable])
813 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
814 AT_DATA([ctables.sps],
816 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
817 CTABLES /TABLE BY qnd1.
818 CTABLES /TABLE BY BY qnd1.
820 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
822 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
823 │ │ │ │ │ │ Std │ │ │
824 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
825 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
826 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
827 │age? │ │ │ │ │ │ │ │
828 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
831 ╭──────────────────────────╮
832 │D1. AGE: What is your age?│
833 ├──────────────────────────┤
835 ├──────────────────────────┤
837 ╰──────────────────────────╯
840 D1. AGE: What is your age?
849 AT_SETUP([CTABLES simple stacking])
850 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
851 AT_DATA([ctables.sps],
853 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
855 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
857 ╭───────────────────────────────────────────────────────────────┬──────────────╮
864 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
865 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
866 │too much to drink to drive safely will A. Get certain │ │ │
867 │stopped by the police? Very likely │ 21%│ 22%│
868 │ Somewhat │ 38%│ 42%│
870 │ Somewhat │ 21%│ 18%│
874 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
875 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
876 │too much to drink to drive safely will B. Have an certain │ │ │
877 │accident? Very likely │ 36%│ 45%│
878 │ Somewhat │ 39%│ 32%│
884 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
885 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
886 │too much to drink to drive safely will C. Be certain │ │ │
887 │convicted for drunk driving? Very likely │ 32%│ 28%│
888 │ Somewhat │ 27%│ 32%│
890 │ Somewhat │ 15%│ 15%│
894 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
895 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
896 │too much to drink to drive safely will D. Be certain │ │ │
897 │arrested for drunk driving? Very likely │ 26%│ 27%│
898 │ Somewhat │ 32%│ 35%│
900 │ Somewhat │ 17%│ 15%│
904 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
908 AT_SETUP([CTABLES show or hide empty categories])
909 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
910 AT_DATA([ctables.sps],
912 IF (qn105ba = 2) qn105ba = 1.
913 IF (qns3a = 1) qns3a = 2.
914 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
915 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
916 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
917 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
918 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
919 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
920 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
922 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
924 ╭──────────────────────────────────────────────────────────────┬───────────────╮
931 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
932 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
933 │too much to drink to drive safely will A. Get certain │ │ │
934 │stopped by the police? Very likely│ .│ 0%│
941 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
944 ╭──────────────────────────────────────────────────────────────┬───────────────╮
951 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
952 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
953 │too much to drink to drive safely will A. Get certain │ │ │
954 │stopped by the police? Somewhat │ .│ 40%│
960 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
963 ╭────────────────────────────────────────────────────────────────────┬─────────╮
970 ├────────────────────────────────────────────────────────────────────┼─────────┤
971 │105b. How likely is it that drivers who have had too Almost │ 32%│
972 │much to drink to drive safely will A. Get stopped by certain │ │
973 │the police? Very likely │ 0%│
980 ╰────────────────────────────────────────────────────────────────────┴─────────╯
983 ╭────────────────────────────────────────────────────────────────────┬─────────╮
990 ├────────────────────────────────────────────────────────────────────┼─────────┤
991 │105b. How likely is it that drivers who have had too Almost │ 32%│
992 │much to drink to drive safely will A. Get stopped by certain │ │
993 │the police? Somewhat │ 40%│
999 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1003 AT_SETUP([CTABLES simple nesting])
1004 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1005 AT_DATA([ctables.sps],
1007 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1008 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1009 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1010 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1011 /CLABELS ROW=OPPOSITE.
1013 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1015 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1018 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1019 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1020 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1021 │drive safely will A. Get stopped by Total │ 700│ 10%│
1022 │the police? ╶──────────────────────────┼─────┼──────┤
1023 │ Very S3a. Male │ 660│ 10%│
1024 │ likely GENDER: Female│ 842│ 12%│
1025 │ Total │ 1502│ 22%│
1026 │ ╶──────────────────────────┼─────┼──────┤
1027 │ Somewhat S3a. Male │ 1174│ 17%│
1028 │ likely GENDER: Female│ 1589│ 23%│
1029 │ Total │ 2763│ 40%│
1030 │ ╶──────────────────────────┼─────┼──────┤
1031 │ Somewhat S3a. Male │ 640│ 9%│
1032 │ unlikely GENDER: Female│ 667│ 10%│
1033 │ Total │ 1307│ 19%│
1034 │ ╶──────────────────────────┼─────┼──────┤
1035 │ Very S3a. Male │ 311│ 5%│
1036 │ unlikely GENDER: Female│ 298│ 4%│
1038 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1039 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1040 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1041 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1042 │ ╶──────────────────────────┼─────┼──────┤
1043 │ Very S3a. Male │ 1104│ 16%│
1044 │ likely GENDER: Female│ 1715│ 25%│
1045 │ Total │ 2819│ 41%│
1046 │ ╶──────────────────────────┼─────┼──────┤
1047 │ Somewhat S3a. Male │ 1203│ 17%│
1048 │ likely GENDER: Female│ 1214│ 18%│
1049 │ Total │ 2417│ 35%│
1050 │ ╶──────────────────────────┼─────┼──────┤
1051 │ Somewhat S3a. Male │ 262│ 4%│
1052 │ unlikely GENDER: Female│ 168│ 2%│
1054 │ ╶──────────────────────────┼─────┼──────┤
1055 │ Very S3a. Male │ 81│ 1%│
1056 │ unlikely GENDER: Female│ 59│ 1%│
1058 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1059 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1060 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1061 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1062 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1063 │ Very S3a. Male │ 988│ 14%│
1064 │ likely GENDER: Female│ 1049│ 15%│
1065 │ Total │ 2037│ 30%│
1066 │ ╶──────────────────────────┼─────┼──────┤
1067 │ Somewhat S3a. Male │ 822│ 12%│
1068 │ likely GENDER: Female│ 1210│ 18%│
1069 │ Total │ 2032│ 30%│
1070 │ ╶──────────────────────────┼─────┼──────┤
1071 │ Somewhat S3a. Male │ 446│ 7%│
1072 │ unlikely GENDER: Female│ 548│ 8%│
1074 │ ╶──────────────────────────┼─────┼──────┤
1075 │ Very S3a. Male │ 268│ 4%│
1076 │ unlikely GENDER: Female│ 354│ 5%│
1078 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1079 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1080 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1081 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1082 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1083 │ Very S3a. Male │ 805│ 12%│
1084 │ likely GENDER: Female│ 1029│ 15%│
1085 │ Total │ 1834│ 27%│
1086 │ ╶──────────────────────────┼─────┼──────┤
1087 │ Somewhat S3a. Male │ 975│ 14%│
1088 │ likely GENDER: Female│ 1332│ 19%│
1089 │ Total │ 2307│ 34%│
1090 │ ╶──────────────────────────┼─────┼──────┤
1091 │ Somewhat S3a. Male │ 535│ 8%│
1092 │ unlikely GENDER: Female│ 560│ 8%│
1093 │ Total │ 1095│ 16%│
1094 │ ╶──────────────────────────┼─────┼──────┤
1095 │ Very S3a. Male │ 270│ 4%│
1096 │ unlikely GENDER: Female│ 279│ 4%│
1098 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1101 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1102 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1103 │ │ certain│likely│ likely │ unlikely│unlikely│
1104 │ ├────────┼──────┼─────────┼─────────┼────────┤
1106 │ │ Table %│ % │ Table % │ Table % │ Table %│
1107 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1108 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1109 │GENDER: is it that drivers│ │ │ │ │ │
1110 │ who have had too │ │ │ │ │ │
1111 │ much to drink to │ │ │ │ │ │
1112 │ drive safely will │ │ │ │ │ │
1113 │ A. Get stopped by │ │ │ │ │ │
1114 │ the police? │ │ │ │ │ │
1115 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1116 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1117 │ is it that drivers│ │ │ │ │ │
1118 │ who have had too │ │ │ │ │ │
1119 │ much to drink to │ │ │ │ │ │
1120 │ drive safely will │ │ │ │ │ │
1121 │ A. Get stopped by │ │ │ │ │ │
1122 │ the police? │ │ │ │ │ │
1123 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1124 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1125 │ is it that drivers│ │ │ │ │ │
1126 │ who have had too │ │ │ │ │ │
1127 │ much to drink to │ │ │ │ │ │
1128 │ drive safely will │ │ │ │ │ │
1129 │ A. Get stopped by │ │ │ │ │ │
1130 │ the police? │ │ │ │ │ │
1131 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1132 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1133 │GENDER: is it that drivers│ │ │ │ │ │
1134 │ who have had too │ │ │ │ │ │
1135 │ much to drink to │ │ │ │ │ │
1136 │ drive safely will │ │ │ │ │ │
1137 │ B. Have an │ │ │ │ │ │
1138 │ accident? │ │ │ │ │ │
1139 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1140 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1141 │ is it that drivers│ │ │ │ │ │
1142 │ who have had too │ │ │ │ │ │
1143 │ much to drink to │ │ │ │ │ │
1144 │ drive safely will │ │ │ │ │ │
1145 │ B. Have an │ │ │ │ │ │
1146 │ accident? │ │ │ │ │ │
1147 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1148 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1149 │ is it that drivers│ │ │ │ │ │
1150 │ who have had too │ │ │ │ │ │
1151 │ much to drink to │ │ │ │ │ │
1152 │ drive safely will │ │ │ │ │ │
1153 │ B. Have an │ │ │ │ │ │
1154 │ accident? │ │ │ │ │ │
1155 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1156 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1157 │GENDER: is it that drivers│ │ │ │ │ │
1158 │ who have had too │ │ │ │ │ │
1159 │ much to drink to │ │ │ │ │ │
1160 │ drive safely will │ │ │ │ │ │
1161 │ C. Be convicted │ │ │ │ │ │
1162 │ for drunk driving?│ │ │ │ │ │
1163 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1164 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1165 │ is it that drivers│ │ │ │ │ │
1166 │ who have had too │ │ │ │ │ │
1167 │ much to drink to │ │ │ │ │ │
1168 │ drive safely will │ │ │ │ │ │
1169 │ C. Be convicted │ │ │ │ │ │
1170 │ for drunk driving?│ │ │ │ │ │
1171 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1172 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1173 │ is it that drivers│ │ │ │ │ │
1174 │ who have had too │ │ │ │ │ │
1175 │ much to drink to │ │ │ │ │ │
1176 │ drive safely will │ │ │ │ │ │
1177 │ C. Be convicted │ │ │ │ │ │
1178 │ for drunk driving?│ │ │ │ │ │
1179 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1180 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1181 │GENDER: is it that drivers│ │ │ │ │ │
1182 │ who have had too │ │ │ │ │ │
1183 │ much to drink to │ │ │ │ │ │
1184 │ drive safely will │ │ │ │ │ │
1185 │ D. Be arrested for│ │ │ │ │ │
1186 │ drunk driving? │ │ │ │ │ │
1187 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1188 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1189 │ is it that drivers│ │ │ │ │ │
1190 │ who have had too │ │ │ │ │ │
1191 │ much to drink to │ │ │ │ │ │
1192 │ drive safely will │ │ │ │ │ │
1193 │ D. Be arrested for│ │ │ │ │ │
1194 │ drunk driving? │ │ │ │ │ │
1195 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1196 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1197 │ is it that drivers│ │ │ │ │ │
1198 │ who have had too │ │ │ │ │ │
1199 │ much to drink to │ │ │ │ │ │
1200 │ drive safely will │ │ │ │ │ │
1201 │ D. Be arrested for│ │ │ │ │ │
1202 │ drunk driving? │ │ │ │ │ │
1203 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1207 AT_SETUP([CTABLES nesting and scale variables])
1208 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1209 AT_DATA([ctables.sps],
1211 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1212 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1213 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1214 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1215 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1217 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1219 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1225 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1226 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1227 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1229 │ Once a week or │ 44│ 54│
1231 │ Only certain │ 34│ 41│
1232 │ times a year │ │ │
1234 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1237 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1238 │ │Minimum│Maximum│Mean│
1239 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1240 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1241 │What is GENDER: months, has there been a │ │ │ │
1242 │your time when you felt you │ │ │ │
1243 │age? should cut down on your No │ 16│ 86│ 46│
1245 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1246 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1247 │ months, has there been a │ │ │ │
1248 │ time when you felt you │ │ │ │
1249 │ should cut down on your No │ 16│ 86│ 48│
1251 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1252 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1253 │What is GENDER: months, has there been a │ │ │ │
1254 │your time when people criticized No │ 16│ 86│ 46│
1255 │age? your drinking? │ │ │ │
1256 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1257 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1258 │ months, has there been a │ │ │ │
1259 │ time when people criticized No │ 16│ 86│ 48│
1260 │ your drinking? │ │ │ │
1261 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1264 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1265 │ │S1. Including yourself, how many members of this│
1266 │ │ household are age 16 or older? │
1267 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1268 │ │ │ │ │ │ │ │ 6 or │
1269 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1270 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1271 │ │Column│Column│Column│Column│Column│Column│Column│
1272 │ │ % │ % │ % │ % │ % │ % │ % │
1273 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1274 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1275 │SAMPLE How certain │ │ │ │ │ │ │ │
1276 │SOURCE: likely │ │ │ │ │ │ │ │
1277 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1278 │ that likely │ │ │ │ │ │ │ │
1279 │ drivers │ │ │ │ │ │ │ │
1280 │ who have │ │ │ │ │ │ │ │
1281 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1282 │ much to likely │ │ │ │ │ │ │ │
1283 │ drink to │ │ │ │ │ │ │ │
1284 │ drive │ │ │ │ │ │ │ │
1285 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1286 │ will A. unlikely│ │ │ │ │ │ │ │
1287 │ Get │ │ │ │ │ │ │ │
1288 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1289 │ by the unlikely│ │ │ │ │ │ │ │
1290 │ police? │ │ │ │ │ │ │ │
1291 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1294 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1297 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1298 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1299 │group typical month did you have one or more │ │ │
1300 │ alcoholic beverages to drink? │ │ │
1301 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1302 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1303 │ typical month did you have one or more │ │ │
1304 │ alcoholic beverages to drink? │ │ │
1305 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1306 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1307 │ typical month did you have one or more │ │ │
1308 │ alcoholic beverages to drink? │ │ │
1309 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1310 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1311 │ typical month did you have one or more │ │ │
1312 │ alcoholic beverages to drink? │ │ │
1313 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1314 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1315 │ typical month did you have one or more │ │ │
1316 │ alcoholic beverages to drink? │ │ │
1317 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1318 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1319 │ older typical month did you have one or more │ │ │
1320 │ alcoholic beverages to drink? │ │ │
1321 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1326 AT_SETUP([CTABLES SLABELS])
1327 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1328 AT_DATA([ctables.sps],
1330 CTABLES /TABLE qn1 [COUNT COLPCT].
1331 CTABLES /TABLE qn1 [COUNT COLPCT]
1332 /SLABELS POSITION=ROW.
1333 CTABLES /TABLE qn1 [COUNT COLPCT]
1334 /SLABELS POSITION=ROW VISIBLE=NO.
1336 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1338 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1341 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1342 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1343 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1344 │ Once a week or less│ 361│ 5.2%│
1345 │ Only certain times │ 130│ 1.9%│
1347 │ Never │ 540│ 7.7%│
1348 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1351 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1352 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1353 │other motor vehicle? Column │66.9%│
1355 │ ╶───────────────────────────┼─────┤
1356 │ Several days a week Count │ 1274│
1359 │ ╶───────────────────────────┼─────┤
1360 │ Once a week or less Count │ 361│
1363 │ ╶───────────────────────────┼─────┤
1364 │ Only certain times Count │ 130│
1365 │ a year Column │ 1.9%│
1367 │ ╶───────────────────────────┼─────┤
1368 │ Never Count │ 540│
1371 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1374 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1375 │ 1. How often do you usually drive a car or other Every day │ 4667│
1376 │motor vehicle? │66.9%│
1377 │ Several days a week │ 1274│
1379 │ Once a week or less │ 361│
1381 │ Only certain times a │ 130│
1385 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1389 AT_SETUP([CTABLES simple totals])
1390 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1391 AT_DATA([ctables.sps],
1394 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1395 DESCRIPTIVES qn18/STATISTICS=MEAN.
1396 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1397 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1399 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1401 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1403 ├────────────────────────────────────────────────────────────────────────┼─────┤
1404 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1405 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1408 │ Wine coolers │ 137│
1409 │ Hard liquor or │ 888│
1411 │ Flavored malt │ 83│
1413 │ Number responding │ 4221│
1414 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1416 Descriptive Statistics
1417 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1419 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1420 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1421 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1422 │Valid N (listwise) │6999│ │
1423 │Missing N (listwise) │2781│ │
1424 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1427 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1428 │ │ │ │ Valid│Total│
1429 │ │Mean│Count│ N │ N │
1430 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1431 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1432 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1433 │ you usually drink per sitting? │ │ │ │ │
1434 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1435 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1436 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1437 │ you usually drink per sitting? │ │ │ │ │
1438 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1439 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1440 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1441 │ you usually drink per sitting? │ │ │ │ │
1442 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1443 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1444 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1445 │ you usually drink per sitting? │ │ │ │ │
1446 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1447 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1448 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1449 │ you usually drink per sitting? │ │ │ │ │
1450 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1454 AT_SETUP([CTABLES subtotals])
1455 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1456 AT_DATA([ctables.sps],
1458 CTABLES /TABLE=qn105ba BY qns1
1459 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1460 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1461 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1462 CTABLES /TABLE=qn105ba BY qns1
1463 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1464 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1466 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1468 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1469 │ │ S1. Including yourself, how many members of this household │
1470 │ │ are age 16 or older? │
1471 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1472 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1473 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1474 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1475 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1476 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1477 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1478 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1479 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1480 │ likely │ │ │ │ │ │ │ │
1481 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1482 │ unlikely │ │ │ │ │ │ │ │
1483 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1484 │ unlikely │ │ │ │ │ │ │ │
1485 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1488 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1489 │ │ S1. Including yourself, how many members of this household │
1490 │ │ are age 16 or older? │
1491 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1492 │ │ │ │ │ │ │ │ 6 or │
1493 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1494 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1495 │ │ │ │ │ │ Column│ │ │
1496 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1497 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1498 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1499 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1500 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1501 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1502 │ likely │ │ │ │ │ │ │ │
1503 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1504 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1505 │ unlikely │ │ │ │ │ │ │ │
1506 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1507 │ unlikely │ │ │ │ │ │ │ │
1508 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1509 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1512 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1513 │ │ S1. Including yourself, how many members of this household │
1514 │ │ are age 16 or older? │
1515 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1516 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1517 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1518 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1519 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1520 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1521 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1522 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1523 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1524 │ likely │ │ │ │ │ │ │ │
1525 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1526 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1527 │ unlikely │ │ │ │ │ │ │ │
1528 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1529 │ unlikely │ │ │ │ │ │ │ │
1530 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1531 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1535 AT_SETUP([CTABLES PCOMPUTE])
1536 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1537 AT_DATA([ctables.sps],
1540 /PCOMPUTE &x=EXPR([3] + [4])
1541 /PCOMPUTE &y=EXPR([4] + [5])
1542 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1543 /PPROPERTIES &y LABEL='4+5'
1544 /TABLE=qn105ba BY qns1
1545 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1547 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1549 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1550 │ │ S1. Including yourself, how many members of this household │
1551 │ │ are age 16 or older? │
1552 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1553 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1554 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1555 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1556 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1557 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1558 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1559 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1560 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1561 │ likely │ │ │ │ │ │ │ │
1562 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1563 │ unlikely │ │ │ │ │ │ │ │
1564 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1565 │ unlikely │ │ │ │ │ │ │ │
1566 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1570 AT_SETUP([CTABLES CLABELS])
1571 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1572 AT_DATA([ctables.sps],
1574 CTABLES /TABLE AgeGroup BY qns3a.
1575 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1576 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1577 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1578 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1581 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1583 ╭───────────────────────┬────────────╮
1589 ├───────────────────────┼─────┼──────┤
1590 │Age group 15 or younger│ 0│ 0│
1591 │ 16 to 25 │ 594│ 505│
1592 │ 26 to 35 │ 476│ 491│
1593 │ 36 to 45 │ 489│ 548│
1594 │ 46 to 55 │ 526│ 649│
1595 │ 56 to 65 │ 516│ 731│
1596 │ 66 or older │ 531│ 943│
1597 ╰───────────────────────┴─────┴──────╯
1600 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1602 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1604 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1605 │ │ 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 │
1606 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1607 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1608 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1609 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1610 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1611 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1612 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1615 ╭──────────────────────────────┬────────────╮
1619 ├──────────────────────────────┼────────────┤
1620 │Age group 15 or younger Male │ 0│
1622 │ ╶────────────────────┼────────────┤
1623 │ 16 to 25 Male │ 594│
1625 │ ╶────────────────────┼────────────┤
1626 │ 26 to 35 Male │ 476│
1628 │ ╶────────────────────┼────────────┤
1629 │ 36 to 45 Male │ 489│
1631 │ ╶────────────────────┼────────────┤
1632 │ 46 to 55 Male │ 526│
1634 │ ╶────────────────────┼────────────┤
1635 │ 56 to 65 Male │ 516│
1637 │ ╶────────────────────┼────────────┤
1638 │ 66 or older Male │ 531│
1640 ╰──────────────────────────────┴────────────╯
1644 ╭─────────┬────────────╮
1650 ├─────────┼─────┼──────┤
1652 ╰─────────┴─────┴──────╯
1656 ╭─────────┬────────────╮
1662 ├─────────┼─────┼──────┤
1663 │Age group│ 594│ 505│
1664 ╰─────────┴─────┴──────╯
1668 ╭─────────┬────────────╮
1674 ├─────────┼─────┼──────┤
1675 │Age group│ 476│ 491│
1676 ╰─────────┴─────┴──────╯
1680 ╭─────────┬────────────╮
1686 ├─────────┼─────┼──────┤
1687 │Age group│ 489│ 548│
1688 ╰─────────┴─────┴──────╯
1692 ╭─────────┬────────────╮
1698 ├─────────┼─────┼──────┤
1699 │Age group│ 526│ 649│
1700 ╰─────────┴─────┴──────╯
1704 ╭─────────┬────────────╮
1710 ├─────────┼─────┼──────┤
1711 │Age group│ 516│ 731│
1712 ╰─────────┴─────┴──────╯
1716 ╭─────────┬────────────╮
1722 ├─────────┼─────┼──────┤
1723 │Age group│ 531│ 943│
1724 ╰─────────┴─────┴──────╯
1728 ╭───────────────────────┬────────────╮
1732 ├───────────────────────┼────────────┤
1733 │Age group 15 or younger│ 0│
1739 │ 66 or older │ 531│
1740 ╰───────────────────────┴────────────╯
1744 ╭───────────────────────┬────────────╮
1748 ├───────────────────────┼────────────┤
1749 │Age group 15 or younger│ 0│
1755 │ 66 or older │ 943│
1756 ╰───────────────────────┴────────────╯
1760 AT_SETUP([CTABLES missing values])
1761 AT_DATA([ctables.sps],
1762 [[DATA LIST LIST NOTABLE/x y.
1801 MISSING VALUES x (1, 2) y (2, 3).
1802 VARIABLE LEVEL ALL (NOMINAL).
1804 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1805 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1806 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1807 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1808 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1809 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1810 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1811 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1812 /CATEGORIES VARIABLES=ALL TOTAL=YES
1813 /SLABELS POSITION=ROW.
1814 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1815 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1816 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1817 /SLABELS POSITION=ROW.
1818 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1819 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1820 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1821 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1822 /SLABELS POSITION=ROW.
1824 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1826 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1827 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1828 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1829 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1830 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1831 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1832 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1833 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1834 dnl Note that Column Total N % doesn't add up to 100 because missing
1835 dnl values are included in the total but not shown as a category and this
1836 dnl is expected behavior.
1839 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1840 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1841 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1842 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1843 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1844 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1845 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1846 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1847 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1848 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1849 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1850 dnl values are included in the total but not shown as a category and this
1851 dnl is expected behavior.
1854 ╭────────────────────────┬───────────────────────────╮
1856 │ ├──────┬──────┬──────┬──────┤
1857 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1858 ├────────────────────────┼──────┼──────┼──────┼──────┤
1859 │x 3.00 Count │ 1│ 1│ 1│ 3│
1860 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1861 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1862 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1863 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1864 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1865 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1866 │ Valid N │ │ │ │ 3│
1867 │ Total N │ │ │ │ 6│
1868 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1869 │ 4.00 Count │ 1│ 1│ 1│ 3│
1870 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1871 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1872 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1873 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1874 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1875 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1876 │ Valid N │ │ │ │ 3│
1877 │ Total N │ │ │ │ 6│
1878 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1879 │ 5.00 Count │ 1│ 1│ 1│ 3│
1880 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1881 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1882 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1883 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1884 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1885 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1886 │ Valid N │ │ │ │ 3│
1887 │ Total N │ │ │ │ 6│
1888 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1889 │ Total Count │ 3│ 3│ 3│ 9│
1890 │ Column % │100.0%│100.0%│100.0%│ .│
1891 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1892 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1893 │ Row % │ .│ .│ .│ .│
1894 │ Row Valid N % │ .│ .│ .│ .│
1895 │ Row Total N % │ .│ .│ .│ .│
1896 │ Valid N │ 3│ 3│ 3│ 9│
1897 │ Total N │ 6│ 6│ 6│ 36│
1898 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1901 ╭────────────────────────┬─────────────────────────────────────────╮
1903 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1904 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1905 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1906 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1907 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1908 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1909 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1910 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1911 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1912 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1913 │ Valid N │ │ │ │ │ │ 0│
1914 │ Total N │ │ │ │ │ │ 6│
1915 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1916 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1917 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1918 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1919 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1920 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1921 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1922 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1923 │ Valid N │ │ │ │ │ │ 0│
1924 │ Total N │ │ │ │ │ │ 6│
1925 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1926 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1927 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1928 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1929 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1930 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1931 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1932 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1933 │ Valid N │ │ │ │ │ │ 3│
1934 │ Total N │ │ │ │ │ │ 6│
1935 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1936 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1937 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1938 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1939 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1940 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1941 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1942 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1943 │ Valid N │ │ │ │ │ │ 3│
1944 │ Total N │ │ │ │ │ │ 6│
1945 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1946 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1947 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1948 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1949 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1950 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1951 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1952 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1953 │ Valid N │ │ │ │ │ │ 3│
1954 │ Total N │ │ │ │ │ │ 6│
1955 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1956 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1957 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1958 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1959 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1960 │ Row % │ .│ .│ .│ .│ .│ .│
1961 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1962 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1963 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1964 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1965 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1968 ╭────────────────────────┬──────────────────────────────────╮
1970 │ ├──────┬──────┬──────┬──────┬──────┤
1971 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1972 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1973 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1974 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1975 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1976 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1977 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1978 │ Row Valid N % │ .│ .│ .│ .│ .│
1979 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1980 │ Valid N │ │ │ │ │ 0│
1981 │ Total N │ │ │ │ │ 6│
1982 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1983 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1984 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1985 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1986 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1987 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1988 │ Row Valid N % │ .│ .│ .│ .│ .│
1989 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1990 │ Valid N │ │ │ │ │ 0│
1991 │ Total N │ │ │ │ │ 6│
1992 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1993 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1994 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1995 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1996 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1997 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1998 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1999 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2000 │ Valid N │ │ │ │ │ 3│
2001 │ Total N │ │ │ │ │ 6│
2002 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2003 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2004 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2005 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2006 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2007 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2008 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2009 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2010 │ Valid N │ │ │ │ │ 3│
2011 │ Total N │ │ │ │ │ 6│
2012 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2013 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2014 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2015 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2016 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2017 │ Row % │ .│ .│ .│ .│ .│
2018 │ Row Valid N % │ .│ .│ .│ .│ .│
2019 │ Row Total N % │ .│ .│ .│ .│ .│
2020 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2021 │ Total N │ 5│ 5│ 5│ 5│ 30│
2022 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2026 AT_SETUP([CTABLES SMISSING=LISTWISE])
2027 AT_KEYWORDS([SMISSING LISTWISE])
2028 AT_DATA([ctables.sps],
2029 [[DATA LIST LIST NOTABLE/x y z.
2037 VARIABLE LEVEL x (NOMINAL).
2039 CTABLES /TABLE (y + z) > x.
2040 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2042 * The following doesn't come out as listwise because the tables are
2043 separate, not linked by an > operator.
2044 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2046 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2076 AT_SETUP([CTABLES VLABELS])
2077 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2078 AT_DATA([ctables.sps],
2080 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2081 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2082 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2083 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2084 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2086 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2088 ╭────────────────────────────────────────────────────────────────┬────────────╮
2094 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2095 │D5a. What would you say is your primary Cuban │ 13│ 7│
2096 │ethnic background? Mexican │ 175│ 136│
2098 │ South American │ 21│ 13│
2099 │ Central American │ 27│ 25│
2100 │ Puerto Rican, OR │ 37│ 41│
2101 │ Something else │ 35│ 33│
2102 │ Multiple - cannot │ 2│ 5│
2104 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2107 ╭──────────────────────────────────┬────────────╮
2113 ├──────────────────────────────────┼─────┼──────┤
2114 │QND5A Cuban │ 13│ 7│
2115 │ Mexican │ 175│ 136│
2117 │ South American │ 21│ 13│
2118 │ Central American │ 27│ 25│
2119 │ Puerto Rican, OR │ 37│ 41│
2120 │ Something else │ 35│ 33│
2121 │ Multiple - cannot choose one│ 2│ 5│
2122 ╰──────────────────────────────────┴─────┴──────╯
2125 ╭────────────────────────────────────────────────────────────────┬────────────╮
2131 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2132 │D5a. What would you say is your primary Cuban │ 13│ 7│
2133 │ethnic background? Mexican │ 175│ 136│
2135 │ South American │ 21│ 13│
2136 │ Central American │ 27│ 25│
2137 │ Puerto Rican, OR │ 37│ 41│
2138 │ Something else │ 35│ 33│
2139 │ Multiple - cannot │ 2│ 5│
2141 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2144 ╭────────────────────────────────────────────────────────────┬────────────────╮
2147 │ ├───────┬────────┤
2149 │ ├───────┼────────┤
2151 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2152 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2153 │primary ethnic background? Mexican │ 175│ 136│
2155 │ South American │ 21│ 13│
2156 │ Central American │ 27│ 25│
2157 │ Puerto Rican, OR │ 37│ 41│
2158 │ Something else │ 35│ 33│
2159 │ Multiple - cannot │ 2│ 5│
2161 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2164 ╭────────────────────────────┬─────┬──────╮
2168 ├────────────────────────────┼─────┼──────┤
2170 │Mexican │ 175│ 136│
2172 │South American │ 21│ 13│
2173 │Central American │ 27│ 25│
2174 │Puerto Rican, OR │ 37│ 41│
2175 │Something else │ 35│ 33│
2176 │Multiple - cannot choose one│ 2│ 5│
2177 ╰────────────────────────────┴─────┴──────╯