3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Testing details of missing value handling in summaries.
6 dnl - Test WEIGHT and adjustment weights.
7 dnl - Summary functions:
8 dnl * Separate summary functions for totals and subtotals.
9 dnl * )CILEVEL in summary label specification
13 dnl * ascending/descending
16 dnl * THRU (numeric ranges)
19 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
20 dnl - Date/time variables and values
21 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
22 dnl - TITLES: )DATE, )TIME, )TABLE.
24 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
25 dnl * MISSING, OTHERNM
26 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
30 dnl - Summary functions:
31 dnl * U-prefix for unweighted summaries.
32 dnl * areaPCT.SUM and UareaPCT.SUM functions.
33 dnl - SPLIT FILE with SEPARATE splits
34 dnl - Definition of columns/rows when labels are rotated from one axis to another.
37 dnl - Multiple response sets
38 dnl - MRSETS subcommand.
39 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
42 dnl - Summary functions:
43 dnl * .LCL and .UCL suffixes.
46 dnl * Data-dependent sorting.
48 AT_SETUP([CTABLES parsing])
49 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
50 AT_DATA([ctables.sps],
53 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
54 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
55 /FORMAT UNITS=CM EMPTY="(-)"
56 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
57 /VLABELS VARIABLES=qn17 DISPLAY=NAME
58 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
59 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
60 /VLABELS VARIABLES=qn20 DISPLAY=NONE
61 /MRSETS COUNTDUPLICATES=NO
62 /MRSETS COUNTDUPLICATES=YES
65 /WEIGHT VARIABLE=qns3a
67 /HIDESMALLCOUNTS COUNT=10
69 /SLABELS POSITION=COLUMN VISIBLE=YES
70 /SLABELS VISIBLE=NO POSITION=ROW
71 /SLABELS POSITION=LAYER
73 /CLABELS ROWLABELS=OPPOSITE
75 /CATEGORIES VARIABLES=qn1 qn17
76 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
77 POSITION=BEFORE EMPTY=INCLUDE.
78 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
79 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
80 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
82 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
85 ╭───────────────────┬────┬────╮
87 ├───────────────────┼────┼────┤
88 │Sa1. SAMPLE SOURCE:│5392│1607│
89 ╰───────────────────┴────┴────╯
93 ╭───────────────────┬─────╮
95 ├───────────────────┼─────┤
96 │Sa1. SAMPLE SOURCE:│ 5392│
97 ╰───────────────────┴─────╯
100 ╭────────────────────────┬─────╮
102 ├────────────────────────┼─────┤
103 │Sa1. SAMPLE SOURCE: RDD │ 5392│
105 ╰────────────────────────┴─────╯
108 ╭────────────────────────┬─────╮
110 ├────────────────────────┼─────┤
111 │Sa1. SAMPLE SOURCE: RDD │ 5392│
113 ╰────────────────────────┴─────╯
117 AT_SETUP([CTABLES parsing - negative])
118 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
119 AT_DATA([ctables.sps],
122 CTABLES /FORMAT MINCOLWIDTH='foo'.
123 CTABLES /TABLE qn1 [**].
124 CTABLES /TABLE qn1 [NOTAFUNCTION].
127 CTABLES /TABLE NOTAVAR.
129 CTABLES /TABLE string[S].
130 CTABLES /TABLE qn1 [PTILE 101].
131 CTABLES /TABLE qn1 [MEAN F0.1].
132 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
133 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
134 CTABLES /TABLE qn1 [MEAN TOTALS].
135 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
136 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
137 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
138 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
153 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
154 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
155 CTABLES /PCOMPUTE &k=EXPR([LO **]).
156 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
157 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
158 CTABLES /PCOMPUTE &k=EXPR([1**]).
159 CTABLES /PCOMPUTE &k=EXPR((1x)).
160 CTABLES /PCOMPUTE **k.
161 CTABLES /PCOMPUTE &1.
162 CTABLES /PCOMPUTE &k**.
163 CTABLES /PCOMPUTE &k=**.
164 CTABLES /PCOMPUTE &k=EXPR**.
165 CTABLES /PCOMPUTE &k=EXPR(1x).
166 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
167 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
168 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
169 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
170 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
172 CTABLES /FORMAT EMPTY=**.
173 CTABLES /FORMAT MISSING=**.
175 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
177 CTABLES /VLABELS VARIABLES=NOTAVAR.
178 CTABLES /VLABELS VARIABLES=qn1 **.
179 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
181 CTABLES /MRSETS COUNTDUPLICATES=**.
182 CTABLES /SMISSING **.
184 CTABLES /WEIGHT VARIABLE=NOTAVAR.
185 CTABLES /HIDESMALLCOUNTS COUNT=1.
187 CTABLES /HIDESMALLCOUNTS COUNT=2.
188 CTABLES /TABLE qn1**.
189 CTABLES /TABLE qn1 /SLABELS POSITION=**.
190 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
191 CTABLES /TABLE qn1 /SLABELS **.
192 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
193 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
194 CTABLES /TABLE qn1 /CLABELS **.
195 CTABLES /TABLE qn1 /CRITERIA **.
196 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
197 CTABLES /TABLE qn1 /TITLES **.
198 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
199 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
200 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
201 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
202 CTABLES /TABLE qn1 /SIGTEST **.
203 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
204 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
205 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
206 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
207 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
208 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
209 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
210 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
211 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
212 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
213 CTABLES /TABLE qn1 /COMPARETEST **.
214 CTABLES /TABLE qn1 / **.
215 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
216 CTABLES /TABLE qn20 > qnd1.
217 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
218 NUMERIC datetime (DATETIME17.0).
219 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
221 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
222 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
224 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
225 negative number for MINCOLWIDTH.
227 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
230 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
231 summary function name.
233 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
235 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
238 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
240 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
242 10 | CTABLES /TABLE string[S].
245 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
246 between 0 and 100 for PTILE.
248 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
249 requires a width between 1 and 40.
251 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
252 format NEGPAREN requires width 2 or greater.
254 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
255 format NEGPAREN requires width greater than decimals.
257 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
259 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
262 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
263 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
266 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
268 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
270 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
273 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
274 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
277 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
279 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
281 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
283 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
285 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
287 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
289 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
292 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
293 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
296 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
297 between 0 and 100 for PTILE.
299 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
302 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
305 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
308 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
311 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
313 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
316 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
319 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
320 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
322 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
323 LABEL, POSITION, or EMPTY.
325 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
326 integer for SUBTOTAL.
328 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
330 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
332 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
334 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
336 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
338 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
340 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
342 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
344 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
346 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
348 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
350 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
352 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
353 the previous definition.
354 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
355 | ^~~~~~~~~~~~~~~~~~~
357 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
358 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
359 | ^~~~~~~~~~~~~~~~~~~
361 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
364 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
365 Expecting summary function name.
367 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
368 between 0 and 100 for PTILE.
370 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
372 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
375 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
376 FORMAT, or HIDESOURCECATS.
378 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
380 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
382 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
383 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
385 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
388 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
391 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
393 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
396 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
397 DEFAULT, NAME, LABEL, BOTH, or NONE.
399 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
402 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
405 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
406 VARIABLE or LISTWISE.
408 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
411 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
413 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
414 greater for HIDESMALLCOUNTS COUNT.
416 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
417 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
418 HIDESMALLCOUNTS, or TABLE.
420 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
423 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
425 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
428 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
431 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
434 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
437 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
440 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
441 ROWLABELS, or COLLABELS.
443 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
446 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
447 in @<:@0,100@:}@ for CILEVEL.
449 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
450 CAPTION, CORNER, or TITLE.
452 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
455 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
456 in @<:@0,1@:}@ for ALPHA.
458 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
461 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
462 ALLVISIBLE or SUBTOTALS.
464 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
465 ALPHA, INCLUDEMRSETS, or CATEGORIES.
467 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
470 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
473 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
476 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
477 BONFERRONI, BH, or NONE.
479 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
482 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
485 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
486 ALLVISIBLE or SUBTOTALS.
488 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
491 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
494 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
497 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
498 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
501 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
502 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
504 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
507 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
508 97 | CTABLES /TABLE qn20 > qnd1.
511 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
512 97 | CTABLES /TABLE qn20 > qnd1.
515 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
516 97 | CTABLES /TABLE qn20 > qnd1.
519 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
520 categorical variables at the innermost nesting level.
521 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
522 | ^~~~~~~~~~~~~~~~~~~~
524 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
526 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
529 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
530 specification as format DATETIME: Day (123) must be between 1 and 31..
531 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
536 AT_SETUP([CTABLES parsing - more negative])
537 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
538 AT_DATA([ctables.sps],
540 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
541 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
542 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
545 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
546 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
548 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
550 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
551 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
552 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
553 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
555 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
556 CTABLES /PCOMPUTE &x=EXPR([**]).
557 CTABLES /PCOMPUTE &x=EXPR(**).
561 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
563 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
564 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
565 category not included in the category list.
566 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
571 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
572 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
576 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
577 list of categories here.
578 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
583 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
584 category not included in the category list.
585 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
590 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
591 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
595 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
596 variable's CATEGORIES specification.
598 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
599 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
600 subtotals by position, e.g. SUBTOTAL[1].
601 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
602 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
604 ^~~~~~~~~~~~~~~~~~~~~~~~
606 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
608 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
609 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
612 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
613 applied only to string variables, but this subcommand tries to apply it to
614 numeric variable QN1.
615 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
618 ctables.sps:8.53: error: CTABLES: This category specification may be applied
619 only to numeric variables, but this subcommand tries to apply it to string
621 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
624 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
625 based on a summary function.
627 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
628 moved to be categorical, but qnd1 is a scale variable.
630 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
631 moved to have the same width, but QN1 has width 0 and string has width 8.
633 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
634 moved to have the same value labels, but QN1 and QNSA1 have different value
637 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
638 moved to have the same category specifications, but QN105BA and QN105BB have
639 different category specifications.
641 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
642 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
643 this warning, insert parentheses.
644 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
647 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
650 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
652 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
654 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
655 variable must be specified.
657 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
659 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
661 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
664 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
666 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
669 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
671 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
676 AT_SETUP([CTABLES one categorical variable])
677 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
678 AT_DATA([ctables.sps],
681 CTABLES /TABLE BY qn1.
682 CTABLES /TABLE BY BY qn1.
684 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
686 ╭────────────────────────────────────────────────────────────────────────┬─────╮
688 ├────────────────────────────────────────────────────────────────────────┼─────┤
689 │ 1. How often do you usually drive a car or other Every day │ 4667│
690 │motor vehicle? Several days a week │ 1274│
691 │ Once a week or less │ 361│
692 │ Only certain times a │ 130│
695 ╰────────────────────────────────────────────────────────────────────────┴─────╯
698 ╭──────────────────────────────────────────────────────────────────────────────╮
699 │ 1. How often do you usually drive a car or other motor vehicle? │
700 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
701 │ │ Several days a │ Once a week or │ Only certain times a │ │
702 │Every day│ week │ less │ year │Never│
703 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
704 │ Count │ Count │ Count │ Count │Count│
705 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
706 │ 4667│ 1274│ 361│ 130│ 540│
707 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
719 AT_SETUP([CTABLES one string variable])
720 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
721 AT_DATA([ctables.sps],
724 MISSING VALUES licensed('DontKnow', 'Refused').
725 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
726 CTABLES /TABLE licensed.
727 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
728 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
729 * Notice that the string matching is case-sensitive.
730 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
731 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
733 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
734 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
736 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
738 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
739 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
741 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
743 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
753 ╭─────────────────┬─────┬───────╮
755 ├─────────────────┼─────┼───────┤
756 │licensed DontKnow│ 4│ │
760 │ Total │ 6999│ 6951│
761 ╰─────────────────┴─────┴───────╯
764 ╭──────────────┬─────╮
766 ├──────────────┼─────┤
767 │licensed Yes │ 6379│
770 ╰──────────────┴─────╯
773 ╭──────────────┬─────╮
775 ├──────────────┼─────┤
776 │licensed Yes │ 6379│
779 ╰──────────────┴─────╯
782 ╭────────────────┬─────╮
784 ├────────────────┼─────┤
789 ╰────────────────┴─────╯
792 ╭────────────────┬─────╮
794 ├────────────────┼─────┤
795 │licensed Yes │ 6379│
797 ╰────────────────┴─────╯
800 ╭────────────────┬─────╮
802 ├────────────────┼─────┤
803 │licensed Yes │ 6379│
805 ╰────────────────┴─────╯
809 AT_SETUP([CTABLES one scale variable])
810 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
811 AT_DATA([ctables.sps],
813 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
814 CTABLES /TABLE BY qnd1.
815 CTABLES /TABLE BY BY qnd1.
817 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
819 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
820 │ │ │ │ │ │ Std │ │ │
821 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
822 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
823 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
824 │age? │ │ │ │ │ │ │ │
825 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
828 ╭──────────────────────────╮
829 │D1. AGE: What is your age?│
830 ├──────────────────────────┤
832 ├──────────────────────────┤
834 ╰──────────────────────────╯
837 D1. AGE: What is your age?
846 AT_SETUP([CTABLES simple stacking])
847 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
848 AT_DATA([ctables.sps],
850 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
852 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
854 ╭───────────────────────────────────────────────────────────────┬──────────────╮
861 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
862 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
863 │too much to drink to drive safely will A. Get certain │ │ │
864 │stopped by the police? Very likely │ 21%│ 22%│
865 │ Somewhat │ 38%│ 42%│
867 │ Somewhat │ 21%│ 18%│
871 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
872 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
873 │too much to drink to drive safely will B. Have an certain │ │ │
874 │accident? Very likely │ 36%│ 45%│
875 │ Somewhat │ 39%│ 32%│
881 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
882 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
883 │too much to drink to drive safely will C. Be certain │ │ │
884 │convicted for drunk driving? Very likely │ 32%│ 28%│
885 │ Somewhat │ 27%│ 32%│
887 │ Somewhat │ 15%│ 15%│
891 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
892 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
893 │too much to drink to drive safely will D. Be certain │ │ │
894 │arrested for drunk driving? Very likely │ 26%│ 27%│
895 │ Somewhat │ 32%│ 35%│
897 │ Somewhat │ 17%│ 15%│
901 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
905 AT_SETUP([CTABLES show or hide empty categories])
906 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
907 AT_DATA([ctables.sps],
909 IF (qn105ba = 2) qn105ba = 1.
910 IF (qns3a = 1) qns3a = 2.
911 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
912 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
913 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
914 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
915 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
916 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
917 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
919 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
921 ╭──────────────────────────────────────────────────────────────┬───────────────╮
928 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
929 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
930 │too much to drink to drive safely will A. Get certain │ │ │
931 │stopped by the police? Very likely│ .│ 0%│
938 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
941 ╭──────────────────────────────────────────────────────────────┬───────────────╮
948 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
949 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
950 │too much to drink to drive safely will A. Get certain │ │ │
951 │stopped by the police? Somewhat │ .│ 40%│
957 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
960 ╭────────────────────────────────────────────────────────────────────┬─────────╮
967 ├────────────────────────────────────────────────────────────────────┼─────────┤
968 │105b. How likely is it that drivers who have had too Almost │ 32%│
969 │much to drink to drive safely will A. Get stopped by certain │ │
970 │the police? Very likely │ 0%│
977 ╰────────────────────────────────────────────────────────────────────┴─────────╯
980 ╭────────────────────────────────────────────────────────────────────┬─────────╮
987 ├────────────────────────────────────────────────────────────────────┼─────────┤
988 │105b. How likely is it that drivers who have had too Almost │ 32%│
989 │much to drink to drive safely will A. Get stopped by certain │ │
990 │the police? Somewhat │ 40%│
996 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1000 AT_SETUP([CTABLES simple nesting])
1001 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1002 AT_DATA([ctables.sps],
1004 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1005 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1006 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1007 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1008 /CLABELS ROW=OPPOSITE.
1010 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1012 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1015 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1016 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1017 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1018 │drive safely will A. Get stopped by Total │ 700│ 10%│
1019 │the police? ╶──────────────────────────┼─────┼──────┤
1020 │ Very S3a. Male │ 660│ 10%│
1021 │ likely GENDER: Female│ 842│ 12%│
1022 │ Total │ 1502│ 22%│
1023 │ ╶──────────────────────────┼─────┼──────┤
1024 │ Somewhat S3a. Male │ 1174│ 17%│
1025 │ likely GENDER: Female│ 1589│ 23%│
1026 │ Total │ 2763│ 40%│
1027 │ ╶──────────────────────────┼─────┼──────┤
1028 │ Somewhat S3a. Male │ 640│ 9%│
1029 │ unlikely GENDER: Female│ 667│ 10%│
1030 │ Total │ 1307│ 19%│
1031 │ ╶──────────────────────────┼─────┼──────┤
1032 │ Very S3a. Male │ 311│ 5%│
1033 │ unlikely GENDER: Female│ 298│ 4%│
1035 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1036 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1037 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1038 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1039 │ ╶──────────────────────────┼─────┼──────┤
1040 │ Very S3a. Male │ 1104│ 16%│
1041 │ likely GENDER: Female│ 1715│ 25%│
1042 │ Total │ 2819│ 41%│
1043 │ ╶──────────────────────────┼─────┼──────┤
1044 │ Somewhat S3a. Male │ 1203│ 17%│
1045 │ likely GENDER: Female│ 1214│ 18%│
1046 │ Total │ 2417│ 35%│
1047 │ ╶──────────────────────────┼─────┼──────┤
1048 │ Somewhat S3a. Male │ 262│ 4%│
1049 │ unlikely GENDER: Female│ 168│ 2%│
1051 │ ╶──────────────────────────┼─────┼──────┤
1052 │ Very S3a. Male │ 81│ 1%│
1053 │ unlikely GENDER: Female│ 59│ 1%│
1055 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1056 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1057 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1058 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1059 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1060 │ Very S3a. Male │ 988│ 14%│
1061 │ likely GENDER: Female│ 1049│ 15%│
1062 │ Total │ 2037│ 30%│
1063 │ ╶──────────────────────────┼─────┼──────┤
1064 │ Somewhat S3a. Male │ 822│ 12%│
1065 │ likely GENDER: Female│ 1210│ 18%│
1066 │ Total │ 2032│ 30%│
1067 │ ╶──────────────────────────┼─────┼──────┤
1068 │ Somewhat S3a. Male │ 446│ 7%│
1069 │ unlikely GENDER: Female│ 548│ 8%│
1071 │ ╶──────────────────────────┼─────┼──────┤
1072 │ Very S3a. Male │ 268│ 4%│
1073 │ unlikely GENDER: Female│ 354│ 5%│
1075 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1076 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1077 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1078 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1079 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1080 │ Very S3a. Male │ 805│ 12%│
1081 │ likely GENDER: Female│ 1029│ 15%│
1082 │ Total │ 1834│ 27%│
1083 │ ╶──────────────────────────┼─────┼──────┤
1084 │ Somewhat S3a. Male │ 975│ 14%│
1085 │ likely GENDER: Female│ 1332│ 19%│
1086 │ Total │ 2307│ 34%│
1087 │ ╶──────────────────────────┼─────┼──────┤
1088 │ Somewhat S3a. Male │ 535│ 8%│
1089 │ unlikely GENDER: Female│ 560│ 8%│
1090 │ Total │ 1095│ 16%│
1091 │ ╶──────────────────────────┼─────┼──────┤
1092 │ Very S3a. Male │ 270│ 4%│
1093 │ unlikely GENDER: Female│ 279│ 4%│
1095 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1098 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1099 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1100 │ │ certain│likely│ likely │ unlikely│unlikely│
1101 │ ├────────┼──────┼─────────┼─────────┼────────┤
1103 │ │ Table %│ % │ Table % │ Table % │ Table %│
1104 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1105 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1106 │GENDER: is it that drivers│ │ │ │ │ │
1107 │ who have had too │ │ │ │ │ │
1108 │ much to drink to │ │ │ │ │ │
1109 │ drive safely will │ │ │ │ │ │
1110 │ A. Get stopped by │ │ │ │ │ │
1111 │ the police? │ │ │ │ │ │
1112 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1113 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1114 │ is it that drivers│ │ │ │ │ │
1115 │ who have had too │ │ │ │ │ │
1116 │ much to drink to │ │ │ │ │ │
1117 │ drive safely will │ │ │ │ │ │
1118 │ A. Get stopped by │ │ │ │ │ │
1119 │ the police? │ │ │ │ │ │
1120 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1121 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1122 │ is it that drivers│ │ │ │ │ │
1123 │ who have had too │ │ │ │ │ │
1124 │ much to drink to │ │ │ │ │ │
1125 │ drive safely will │ │ │ │ │ │
1126 │ A. Get stopped by │ │ │ │ │ │
1127 │ the police? │ │ │ │ │ │
1128 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1129 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1130 │GENDER: is it that drivers│ │ │ │ │ │
1131 │ who have had too │ │ │ │ │ │
1132 │ much to drink to │ │ │ │ │ │
1133 │ drive safely will │ │ │ │ │ │
1134 │ B. Have an │ │ │ │ │ │
1135 │ accident? │ │ │ │ │ │
1136 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1137 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1138 │ is it that drivers│ │ │ │ │ │
1139 │ who have had too │ │ │ │ │ │
1140 │ much to drink to │ │ │ │ │ │
1141 │ drive safely will │ │ │ │ │ │
1142 │ B. Have an │ │ │ │ │ │
1143 │ accident? │ │ │ │ │ │
1144 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1145 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1146 │ is it that drivers│ │ │ │ │ │
1147 │ who have had too │ │ │ │ │ │
1148 │ much to drink to │ │ │ │ │ │
1149 │ drive safely will │ │ │ │ │ │
1150 │ B. Have an │ │ │ │ │ │
1151 │ accident? │ │ │ │ │ │
1152 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1153 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1154 │GENDER: is it that drivers│ │ │ │ │ │
1155 │ who have had too │ │ │ │ │ │
1156 │ much to drink to │ │ │ │ │ │
1157 │ drive safely will │ │ │ │ │ │
1158 │ C. Be convicted │ │ │ │ │ │
1159 │ for drunk driving?│ │ │ │ │ │
1160 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1161 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1162 │ is it that drivers│ │ │ │ │ │
1163 │ who have had too │ │ │ │ │ │
1164 │ much to drink to │ │ │ │ │ │
1165 │ drive safely will │ │ │ │ │ │
1166 │ C. Be convicted │ │ │ │ │ │
1167 │ for drunk driving?│ │ │ │ │ │
1168 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1169 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1170 │ is it that drivers│ │ │ │ │ │
1171 │ who have had too │ │ │ │ │ │
1172 │ much to drink to │ │ │ │ │ │
1173 │ drive safely will │ │ │ │ │ │
1174 │ C. Be convicted │ │ │ │ │ │
1175 │ for drunk driving?│ │ │ │ │ │
1176 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1177 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1178 │GENDER: is it that drivers│ │ │ │ │ │
1179 │ who have had too │ │ │ │ │ │
1180 │ much to drink to │ │ │ │ │ │
1181 │ drive safely will │ │ │ │ │ │
1182 │ D. Be arrested for│ │ │ │ │ │
1183 │ drunk driving? │ │ │ │ │ │
1184 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1185 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1186 │ is it that drivers│ │ │ │ │ │
1187 │ who have had too │ │ │ │ │ │
1188 │ much to drink to │ │ │ │ │ │
1189 │ drive safely will │ │ │ │ │ │
1190 │ D. Be arrested for│ │ │ │ │ │
1191 │ drunk driving? │ │ │ │ │ │
1192 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1193 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1194 │ is it that drivers│ │ │ │ │ │
1195 │ who have had too │ │ │ │ │ │
1196 │ much to drink to │ │ │ │ │ │
1197 │ drive safely will │ │ │ │ │ │
1198 │ D. Be arrested for│ │ │ │ │ │
1199 │ drunk driving? │ │ │ │ │ │
1200 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1204 AT_SETUP([CTABLES nesting and scale variables])
1205 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1206 AT_DATA([ctables.sps],
1208 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1209 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1210 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1211 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1212 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1214 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1216 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1222 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1223 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1224 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1226 │ Once a week or │ 44│ 54│
1228 │ Only certain │ 34│ 41│
1229 │ times a year │ │ │
1231 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1234 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1235 │ │Minimum│Maximum│Mean│
1236 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1237 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1238 │What is GENDER: months, has there been a │ │ │ │
1239 │your time when you felt you │ │ │ │
1240 │age? should cut down on your No │ 16│ 86│ 46│
1242 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1243 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1244 │ months, has there been a │ │ │ │
1245 │ time when you felt you │ │ │ │
1246 │ should cut down on your No │ 16│ 86│ 48│
1248 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1249 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1250 │What is GENDER: months, has there been a │ │ │ │
1251 │your time when people criticized No │ 16│ 86│ 46│
1252 │age? your drinking? │ │ │ │
1253 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1254 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1255 │ months, has there been a │ │ │ │
1256 │ time when people criticized No │ 16│ 86│ 48│
1257 │ your drinking? │ │ │ │
1258 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1261 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1262 │ │S1. Including yourself, how many members of this│
1263 │ │ household are age 16 or older? │
1264 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1265 │ │ │ │ │ │ │ │ 6 or │
1266 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1267 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1268 │ │Column│Column│Column│Column│Column│Column│Column│
1269 │ │ % │ % │ % │ % │ % │ % │ % │
1270 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1271 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1272 │SAMPLE How certain │ │ │ │ │ │ │ │
1273 │SOURCE: likely │ │ │ │ │ │ │ │
1274 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1275 │ that likely │ │ │ │ │ │ │ │
1276 │ drivers │ │ │ │ │ │ │ │
1277 │ who have │ │ │ │ │ │ │ │
1278 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1279 │ much to likely │ │ │ │ │ │ │ │
1280 │ drink to │ │ │ │ │ │ │ │
1281 │ drive │ │ │ │ │ │ │ │
1282 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1283 │ will A. unlikely│ │ │ │ │ │ │ │
1284 │ Get │ │ │ │ │ │ │ │
1285 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1286 │ by the unlikely│ │ │ │ │ │ │ │
1287 │ police? │ │ │ │ │ │ │ │
1288 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1291 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1294 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1295 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1296 │group typical month did you have one or more │ │ │
1297 │ alcoholic beverages to drink? │ │ │
1298 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1299 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1300 │ typical month did you have one or more │ │ │
1301 │ alcoholic beverages to drink? │ │ │
1302 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1303 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1304 │ typical month did you have one or more │ │ │
1305 │ alcoholic beverages to drink? │ │ │
1306 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1307 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1308 │ typical month did you have one or more │ │ │
1309 │ alcoholic beverages to drink? │ │ │
1310 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1311 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1312 │ typical month did you have one or more │ │ │
1313 │ alcoholic beverages to drink? │ │ │
1314 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1315 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1316 │ older typical month did you have one or more │ │ │
1317 │ alcoholic beverages to drink? │ │ │
1318 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1323 AT_SETUP([CTABLES SLABELS])
1324 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1325 AT_DATA([ctables.sps],
1327 CTABLES /TABLE qn1 [COUNT COLPCT].
1328 CTABLES /TABLE qn1 [COUNT COLPCT]
1329 /SLABELS POSITION=ROW.
1330 CTABLES /TABLE qn1 [COUNT COLPCT]
1331 /SLABELS POSITION=ROW VISIBLE=NO.
1333 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1335 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1338 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1339 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1340 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1341 │ Once a week or less│ 361│ 5.2%│
1342 │ Only certain times │ 130│ 1.9%│
1344 │ Never │ 540│ 7.7%│
1345 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1348 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1349 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1350 │other motor vehicle? Column │66.9%│
1352 │ ╶───────────────────────────┼─────┤
1353 │ Several days a week Count │ 1274│
1356 │ ╶───────────────────────────┼─────┤
1357 │ Once a week or less Count │ 361│
1360 │ ╶───────────────────────────┼─────┤
1361 │ Only certain times Count │ 130│
1362 │ a year Column │ 1.9%│
1364 │ ╶───────────────────────────┼─────┤
1365 │ Never Count │ 540│
1368 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1371 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1372 │ 1. How often do you usually drive a car or other Every day │ 4667│
1373 │motor vehicle? │66.9%│
1374 │ Several days a week │ 1274│
1376 │ Once a week or less │ 361│
1378 │ Only certain times a │ 130│
1382 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1386 AT_SETUP([CTABLES simple totals])
1387 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1388 AT_DATA([ctables.sps],
1391 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1392 DESCRIPTIVES qn18/STATISTICS=MEAN.
1393 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1394 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1396 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1398 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1400 ├────────────────────────────────────────────────────────────────────────┼─────┤
1401 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1402 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1405 │ Wine coolers │ 137│
1406 │ Hard liquor or │ 888│
1408 │ Flavored malt │ 83│
1410 │ Number responding │ 4221│
1411 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1413 Descriptive Statistics
1414 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1416 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1417 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1418 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1419 │Valid N (listwise) │6999│ │
1420 │Missing N (listwise) │2781│ │
1421 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1424 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1425 │ │ │ │ Valid│Total│
1426 │ │Mean│Count│ N │ N │
1427 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1428 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1429 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1430 │ you usually drink per sitting? │ │ │ │ │
1431 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1432 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1433 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1434 │ you usually drink per sitting? │ │ │ │ │
1435 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1436 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1437 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1438 │ you usually drink per sitting? │ │ │ │ │
1439 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1440 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1441 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1442 │ you usually drink per sitting? │ │ │ │ │
1443 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1444 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1445 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1446 │ you usually drink per sitting? │ │ │ │ │
1447 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1451 AT_SETUP([CTABLES subtotals])
1452 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1453 AT_DATA([ctables.sps],
1455 CTABLES /TABLE=qn105ba BY qns1
1456 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1457 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1458 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1459 CTABLES /TABLE=qn105ba BY qns1
1460 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1461 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1463 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1465 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1466 │ │ S1. Including yourself, how many members of this household │
1467 │ │ are age 16 or older? │
1468 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1469 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1470 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1471 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1472 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1473 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1474 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1475 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1476 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1477 │ likely │ │ │ │ │ │ │ │
1478 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1479 │ unlikely │ │ │ │ │ │ │ │
1480 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1481 │ unlikely │ │ │ │ │ │ │ │
1482 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1485 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1486 │ │ S1. Including yourself, how many members of this household │
1487 │ │ are age 16 or older? │
1488 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1489 │ │ │ │ │ │ │ │ 6 or │
1490 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1491 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1492 │ │ │ │ │ │ Column│ │ │
1493 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1494 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1495 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1496 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1497 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1498 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1499 │ likely │ │ │ │ │ │ │ │
1500 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1501 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1502 │ unlikely │ │ │ │ │ │ │ │
1503 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1504 │ unlikely │ │ │ │ │ │ │ │
1505 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1506 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1509 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1510 │ │ S1. Including yourself, how many members of this household │
1511 │ │ are age 16 or older? │
1512 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1513 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1514 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1515 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1516 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1517 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1518 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1519 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1520 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1521 │ likely │ │ │ │ │ │ │ │
1522 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1523 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1524 │ unlikely │ │ │ │ │ │ │ │
1525 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1526 │ unlikely │ │ │ │ │ │ │ │
1527 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1528 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1532 AT_SETUP([CTABLES PCOMPUTE])
1533 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1534 AT_DATA([ctables.sps],
1537 /PCOMPUTE &x=EXPR([3] + [4])
1538 /PCOMPUTE &y=EXPR([4] + [5])
1539 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1540 /PPROPERTIES &y LABEL='4+5'
1541 /TABLE=qn105ba BY qns1
1542 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1544 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1546 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1547 │ │ S1. Including yourself, how many members of this household │
1548 │ │ are age 16 or older? │
1549 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1550 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1551 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1552 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1553 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1554 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1555 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1556 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1557 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1558 │ likely │ │ │ │ │ │ │ │
1559 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1560 │ unlikely │ │ │ │ │ │ │ │
1561 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1562 │ unlikely │ │ │ │ │ │ │ │
1563 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1567 AT_SETUP([CTABLES CLABELS])
1568 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1569 AT_DATA([ctables.sps],
1571 CTABLES /TABLE AgeGroup BY qns3a.
1572 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1573 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1574 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1575 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1578 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1580 ╭───────────────────────┬────────────╮
1586 ├───────────────────────┼─────┼──────┤
1587 │Age group 15 or younger│ 0│ 0│
1588 │ 16 to 25 │ 594│ 505│
1589 │ 26 to 35 │ 476│ 491│
1590 │ 36 to 45 │ 489│ 548│
1591 │ 46 to 55 │ 526│ 649│
1592 │ 56 to 65 │ 516│ 731│
1593 │ 66 or older │ 531│ 943│
1594 ╰───────────────────────┴─────┴──────╯
1597 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1599 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1601 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1602 │ │ 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 │
1603 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1604 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1605 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1606 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1607 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1608 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1609 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1612 ╭──────────────────────────────┬────────────╮
1616 ├──────────────────────────────┼────────────┤
1617 │Age group 15 or younger Male │ 0│
1619 │ ╶────────────────────┼────────────┤
1620 │ 16 to 25 Male │ 594│
1622 │ ╶────────────────────┼────────────┤
1623 │ 26 to 35 Male │ 476│
1625 │ ╶────────────────────┼────────────┤
1626 │ 36 to 45 Male │ 489│
1628 │ ╶────────────────────┼────────────┤
1629 │ 46 to 55 Male │ 526│
1631 │ ╶────────────────────┼────────────┤
1632 │ 56 to 65 Male │ 516│
1634 │ ╶────────────────────┼────────────┤
1635 │ 66 or older Male │ 531│
1637 ╰──────────────────────────────┴────────────╯
1641 ╭─────────┬────────────╮
1647 ├─────────┼─────┼──────┤
1649 ╰─────────┴─────┴──────╯
1653 ╭─────────┬────────────╮
1659 ├─────────┼─────┼──────┤
1660 │Age group│ 594│ 505│
1661 ╰─────────┴─────┴──────╯
1665 ╭─────────┬────────────╮
1671 ├─────────┼─────┼──────┤
1672 │Age group│ 476│ 491│
1673 ╰─────────┴─────┴──────╯
1677 ╭─────────┬────────────╮
1683 ├─────────┼─────┼──────┤
1684 │Age group│ 489│ 548│
1685 ╰─────────┴─────┴──────╯
1689 ╭─────────┬────────────╮
1695 ├─────────┼─────┼──────┤
1696 │Age group│ 526│ 649│
1697 ╰─────────┴─────┴──────╯
1701 ╭─────────┬────────────╮
1707 ├─────────┼─────┼──────┤
1708 │Age group│ 516│ 731│
1709 ╰─────────┴─────┴──────╯
1713 ╭─────────┬────────────╮
1719 ├─────────┼─────┼──────┤
1720 │Age group│ 531│ 943│
1721 ╰─────────┴─────┴──────╯
1725 ╭───────────────────────┬────────────╮
1729 ├───────────────────────┼────────────┤
1730 │Age group 15 or younger│ 0│
1736 │ 66 or older │ 531│
1737 ╰───────────────────────┴────────────╯
1741 ╭───────────────────────┬────────────╮
1745 ├───────────────────────┼────────────┤
1746 │Age group 15 or younger│ 0│
1752 │ 66 or older │ 943│
1753 ╰───────────────────────┴────────────╯
1757 AT_SETUP([CTABLES missing values])
1758 AT_DATA([ctables.sps],
1759 [[DATA LIST LIST NOTABLE/x y.
1798 MISSING VALUES x (1, 2) y (2, 3).
1799 VARIABLE LEVEL ALL (NOMINAL).
1801 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1802 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1803 /CATEGORIES VARIABLES=ALL TOTAL=YES.
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 MISSING=INCLUDE.
1807 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1808 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1809 /CATEGORIES VARIABLES=ALL TOTAL=YES
1810 /SLABELS POSITION=ROW.
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 MISSING=INCLUDE
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=x [1, 2, 3, 4] TOTAL=YES
1818 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1819 /SLABELS POSITION=ROW.
1821 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1823 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1824 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1825 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1826 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1827 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1828 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1829 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1830 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1831 dnl Note that Column Total N % doesn't add up to 100 because missing
1832 dnl values are included in the total but not shown as a category and this
1833 dnl is expected behavior.
1836 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1837 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1838 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1839 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1840 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1841 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1842 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1843 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1844 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1845 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1846 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1847 dnl values are included in the total but not shown as a category and this
1848 dnl is expected behavior.
1851 ╭────────────────────────┬───────────────────────────╮
1853 │ ├──────┬──────┬──────┬──────┤
1854 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1855 ├────────────────────────┼──────┼──────┼──────┼──────┤
1856 │x 3.00 Count │ 1│ 1│ 1│ 3│
1857 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1858 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1859 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1860 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1861 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1862 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1863 │ Valid N │ │ │ │ 3│
1864 │ Total N │ │ │ │ 6│
1865 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1866 │ 4.00 Count │ 1│ 1│ 1│ 3│
1867 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1868 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1869 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1870 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1871 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1872 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1873 │ Valid N │ │ │ │ 3│
1874 │ Total N │ │ │ │ 6│
1875 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1876 │ 5.00 Count │ 1│ 1│ 1│ 3│
1877 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1878 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1879 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1880 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1881 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1882 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1883 │ Valid N │ │ │ │ 3│
1884 │ Total N │ │ │ │ 6│
1885 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1886 │ Total Count │ 3│ 3│ 3│ 9│
1887 │ Column % │100.0%│100.0%│100.0%│ .│
1888 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1889 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1890 │ Row % │ .│ .│ .│ .│
1891 │ Row Valid N % │ .│ .│ .│ .│
1892 │ Row Total N % │ .│ .│ .│ .│
1893 │ Valid N │ 3│ 3│ 3│ 9│
1894 │ Total N │ 6│ 6│ 6│ 36│
1895 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1898 ╭────────────────────────┬─────────────────────────────────────────╮
1900 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1901 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1902 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1903 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1904 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1905 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1906 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1907 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1908 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1909 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1910 │ Valid N │ │ │ │ │ │ 0│
1911 │ Total N │ │ │ │ │ │ 6│
1912 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1913 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1914 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1915 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1916 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1917 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1918 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1919 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1920 │ Valid N │ │ │ │ │ │ 0│
1921 │ Total N │ │ │ │ │ │ 6│
1922 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1923 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1924 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1925 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1926 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1927 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1928 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1929 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1930 │ Valid N │ │ │ │ │ │ 3│
1931 │ Total N │ │ │ │ │ │ 6│
1932 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1933 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1934 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1935 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1936 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1937 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1938 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1939 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1940 │ Valid N │ │ │ │ │ │ 3│
1941 │ Total N │ │ │ │ │ │ 6│
1942 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1943 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1944 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1945 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1946 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1947 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1948 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1949 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1950 │ Valid N │ │ │ │ │ │ 3│
1951 │ Total N │ │ │ │ │ │ 6│
1952 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1953 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1954 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1955 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1956 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1957 │ Row % │ .│ .│ .│ .│ .│ .│
1958 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1959 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1960 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1961 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1962 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1965 ╭────────────────────────┬──────────────────────────────────╮
1967 │ ├──────┬──────┬──────┬──────┬──────┤
1968 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1969 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1970 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1971 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1972 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1973 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1974 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1975 │ Row Valid N % │ .│ .│ .│ .│ .│
1976 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1977 │ Valid N │ │ │ │ │ 0│
1978 │ Total N │ │ │ │ │ 6│
1979 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1980 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1981 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1982 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1983 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1984 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1985 │ Row Valid N % │ .│ .│ .│ .│ .│
1986 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1987 │ Valid N │ │ │ │ │ 0│
1988 │ Total N │ │ │ │ │ 6│
1989 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1990 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1991 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1992 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1993 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1994 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1995 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1996 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1997 │ Valid N │ │ │ │ │ 3│
1998 │ Total N │ │ │ │ │ 6│
1999 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2000 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2001 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2002 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2003 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2004 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2005 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2006 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2007 │ Valid N │ │ │ │ │ 3│
2008 │ Total N │ │ │ │ │ 6│
2009 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2010 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2011 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2012 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2013 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2014 │ Row % │ .│ .│ .│ .│ .│
2015 │ Row Valid N % │ .│ .│ .│ .│ .│
2016 │ Row Total N % │ .│ .│ .│ .│ .│
2017 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2018 │ Total N │ 5│ 5│ 5│ 5│ 30│
2019 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2023 AT_SETUP([CTABLES SMISSING=LISTWISE])
2024 AT_KEYWORDS([SMISSING LISTWISE])
2025 AT_DATA([ctables.sps],
2026 [[DATA LIST LIST NOTABLE/x y z.
2034 VARIABLE LEVEL x (NOMINAL).
2036 CTABLES /TABLE (y + z) > x.
2037 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2039 * The following doesn't come out as listwise because the tables are
2040 separate, not linked by an > operator.
2041 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2043 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2073 AT_SETUP([CTABLES VLABELS])
2074 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2075 AT_DATA([ctables.sps],
2077 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2078 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2079 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2080 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2081 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2083 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2085 ╭────────────────────────────────────────────────────────────────┬────────────╮
2091 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2092 │D5a. What would you say is your primary Cuban │ 13│ 7│
2093 │ethnic background? Mexican │ 175│ 136│
2095 │ South American │ 21│ 13│
2096 │ Central American │ 27│ 25│
2097 │ Puerto Rican, OR │ 37│ 41│
2098 │ Something else │ 35│ 33│
2099 │ Multiple - cannot │ 2│ 5│
2101 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2104 ╭──────────────────────────────────┬────────────╮
2110 ├──────────────────────────────────┼─────┼──────┤
2111 │QND5A Cuban │ 13│ 7│
2112 │ Mexican │ 175│ 136│
2114 │ South American │ 21│ 13│
2115 │ Central American │ 27│ 25│
2116 │ Puerto Rican, OR │ 37│ 41│
2117 │ Something else │ 35│ 33│
2118 │ Multiple - cannot choose one│ 2│ 5│
2119 ╰──────────────────────────────────┴─────┴──────╯
2122 ╭────────────────────────────────────────────────────────────────┬────────────╮
2128 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2129 │D5a. What would you say is your primary Cuban │ 13│ 7│
2130 │ethnic background? Mexican │ 175│ 136│
2132 │ South American │ 21│ 13│
2133 │ Central American │ 27│ 25│
2134 │ Puerto Rican, OR │ 37│ 41│
2135 │ Something else │ 35│ 33│
2136 │ Multiple - cannot │ 2│ 5│
2138 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2141 ╭────────────────────────────────────────────────────────────┬────────────────╮
2144 │ ├───────┬────────┤
2146 │ ├───────┼────────┤
2148 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2149 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2150 │primary ethnic background? Mexican │ 175│ 136│
2152 │ South American │ 21│ 13│
2153 │ Central American │ 27│ 25│
2154 │ Puerto Rican, OR │ 37│ 41│
2155 │ Something else │ 35│ 33│
2156 │ Multiple - cannot │ 2│ 5│
2158 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2161 ╭────────────────────────────┬─────┬──────╮
2165 ├────────────────────────────┼─────┼──────┤
2167 │Mexican │ 175│ 136│
2169 │South American │ 21│ 13│
2170 │Central American │ 27│ 25│
2171 │Puerto Rican, OR │ 37│ 41│
2172 │Something else │ 35│ 33│
2173 │Multiple - cannot choose one│ 2│ 5│
2174 ╰────────────────────────────┴─────┴──────╯
2178 AT_SETUP([CTABLES FORMAT EMPTY])
2179 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2180 AT_DATA([ctables.sps],
2182 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2183 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2184 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2186 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2188 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2189 │ │ D5. ETHNICITY: Are you of │
2190 │ │ Hispanic or Latino origin or │
2192 │ ├───────────────┬───────────────┤
2194 │ ├───────────────┼───────────────┤
2196 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2197 │D5a. What would you say is Cuban │ 20│ 0│
2198 │your primary ethnic Mexican │ 311│ 0│
2199 │background? Spanish │ 48│ 0│
2200 │ South American │ 34│ 0│
2201 │ Central American│ 52│ 0│
2202 │ Puerto Rican, OR│ 78│ 0│
2203 │ Something else │ 68│ 0│
2204 │ Multiple - │ 7│ 0│
2205 │ cannot choose │ │ │
2207 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2210 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2211 │ │ D5. ETHNICITY: Are you of │
2212 │ │ Hispanic or Latino origin or │
2214 │ ├───────────────┬───────────────┤
2216 │ ├───────────────┼───────────────┤
2218 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2219 │D5a. What would you say is Cuban │ 20│ │
2220 │your primary ethnic Mexican │ 311│ │
2221 │background? Spanish │ 48│ │
2222 │ South American │ 34│ │
2223 │ Central American│ 52│ │
2224 │ Puerto Rican, OR│ 78│ │
2225 │ Something else │ 68│ │
2227 │ cannot choose │ │ │
2229 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2232 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2233 │ │ D5. ETHNICITY: Are you of │
2234 │ │ Hispanic or Latino origin or │
2236 │ ├───────────────┬───────────────┤
2238 │ ├───────────────┼───────────────┤
2240 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2241 │D5a. What would you say is Cuban │ 20│n/a │
2242 │your primary ethnic Mexican │ 311│n/a │
2243 │background? Spanish │ 48│n/a │
2244 │ South American │ 34│n/a │
2245 │ Central American│ 52│n/a │
2246 │ Puerto Rican, OR│ 78│n/a │
2247 │ Something else │ 68│n/a │
2248 │ Multiple - │ 7│n/a │
2249 │ cannot choose │ │ │
2251 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2255 AT_SETUP([CTABLES FORMAT MISSING])
2256 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2257 AT_DATA([ctables.sps],
2259 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2261 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2263 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2264 │ │ D5. ETHNICITY: Are you of │
2265 │ │ Hispanic or Latino origin or │
2267 │ ├───────────────┬───────────────┤
2269 │ ├───────────────┼───────────────┤
2270 │ │ Column % │ Column % │
2271 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2272 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2273 │your primary ethnic Mexican │ 50.3%│(no data) │
2274 │background? Spanish │ 7.8%│(no data) │
2275 │ South American │ 5.5%│(no data) │
2276 │ Central American│ 8.4%│(no data) │
2277 │ Puerto Rican, OR│ 12.6%│(no data) │
2278 │ Something else │ 11.0%│(no data) │
2279 │ Multiple - │ 1.1%│(no data) │
2280 │ cannot choose │ │ │
2282 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2286 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2287 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2288 AT_DATA([ctables.sps],
2290 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2291 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2292 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2294 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2296 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2298 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2299 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2300 │occasion? 1 │ 491│ 34.9%│
2320 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2323 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2325 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2326 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2327 │occasion? 1 │ 491│ 34.9%│
2347 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2350 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2352 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2353 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2354 │occasion? 1 │ 491│ 34.9%│
2374 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯