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.
21 dnl - HIDESMALLCOUNTS.
22 dnl - Date/time variables and values
23 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
24 dnl - TITLES: )DATE, )TIME, )TABLE.
26 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
27 dnl * MISSING, OTHERNM
28 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
32 dnl - Summary functions:
33 dnl * U-prefix for unweighted summaries.
34 dnl * areaPCT.SUM and UareaPCT.SUM functions.
35 dnl - SPLIT FILE with SEPARATE splits
36 dnl - Definition of columns/rows when labels are rotated from one axis to another.
39 dnl - Multiple response sets
40 dnl - MRSETS subcommand.
41 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
44 dnl - Summary functions:
45 dnl * .LCL and .UCL suffixes.
48 dnl * Data-dependent sorting.
50 AT_SETUP([CTABLES parsing])
51 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
52 AT_DATA([ctables.sps],
55 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
56 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
57 /FORMAT UNITS=CM EMPTY="(-)"
58 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
59 /VLABELS VARIABLES=qn17 DISPLAY=NAME
60 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
61 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
62 /VLABELS VARIABLES=qn20 DISPLAY=NONE
63 /MRSETS COUNTDUPLICATES=NO
64 /MRSETS COUNTDUPLICATES=YES
67 /WEIGHT VARIABLE=qns3a
69 /HIDESMALLCOUNTS COUNT=10
71 /SLABELS POSITION=COLUMN VISIBLE=YES
72 /SLABELS VISIBLE=NO POSITION=ROW
73 /SLABELS POSITION=LAYER
75 /CLABELS ROWLABELS=OPPOSITE
77 /CATEGORIES VARIABLES=qn1 qn17
78 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
79 POSITION=BEFORE EMPTY=INCLUDE.
80 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
81 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
82 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
84 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
87 ╭───────────────────┬────┬────╮
89 ├───────────────────┼────┼────┤
90 │Sa1. SAMPLE SOURCE:│5392│1607│
91 ╰───────────────────┴────┴────╯
95 ╭───────────────────┬─────╮
97 ├───────────────────┼─────┤
98 │Sa1. SAMPLE SOURCE:│ 5392│
99 ╰───────────────────┴─────╯
102 ╭────────────────────────┬─────╮
104 ├────────────────────────┼─────┤
105 │Sa1. SAMPLE SOURCE: RDD │ 5392│
107 ╰────────────────────────┴─────╯
110 ╭────────────────────────┬─────╮
112 ├────────────────────────┼─────┤
113 │Sa1. SAMPLE SOURCE: RDD │ 5392│
115 ╰────────────────────────┴─────╯
119 AT_SETUP([CTABLES parsing - negative])
120 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
121 AT_DATA([ctables.sps],
124 CTABLES /FORMAT MINCOLWIDTH='foo'.
125 CTABLES /TABLE qn1 [**].
126 CTABLES /TABLE qn1 [NOTAFUNCTION].
129 CTABLES /TABLE NOTAVAR.
131 CTABLES /TABLE string[S].
132 CTABLES /TABLE qn1 [PTILE 101].
133 CTABLES /TABLE qn1 [MEAN F0.1].
134 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
135 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
136 CTABLES /TABLE qn1 [MEAN TOTALS].
137 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
138 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
155 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
156 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
157 CTABLES /PCOMPUTE &k=EXPR([LO **]).
158 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
159 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
160 CTABLES /PCOMPUTE &k=EXPR([1**]).
161 CTABLES /PCOMPUTE &k=EXPR((1x)).
162 CTABLES /PCOMPUTE **k.
163 CTABLES /PCOMPUTE &1.
164 CTABLES /PCOMPUTE &k**.
165 CTABLES /PCOMPUTE &k=**.
166 CTABLES /PCOMPUTE &k=EXPR**.
167 CTABLES /PCOMPUTE &k=EXPR(1x).
168 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
169 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
170 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
174 CTABLES /FORMAT EMPTY=**.
175 CTABLES /FORMAT MISSING=**.
177 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
179 CTABLES /VLABELS VARIABLES=NOTAVAR.
180 CTABLES /VLABELS VARIABLES=qn1 **.
181 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
183 CTABLES /MRSETS COUNTDUPLICATES=**.
184 CTABLES /SMISSING **.
186 CTABLES /WEIGHT VARIABLE=NOTAVAR.
187 CTABLES /HIDESMALLCOUNTS COUNT=1.
189 CTABLES /HIDESMALLCOUNTS COUNT=2.
190 CTABLES /TABLE qn1**.
191 CTABLES /TABLE qn1 /SLABELS POSITION=**.
192 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
193 CTABLES /TABLE qn1 /SLABELS **.
194 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
195 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
196 CTABLES /TABLE qn1 /CLABELS **.
197 CTABLES /TABLE qn1 /CRITERIA **.
198 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
199 CTABLES /TABLE qn1 /TITLES **.
200 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
201 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
202 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
203 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
204 CTABLES /TABLE qn1 /SIGTEST **.
205 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
206 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
207 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
208 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
209 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
210 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
211 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
212 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
213 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
214 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
215 CTABLES /TABLE qn1 /COMPARETEST **.
216 CTABLES /TABLE qn1 / **.
217 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
218 CTABLES /TABLE qn20 > qnd1.
219 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
220 NUMERIC datetime (DATETIME17.0).
221 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
223 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
224 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
226 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
227 negative number for MINCOLWIDTH.
229 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
232 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
233 summary function name.
235 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
237 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
240 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
242 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
244 10 | CTABLES /TABLE string[S].
247 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
248 between 0 and 100 for PTILE.
250 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
251 requires a width between 1 and 40.
253 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
254 format NEGPAREN requires width 2 or greater.
256 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
257 format NEGPAREN requires width greater than decimals.
259 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
261 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
264 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
265 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
268 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
270 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
272 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
275 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
276 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
279 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
281 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
283 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
285 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
287 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
289 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
291 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
294 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
295 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
298 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
299 between 0 and 100 for PTILE.
301 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
304 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
307 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
310 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
313 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
315 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
318 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
321 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
322 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
324 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
325 LABEL, POSITION, or EMPTY.
327 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
328 integer for SUBTOTAL.
330 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
332 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
334 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
336 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
338 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
340 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
342 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
344 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
346 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
348 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
350 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
352 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
354 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
355 the previous definition.
356 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
357 | ^~~~~~~~~~~~~~~~~~~
359 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
360 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
361 | ^~~~~~~~~~~~~~~~~~~
363 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
366 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
367 Expecting summary function name.
369 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
370 between 0 and 100 for PTILE.
372 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
374 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
377 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
378 FORMAT, or HIDESOURCECATS.
380 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
382 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
384 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
385 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
387 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
390 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
393 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
395 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
398 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
399 DEFAULT, NAME, LABEL, BOTH, or NONE.
401 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
404 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
407 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
408 VARIABLE or LISTWISE.
410 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
413 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
415 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
416 greater for HIDESMALLCOUNTS COUNT.
418 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
419 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
420 HIDESMALLCOUNTS, or TABLE.
422 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
425 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
427 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
430 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
433 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
436 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
439 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
442 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
443 ROWLABELS, or COLLABELS.
445 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
448 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
449 in @<:@0,100@:}@ for CILEVEL.
451 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
452 CAPTION, CORNER, or TITLE.
454 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
457 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
458 in @<:@0,1@:}@ for ALPHA.
460 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
463 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
464 ALLVISIBLE or SUBTOTALS.
466 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
467 ALPHA, INCLUDEMRSETS, or CATEGORIES.
469 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
472 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
475 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
478 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
479 BONFERRONI, BH, or NONE.
481 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
484 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
487 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
488 ALLVISIBLE or SUBTOTALS.
490 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
493 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
496 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
499 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
500 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
503 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
504 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
506 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
509 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
510 97 | CTABLES /TABLE qn20 > qnd1.
513 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
514 97 | CTABLES /TABLE qn20 > qnd1.
517 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
518 97 | CTABLES /TABLE qn20 > qnd1.
521 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
522 categorical variables at the innermost nesting level.
523 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
524 | ^~~~~~~~~~~~~~~~~~~~
526 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
528 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
531 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
532 specification as format DATETIME: Day (123) must be between 1 and 31..
533 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
538 AT_SETUP([CTABLES parsing - more negative])
539 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
540 AT_DATA([ctables.sps],
542 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
543 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
544 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
547 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
548 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
550 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
552 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
553 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
554 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
555 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
557 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
558 CTABLES /PCOMPUTE &x=EXPR([**]).
559 CTABLES /PCOMPUTE &x=EXPR(**).
563 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
565 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
566 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
567 category not included in the category list.
568 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
573 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
574 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
578 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
579 list of categories here.
580 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
585 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
586 category not included in the category list.
587 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
592 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
593 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
597 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
598 variable's CATEGORIES specification.
600 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
601 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
602 subtotals by position, e.g. SUBTOTAL[1].
603 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
604 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
606 ^~~~~~~~~~~~~~~~~~~~~~~~
608 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
610 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
611 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
614 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
615 applied only to string variables, but this subcommand tries to apply it to
616 numeric variable QN1.
617 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
620 ctables.sps:8.53: error: CTABLES: This category specification may be applied
621 only to numeric variables, but this subcommand tries to apply it to string
623 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
626 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
627 based on a summary function.
629 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
630 moved to be categorical, but qnd1 is a scale variable.
632 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
633 moved to have the same width, but QN1 has width 0 and string has width 8.
635 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
636 moved to have the same value labels, but QN1 and QNSA1 have different value
639 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
640 moved to have the same category specifications, but QN105BA and QN105BB have
641 different category specifications.
643 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
644 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
645 this warning, insert parentheses.
646 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
649 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
652 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
654 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
656 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
657 variable must be specified.
659 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
661 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
663 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
666 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
668 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
671 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
673 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
678 AT_SETUP([CTABLES one categorical variable])
679 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
680 AT_DATA([ctables.sps],
683 CTABLES /TABLE BY qn1.
684 CTABLES /TABLE BY BY qn1.
686 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
688 ╭────────────────────────────────────────────────────────────────────────┬─────╮
690 ├────────────────────────────────────────────────────────────────────────┼─────┤
691 │ 1. How often do you usually drive a car or other Every day │ 4667│
692 │motor vehicle? Several days a week │ 1274│
693 │ Once a week or less │ 361│
694 │ Only certain times a │ 130│
697 ╰────────────────────────────────────────────────────────────────────────┴─────╯
700 ╭──────────────────────────────────────────────────────────────────────────────╮
701 │ 1. How often do you usually drive a car or other motor vehicle? │
702 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
703 │ │ Several days a │ Once a week or │ Only certain times a │ │
704 │Every day│ week │ less │ year │Never│
705 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
706 │ Count │ Count │ Count │ Count │Count│
707 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
708 │ 4667│ 1274│ 361│ 130│ 540│
709 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
721 AT_SETUP([CTABLES one string variable])
722 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
723 AT_DATA([ctables.sps],
726 MISSING VALUES licensed('DontKnow', 'Refused').
727 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
728 CTABLES /TABLE licensed.
729 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
730 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
731 * Notice that the string matching is case-sensitive.
732 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
733 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
735 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
736 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
738 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
740 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
741 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
743 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
745 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
755 ╭─────────────────┬─────┬───────╮
757 ├─────────────────┼─────┼───────┤
758 │licensed DontKnow│ 4│ │
762 │ Total │ 6999│ 6951│
763 ╰─────────────────┴─────┴───────╯
766 ╭──────────────┬─────╮
768 ├──────────────┼─────┤
769 │licensed Yes │ 6379│
772 ╰──────────────┴─────╯
775 ╭──────────────┬─────╮
777 ├──────────────┼─────┤
778 │licensed Yes │ 6379│
781 ╰──────────────┴─────╯
784 ╭────────────────┬─────╮
786 ├────────────────┼─────┤
791 ╰────────────────┴─────╯
794 ╭────────────────┬─────╮
796 ├────────────────┼─────┤
797 │licensed Yes │ 6379│
799 ╰────────────────┴─────╯
802 ╭────────────────┬─────╮
804 ├────────────────┼─────┤
805 │licensed Yes │ 6379│
807 ╰────────────────┴─────╯
811 AT_SETUP([CTABLES one scale variable])
812 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
813 AT_DATA([ctables.sps],
815 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
816 CTABLES /TABLE BY qnd1.
817 CTABLES /TABLE BY BY qnd1.
819 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
821 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
822 │ │ │ │ │ │ Std │ │ │
823 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
824 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
825 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
826 │age? │ │ │ │ │ │ │ │
827 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
830 ╭──────────────────────────╮
831 │D1. AGE: What is your age?│
832 ├──────────────────────────┤
834 ├──────────────────────────┤
836 ╰──────────────────────────╯
839 D1. AGE: What is your age?
848 AT_SETUP([CTABLES simple stacking])
849 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
850 AT_DATA([ctables.sps],
852 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
854 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
856 ╭───────────────────────────────────────────────────────────────┬──────────────╮
863 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
864 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
865 │too much to drink to drive safely will A. Get certain │ │ │
866 │stopped by the police? Very likely │ 21%│ 22%│
867 │ Somewhat │ 38%│ 42%│
869 │ Somewhat │ 21%│ 18%│
873 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
874 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
875 │too much to drink to drive safely will B. Have an certain │ │ │
876 │accident? Very likely │ 36%│ 45%│
877 │ Somewhat │ 39%│ 32%│
883 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
884 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
885 │too much to drink to drive safely will C. Be certain │ │ │
886 │convicted for drunk driving? Very likely │ 32%│ 28%│
887 │ Somewhat │ 27%│ 32%│
889 │ Somewhat │ 15%│ 15%│
893 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
894 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
895 │too much to drink to drive safely will D. Be certain │ │ │
896 │arrested for drunk driving? Very likely │ 26%│ 27%│
897 │ Somewhat │ 32%│ 35%│
899 │ Somewhat │ 17%│ 15%│
903 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
907 AT_SETUP([CTABLES show or hide empty categories])
908 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
909 AT_DATA([ctables.sps],
911 IF (qn105ba = 2) qn105ba = 1.
912 IF (qns3a = 1) qns3a = 2.
913 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
914 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
915 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
916 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
917 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
918 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
919 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
921 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
923 ╭──────────────────────────────────────────────────────────────┬───────────────╮
930 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
931 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
932 │too much to drink to drive safely will A. Get certain │ │ │
933 │stopped by the police? Very likely│ .│ 0%│
940 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
943 ╭──────────────────────────────────────────────────────────────┬───────────────╮
950 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
951 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
952 │too much to drink to drive safely will A. Get certain │ │ │
953 │stopped by the police? Somewhat │ .│ 40%│
959 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
962 ╭────────────────────────────────────────────────────────────────────┬─────────╮
969 ├────────────────────────────────────────────────────────────────────┼─────────┤
970 │105b. How likely is it that drivers who have had too Almost │ 32%│
971 │much to drink to drive safely will A. Get stopped by certain │ │
972 │the police? Very likely │ 0%│
979 ╰────────────────────────────────────────────────────────────────────┴─────────╯
982 ╭────────────────────────────────────────────────────────────────────┬─────────╮
989 ├────────────────────────────────────────────────────────────────────┼─────────┤
990 │105b. How likely is it that drivers who have had too Almost │ 32%│
991 │much to drink to drive safely will A. Get stopped by certain │ │
992 │the police? Somewhat │ 40%│
998 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1002 AT_SETUP([CTABLES simple nesting])
1003 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1004 AT_DATA([ctables.sps],
1006 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1007 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1008 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1009 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1010 /CLABELS ROW=OPPOSITE.
1012 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1014 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1017 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1018 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1019 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1020 │drive safely will A. Get stopped by Total │ 700│ 10%│
1021 │the police? ╶──────────────────────────┼─────┼──────┤
1022 │ Very S3a. Male │ 660│ 10%│
1023 │ likely GENDER: Female│ 842│ 12%│
1024 │ Total │ 1502│ 22%│
1025 │ ╶──────────────────────────┼─────┼──────┤
1026 │ Somewhat S3a. Male │ 1174│ 17%│
1027 │ likely GENDER: Female│ 1589│ 23%│
1028 │ Total │ 2763│ 40%│
1029 │ ╶──────────────────────────┼─────┼──────┤
1030 │ Somewhat S3a. Male │ 640│ 9%│
1031 │ unlikely GENDER: Female│ 667│ 10%│
1032 │ Total │ 1307│ 19%│
1033 │ ╶──────────────────────────┼─────┼──────┤
1034 │ Very S3a. Male │ 311│ 5%│
1035 │ unlikely GENDER: Female│ 298│ 4%│
1037 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1038 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1039 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1040 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1041 │ ╶──────────────────────────┼─────┼──────┤
1042 │ Very S3a. Male │ 1104│ 16%│
1043 │ likely GENDER: Female│ 1715│ 25%│
1044 │ Total │ 2819│ 41%│
1045 │ ╶──────────────────────────┼─────┼──────┤
1046 │ Somewhat S3a. Male │ 1203│ 17%│
1047 │ likely GENDER: Female│ 1214│ 18%│
1048 │ Total │ 2417│ 35%│
1049 │ ╶──────────────────────────┼─────┼──────┤
1050 │ Somewhat S3a. Male │ 262│ 4%│
1051 │ unlikely GENDER: Female│ 168│ 2%│
1053 │ ╶──────────────────────────┼─────┼──────┤
1054 │ Very S3a. Male │ 81│ 1%│
1055 │ unlikely GENDER: Female│ 59│ 1%│
1057 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1058 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1059 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1060 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1061 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1062 │ Very S3a. Male │ 988│ 14%│
1063 │ likely GENDER: Female│ 1049│ 15%│
1064 │ Total │ 2037│ 30%│
1065 │ ╶──────────────────────────┼─────┼──────┤
1066 │ Somewhat S3a. Male │ 822│ 12%│
1067 │ likely GENDER: Female│ 1210│ 18%│
1068 │ Total │ 2032│ 30%│
1069 │ ╶──────────────────────────┼─────┼──────┤
1070 │ Somewhat S3a. Male │ 446│ 7%│
1071 │ unlikely GENDER: Female│ 548│ 8%│
1073 │ ╶──────────────────────────┼─────┼──────┤
1074 │ Very S3a. Male │ 268│ 4%│
1075 │ unlikely GENDER: Female│ 354│ 5%│
1077 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1078 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1079 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1080 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1081 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1082 │ Very S3a. Male │ 805│ 12%│
1083 │ likely GENDER: Female│ 1029│ 15%│
1084 │ Total │ 1834│ 27%│
1085 │ ╶──────────────────────────┼─────┼──────┤
1086 │ Somewhat S3a. Male │ 975│ 14%│
1087 │ likely GENDER: Female│ 1332│ 19%│
1088 │ Total │ 2307│ 34%│
1089 │ ╶──────────────────────────┼─────┼──────┤
1090 │ Somewhat S3a. Male │ 535│ 8%│
1091 │ unlikely GENDER: Female│ 560│ 8%│
1092 │ Total │ 1095│ 16%│
1093 │ ╶──────────────────────────┼─────┼──────┤
1094 │ Very S3a. Male │ 270│ 4%│
1095 │ unlikely GENDER: Female│ 279│ 4%│
1097 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1100 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1101 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1102 │ │ certain│likely│ likely │ unlikely│unlikely│
1103 │ ├────────┼──────┼─────────┼─────────┼────────┤
1105 │ │ Table %│ % │ Table % │ Table % │ Table %│
1106 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1107 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1108 │GENDER: is it that drivers│ │ │ │ │ │
1109 │ who have had too │ │ │ │ │ │
1110 │ much to drink to │ │ │ │ │ │
1111 │ drive safely will │ │ │ │ │ │
1112 │ A. Get stopped by │ │ │ │ │ │
1113 │ the police? │ │ │ │ │ │
1114 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1115 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1116 │ is it that drivers│ │ │ │ │ │
1117 │ who have had too │ │ │ │ │ │
1118 │ much to drink to │ │ │ │ │ │
1119 │ drive safely will │ │ │ │ │ │
1120 │ A. Get stopped by │ │ │ │ │ │
1121 │ the police? │ │ │ │ │ │
1122 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1123 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1124 │ is it that drivers│ │ │ │ │ │
1125 │ who have had too │ │ │ │ │ │
1126 │ much to drink to │ │ │ │ │ │
1127 │ drive safely will │ │ │ │ │ │
1128 │ A. Get stopped by │ │ │ │ │ │
1129 │ the police? │ │ │ │ │ │
1130 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1131 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1132 │GENDER: is it that drivers│ │ │ │ │ │
1133 │ who have had too │ │ │ │ │ │
1134 │ much to drink to │ │ │ │ │ │
1135 │ drive safely will │ │ │ │ │ │
1136 │ B. Have an │ │ │ │ │ │
1137 │ accident? │ │ │ │ │ │
1138 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1139 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1140 │ is it that drivers│ │ │ │ │ │
1141 │ who have had too │ │ │ │ │ │
1142 │ much to drink to │ │ │ │ │ │
1143 │ drive safely will │ │ │ │ │ │
1144 │ B. Have an │ │ │ │ │ │
1145 │ accident? │ │ │ │ │ │
1146 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1147 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1148 │ is it that drivers│ │ │ │ │ │
1149 │ who have had too │ │ │ │ │ │
1150 │ much to drink to │ │ │ │ │ │
1151 │ drive safely will │ │ │ │ │ │
1152 │ B. Have an │ │ │ │ │ │
1153 │ accident? │ │ │ │ │ │
1154 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1155 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1156 │GENDER: is it that drivers│ │ │ │ │ │
1157 │ who have had too │ │ │ │ │ │
1158 │ much to drink to │ │ │ │ │ │
1159 │ drive safely will │ │ │ │ │ │
1160 │ C. Be convicted │ │ │ │ │ │
1161 │ for drunk driving?│ │ │ │ │ │
1162 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1163 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1164 │ is it that drivers│ │ │ │ │ │
1165 │ who have had too │ │ │ │ │ │
1166 │ much to drink to │ │ │ │ │ │
1167 │ drive safely will │ │ │ │ │ │
1168 │ C. Be convicted │ │ │ │ │ │
1169 │ for drunk driving?│ │ │ │ │ │
1170 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1171 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1172 │ is it that drivers│ │ │ │ │ │
1173 │ who have had too │ │ │ │ │ │
1174 │ much to drink to │ │ │ │ │ │
1175 │ drive safely will │ │ │ │ │ │
1176 │ C. Be convicted │ │ │ │ │ │
1177 │ for drunk driving?│ │ │ │ │ │
1178 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1179 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1180 │GENDER: is it that drivers│ │ │ │ │ │
1181 │ who have had too │ │ │ │ │ │
1182 │ much to drink to │ │ │ │ │ │
1183 │ drive safely will │ │ │ │ │ │
1184 │ D. Be arrested for│ │ │ │ │ │
1185 │ drunk driving? │ │ │ │ │ │
1186 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1187 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1188 │ is it that drivers│ │ │ │ │ │
1189 │ who have had too │ │ │ │ │ │
1190 │ much to drink to │ │ │ │ │ │
1191 │ drive safely will │ │ │ │ │ │
1192 │ D. Be arrested for│ │ │ │ │ │
1193 │ drunk driving? │ │ │ │ │ │
1194 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1195 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1196 │ is it that drivers│ │ │ │ │ │
1197 │ who have had too │ │ │ │ │ │
1198 │ much to drink to │ │ │ │ │ │
1199 │ drive safely will │ │ │ │ │ │
1200 │ D. Be arrested for│ │ │ │ │ │
1201 │ drunk driving? │ │ │ │ │ │
1202 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1206 AT_SETUP([CTABLES nesting and scale variables])
1207 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1208 AT_DATA([ctables.sps],
1210 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1211 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1212 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1213 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1214 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1216 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1218 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1224 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1225 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1226 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1228 │ Once a week or │ 44│ 54│
1230 │ Only certain │ 34│ 41│
1231 │ times a year │ │ │
1233 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1236 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1237 │ │Minimum│Maximum│Mean│
1238 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1239 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1240 │What is GENDER: months, has there been a │ │ │ │
1241 │your time when you felt you │ │ │ │
1242 │age? should cut down on your No │ 16│ 86│ 46│
1244 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1245 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1246 │ months, has there been a │ │ │ │
1247 │ time when you felt you │ │ │ │
1248 │ should cut down on your No │ 16│ 86│ 48│
1250 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1251 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1252 │What is GENDER: months, has there been a │ │ │ │
1253 │your time when people criticized No │ 16│ 86│ 46│
1254 │age? your drinking? │ │ │ │
1255 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1256 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1257 │ months, has there been a │ │ │ │
1258 │ time when people criticized No │ 16│ 86│ 48│
1259 │ your drinking? │ │ │ │
1260 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1263 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1264 │ │S1. Including yourself, how many members of this│
1265 │ │ household are age 16 or older? │
1266 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1267 │ │ │ │ │ │ │ │ 6 or │
1268 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1269 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1270 │ │Column│Column│Column│Column│Column│Column│Column│
1271 │ │ % │ % │ % │ % │ % │ % │ % │
1272 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1273 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1274 │SAMPLE How certain │ │ │ │ │ │ │ │
1275 │SOURCE: likely │ │ │ │ │ │ │ │
1276 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1277 │ that likely │ │ │ │ │ │ │ │
1278 │ drivers │ │ │ │ │ │ │ │
1279 │ who have │ │ │ │ │ │ │ │
1280 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1281 │ much to likely │ │ │ │ │ │ │ │
1282 │ drink to │ │ │ │ │ │ │ │
1283 │ drive │ │ │ │ │ │ │ │
1284 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1285 │ will A. unlikely│ │ │ │ │ │ │ │
1286 │ Get │ │ │ │ │ │ │ │
1287 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1288 │ by the unlikely│ │ │ │ │ │ │ │
1289 │ police? │ │ │ │ │ │ │ │
1290 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1293 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1296 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1297 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1298 │group typical month did you have one or more │ │ │
1299 │ alcoholic beverages to drink? │ │ │
1300 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1301 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1302 │ typical month did you have one or more │ │ │
1303 │ alcoholic beverages to drink? │ │ │
1304 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1305 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1306 │ typical month did you have one or more │ │ │
1307 │ alcoholic beverages to drink? │ │ │
1308 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1309 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1310 │ typical month did you have one or more │ │ │
1311 │ alcoholic beverages to drink? │ │ │
1312 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1313 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1314 │ typical month did you have one or more │ │ │
1315 │ alcoholic beverages to drink? │ │ │
1316 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1317 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1318 │ older typical month did you have one or more │ │ │
1319 │ alcoholic beverages to drink? │ │ │
1320 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1325 AT_SETUP([CTABLES SLABELS])
1326 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1327 AT_DATA([ctables.sps],
1329 CTABLES /TABLE qn1 [COUNT COLPCT].
1330 CTABLES /TABLE qn1 [COUNT COLPCT]
1331 /SLABELS POSITION=ROW.
1332 CTABLES /TABLE qn1 [COUNT COLPCT]
1333 /SLABELS POSITION=ROW VISIBLE=NO.
1335 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1337 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1340 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1341 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1342 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1343 │ Once a week or less│ 361│ 5.2%│
1344 │ Only certain times │ 130│ 1.9%│
1346 │ Never │ 540│ 7.7%│
1347 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1350 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1351 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1352 │other motor vehicle? Column │66.9%│
1354 │ ╶───────────────────────────┼─────┤
1355 │ Several days a week Count │ 1274│
1358 │ ╶───────────────────────────┼─────┤
1359 │ Once a week or less Count │ 361│
1362 │ ╶───────────────────────────┼─────┤
1363 │ Only certain times Count │ 130│
1364 │ a year Column │ 1.9%│
1366 │ ╶───────────────────────────┼─────┤
1367 │ Never Count │ 540│
1370 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1373 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1374 │ 1. How often do you usually drive a car or other Every day │ 4667│
1375 │motor vehicle? │66.9%│
1376 │ Several days a week │ 1274│
1378 │ Once a week or less │ 361│
1380 │ Only certain times a │ 130│
1384 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1388 AT_SETUP([CTABLES simple totals])
1389 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1390 AT_DATA([ctables.sps],
1393 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1394 DESCRIPTIVES qn18/STATISTICS=MEAN.
1395 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1396 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1398 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1400 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1402 ├────────────────────────────────────────────────────────────────────────┼─────┤
1403 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1404 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1407 │ Wine coolers │ 137│
1408 │ Hard liquor or │ 888│
1410 │ Flavored malt │ 83│
1412 │ Number responding │ 4221│
1413 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1415 Descriptive Statistics
1416 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1418 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1419 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1420 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1421 │Valid N (listwise) │6999│ │
1422 │Missing N (listwise) │2781│ │
1423 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1426 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1427 │ │ │ │ Valid│Total│
1428 │ │Mean│Count│ N │ N │
1429 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1430 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1431 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1432 │ you usually drink per sitting? │ │ │ │ │
1433 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1434 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1435 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1436 │ you usually drink per sitting? │ │ │ │ │
1437 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1438 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1439 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1440 │ you usually drink per sitting? │ │ │ │ │
1441 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1442 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1443 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1444 │ you usually drink per sitting? │ │ │ │ │
1445 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1446 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1447 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1448 │ you usually drink per sitting? │ │ │ │ │
1449 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1453 AT_SETUP([CTABLES subtotals])
1454 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1455 AT_DATA([ctables.sps],
1457 CTABLES /TABLE=qn105ba BY qns1
1458 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1459 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1460 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1461 CTABLES /TABLE=qn105ba BY qns1
1462 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1463 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1465 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1467 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1468 │ │ S1. Including yourself, how many members of this household │
1469 │ │ are age 16 or older? │
1470 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1471 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1472 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1473 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1474 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1475 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1476 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1477 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1478 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1479 │ likely │ │ │ │ │ │ │ │
1480 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1481 │ unlikely │ │ │ │ │ │ │ │
1482 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1483 │ unlikely │ │ │ │ │ │ │ │
1484 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1487 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1488 │ │ S1. Including yourself, how many members of this household │
1489 │ │ are age 16 or older? │
1490 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1491 │ │ │ │ │ │ │ │ 6 or │
1492 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1493 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1494 │ │ │ │ │ │ Column│ │ │
1495 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1496 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1497 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1498 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1499 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1500 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1501 │ likely │ │ │ │ │ │ │ │
1502 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1503 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1504 │ unlikely │ │ │ │ │ │ │ │
1505 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1506 │ unlikely │ │ │ │ │ │ │ │
1507 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1508 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1511 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1512 │ │ S1. Including yourself, how many members of this household │
1513 │ │ are age 16 or older? │
1514 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1515 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1516 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1517 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1518 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1519 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1520 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1521 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1522 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1523 │ likely │ │ │ │ │ │ │ │
1524 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1525 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1526 │ unlikely │ │ │ │ │ │ │ │
1527 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1528 │ unlikely │ │ │ │ │ │ │ │
1529 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1530 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1534 AT_SETUP([CTABLES PCOMPUTE])
1535 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1536 AT_DATA([ctables.sps],
1539 /PCOMPUTE &x=EXPR([3] + [4])
1540 /PCOMPUTE &y=EXPR([4] + [5])
1541 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
1542 /PPROPERTIES &y LABEL='4+5'
1543 /TABLE=qn105ba BY qns1
1544 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
1546 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1548 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1549 │ │ S1. Including yourself, how many members of this household │
1550 │ │ are age 16 or older? │
1551 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
1552 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
1553 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1554 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1555 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
1556 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
1557 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1558 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
1559 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
1560 │ likely │ │ │ │ │ │ │ │
1561 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
1562 │ unlikely │ │ │ │ │ │ │ │
1563 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
1564 │ unlikely │ │ │ │ │ │ │ │
1565 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
1569 AT_SETUP([CTABLES CLABELS])
1570 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1571 AT_DATA([ctables.sps],
1573 CTABLES /TABLE AgeGroup BY qns3a.
1574 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1575 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1576 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1577 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1580 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1582 ╭───────────────────────┬────────────╮
1588 ├───────────────────────┼─────┼──────┤
1589 │Age group 15 or younger│ 0│ 0│
1590 │ 16 to 25 │ 594│ 505│
1591 │ 26 to 35 │ 476│ 491│
1592 │ 36 to 45 │ 489│ 548│
1593 │ 46 to 55 │ 526│ 649│
1594 │ 56 to 65 │ 516│ 731│
1595 │ 66 or older │ 531│ 943│
1596 ╰───────────────────────┴─────┴──────╯
1599 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1601 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1603 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1604 │ │ 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 │
1605 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1606 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1607 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1608 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1609 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1610 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1611 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1614 ╭──────────────────────────────┬────────────╮
1618 ├──────────────────────────────┼────────────┤
1619 │Age group 15 or younger Male │ 0│
1621 │ ╶────────────────────┼────────────┤
1622 │ 16 to 25 Male │ 594│
1624 │ ╶────────────────────┼────────────┤
1625 │ 26 to 35 Male │ 476│
1627 │ ╶────────────────────┼────────────┤
1628 │ 36 to 45 Male │ 489│
1630 │ ╶────────────────────┼────────────┤
1631 │ 46 to 55 Male │ 526│
1633 │ ╶────────────────────┼────────────┤
1634 │ 56 to 65 Male │ 516│
1636 │ ╶────────────────────┼────────────┤
1637 │ 66 or older Male │ 531│
1639 ╰──────────────────────────────┴────────────╯
1643 ╭─────────┬────────────╮
1649 ├─────────┼─────┼──────┤
1651 ╰─────────┴─────┴──────╯
1655 ╭─────────┬────────────╮
1661 ├─────────┼─────┼──────┤
1662 │Age group│ 594│ 505│
1663 ╰─────────┴─────┴──────╯
1667 ╭─────────┬────────────╮
1673 ├─────────┼─────┼──────┤
1674 │Age group│ 476│ 491│
1675 ╰─────────┴─────┴──────╯
1679 ╭─────────┬────────────╮
1685 ├─────────┼─────┼──────┤
1686 │Age group│ 489│ 548│
1687 ╰─────────┴─────┴──────╯
1691 ╭─────────┬────────────╮
1697 ├─────────┼─────┼──────┤
1698 │Age group│ 526│ 649│
1699 ╰─────────┴─────┴──────╯
1703 ╭─────────┬────────────╮
1709 ├─────────┼─────┼──────┤
1710 │Age group│ 516│ 731│
1711 ╰─────────┴─────┴──────╯
1715 ╭─────────┬────────────╮
1721 ├─────────┼─────┼──────┤
1722 │Age group│ 531│ 943│
1723 ╰─────────┴─────┴──────╯
1727 ╭───────────────────────┬────────────╮
1731 ├───────────────────────┼────────────┤
1732 │Age group 15 or younger│ 0│
1738 │ 66 or older │ 531│
1739 ╰───────────────────────┴────────────╯
1743 ╭───────────────────────┬────────────╮
1747 ├───────────────────────┼────────────┤
1748 │Age group 15 or younger│ 0│
1754 │ 66 or older │ 943│
1755 ╰───────────────────────┴────────────╯
1759 AT_SETUP([CTABLES missing values])
1760 AT_DATA([ctables.sps],
1761 [[DATA LIST LIST NOTABLE/x y.
1800 MISSING VALUES x (1, 2) y (2, 3).
1801 VARIABLE LEVEL ALL (NOMINAL).
1803 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1804 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1805 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1806 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1807 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1808 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1809 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1810 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1811 /CATEGORIES VARIABLES=ALL TOTAL=YES
1812 /SLABELS POSITION=ROW.
1813 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1814 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1815 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1816 /SLABELS POSITION=ROW.
1817 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1818 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1819 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1820 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1821 /SLABELS POSITION=ROW.
1823 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1825 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1826 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1827 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1828 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1829 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1830 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1831 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1832 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1833 dnl Note that Column Total N % doesn't add up to 100 because missing
1834 dnl values are included in the total but not shown as a category and this
1835 dnl is expected behavior.
1838 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1839 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1840 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1841 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1842 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1843 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1844 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1845 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1846 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1847 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1848 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1849 dnl values are included in the total but not shown as a category and this
1850 dnl is expected behavior.
1853 ╭────────────────────────┬───────────────────────────╮
1855 │ ├──────┬──────┬──────┬──────┤
1856 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1857 ├────────────────────────┼──────┼──────┼──────┼──────┤
1858 │x 3.00 Count │ 1│ 1│ 1│ 3│
1859 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1860 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1861 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1862 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1863 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1864 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1865 │ Valid N │ │ │ │ 3│
1866 │ Total N │ │ │ │ 6│
1867 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1868 │ 4.00 Count │ 1│ 1│ 1│ 3│
1869 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1870 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1871 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1872 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1873 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1874 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1875 │ Valid N │ │ │ │ 3│
1876 │ Total N │ │ │ │ 6│
1877 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1878 │ 5.00 Count │ 1│ 1│ 1│ 3│
1879 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1880 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1881 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1882 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1883 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1884 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1885 │ Valid N │ │ │ │ 3│
1886 │ Total N │ │ │ │ 6│
1887 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1888 │ Total Count │ 3│ 3│ 3│ 9│
1889 │ Column % │100.0%│100.0%│100.0%│ .│
1890 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1891 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1892 │ Row % │ .│ .│ .│ .│
1893 │ Row Valid N % │ .│ .│ .│ .│
1894 │ Row Total N % │ .│ .│ .│ .│
1895 │ Valid N │ 3│ 3│ 3│ 9│
1896 │ Total N │ 6│ 6│ 6│ 36│
1897 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1900 ╭────────────────────────┬─────────────────────────────────────────╮
1902 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1903 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1904 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1905 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1906 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1907 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1908 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1909 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1910 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1911 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1912 │ Valid N │ │ │ │ │ │ 0│
1913 │ Total N │ │ │ │ │ │ 6│
1914 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1915 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1916 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1917 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1918 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1919 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1920 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1921 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1922 │ Valid N │ │ │ │ │ │ 0│
1923 │ Total N │ │ │ │ │ │ 6│
1924 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1925 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1926 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1927 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1928 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1929 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1930 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1931 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1932 │ Valid N │ │ │ │ │ │ 3│
1933 │ Total N │ │ │ │ │ │ 6│
1934 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1935 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1936 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1937 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1938 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1939 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1940 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1941 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1942 │ Valid N │ │ │ │ │ │ 3│
1943 │ Total N │ │ │ │ │ │ 6│
1944 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1945 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1946 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1947 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1948 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1949 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1950 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1951 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1952 │ Valid N │ │ │ │ │ │ 3│
1953 │ Total N │ │ │ │ │ │ 6│
1954 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1955 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1956 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1957 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1958 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1959 │ Row % │ .│ .│ .│ .│ .│ .│
1960 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1961 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1962 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1963 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1964 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1967 ╭────────────────────────┬──────────────────────────────────╮
1969 │ ├──────┬──────┬──────┬──────┬──────┤
1970 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1971 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1972 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1973 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1974 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1975 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1976 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1977 │ Row Valid N % │ .│ .│ .│ .│ .│
1978 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1979 │ Valid N │ │ │ │ │ 0│
1980 │ Total N │ │ │ │ │ 6│
1981 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1982 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1983 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1984 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1985 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1986 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1987 │ Row Valid N % │ .│ .│ .│ .│ .│
1988 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1989 │ Valid N │ │ │ │ │ 0│
1990 │ Total N │ │ │ │ │ 6│
1991 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1992 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1993 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1994 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1995 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1996 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1997 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1998 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1999 │ Valid N │ │ │ │ │ 3│
2000 │ Total N │ │ │ │ │ 6│
2001 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2002 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2003 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2004 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2005 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2006 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2007 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2008 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2009 │ Valid N │ │ │ │ │ 3│
2010 │ Total N │ │ │ │ │ 6│
2011 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2012 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2013 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2014 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2015 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2016 │ Row % │ .│ .│ .│ .│ .│
2017 │ Row Valid N % │ .│ .│ .│ .│ .│
2018 │ Row Total N % │ .│ .│ .│ .│ .│
2019 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2020 │ Total N │ 5│ 5│ 5│ 5│ 30│
2021 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2025 AT_SETUP([CTABLES SMISSING=LISTWISE])
2026 AT_KEYWORDS([SMISSING LISTWISE])
2027 AT_DATA([ctables.sps],
2028 [[DATA LIST LIST NOTABLE/x y z.
2036 VARIABLE LEVEL x (NOMINAL).
2038 CTABLES /TABLE (y + z) > x.
2039 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2041 * The following doesn't come out as listwise because the tables are
2042 separate, not linked by an > operator.
2043 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2045 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2075 AT_SETUP([CTABLES VLABELS])
2076 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2077 AT_DATA([ctables.sps],
2079 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2080 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2081 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2082 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2083 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2085 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2087 ╭────────────────────────────────────────────────────────────────┬────────────╮
2093 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2094 │D5a. What would you say is your primary Cuban │ 13│ 7│
2095 │ethnic background? Mexican │ 175│ 136│
2097 │ South American │ 21│ 13│
2098 │ Central American │ 27│ 25│
2099 │ Puerto Rican, OR │ 37│ 41│
2100 │ Something else │ 35│ 33│
2101 │ Multiple - cannot │ 2│ 5│
2103 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2106 ╭──────────────────────────────────┬────────────╮
2112 ├──────────────────────────────────┼─────┼──────┤
2113 │QND5A Cuban │ 13│ 7│
2114 │ Mexican │ 175│ 136│
2116 │ South American │ 21│ 13│
2117 │ Central American │ 27│ 25│
2118 │ Puerto Rican, OR │ 37│ 41│
2119 │ Something else │ 35│ 33│
2120 │ Multiple - cannot choose one│ 2│ 5│
2121 ╰──────────────────────────────────┴─────┴──────╯
2124 ╭────────────────────────────────────────────────────────────────┬────────────╮
2130 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2131 │D5a. What would you say is your primary Cuban │ 13│ 7│
2132 │ethnic background? Mexican │ 175│ 136│
2134 │ South American │ 21│ 13│
2135 │ Central American │ 27│ 25│
2136 │ Puerto Rican, OR │ 37│ 41│
2137 │ Something else │ 35│ 33│
2138 │ Multiple - cannot │ 2│ 5│
2140 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2143 ╭────────────────────────────────────────────────────────────┬────────────────╮
2146 │ ├───────┬────────┤
2148 │ ├───────┼────────┤
2150 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2151 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2152 │primary ethnic background? Mexican │ 175│ 136│
2154 │ South American │ 21│ 13│
2155 │ Central American │ 27│ 25│
2156 │ Puerto Rican, OR │ 37│ 41│
2157 │ Something else │ 35│ 33│
2158 │ Multiple - cannot │ 2│ 5│
2160 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2163 ╭────────────────────────────┬─────┬──────╮
2167 ├────────────────────────────┼─────┼──────┤
2169 │Mexican │ 175│ 136│
2171 │South American │ 21│ 13│
2172 │Central American │ 27│ 25│
2173 │Puerto Rican, OR │ 37│ 41│
2174 │Something else │ 35│ 33│
2175 │Multiple - cannot choose one│ 2│ 5│
2176 ╰────────────────────────────┴─────┴──────╯
2180 AT_SETUP([CTABLES FORMAT=EMPTY])
2181 AT_KEYWORDS([FORMAT EMPTY])
2182 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2183 AT_DATA([ctables.sps],
2185 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2186 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2187 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2189 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2191 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2192 │ │ D5. ETHNICITY: Are you of │
2193 │ │ Hispanic or Latino origin or │
2195 │ ├───────────────┬───────────────┤
2197 │ ├───────────────┼───────────────┤
2199 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2200 │D5a. What would you say is Cuban │ 20│ 0│
2201 │your primary ethnic Mexican │ 311│ 0│
2202 │background? Spanish │ 48│ 0│
2203 │ South American │ 34│ 0│
2204 │ Central American│ 52│ 0│
2205 │ Puerto Rican, OR│ 78│ 0│
2206 │ Something else │ 68│ 0│
2207 │ Multiple - │ 7│ 0│
2208 │ cannot choose │ │ │
2210 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2213 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2214 │ │ D5. ETHNICITY: Are you of │
2215 │ │ Hispanic or Latino origin or │
2217 │ ├───────────────┬───────────────┤
2219 │ ├───────────────┼───────────────┤
2221 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2222 │D5a. What would you say is Cuban │ 20│ │
2223 │your primary ethnic Mexican │ 311│ │
2224 │background? Spanish │ 48│ │
2225 │ South American │ 34│ │
2226 │ Central American│ 52│ │
2227 │ Puerto Rican, OR│ 78│ │
2228 │ Something else │ 68│ │
2230 │ cannot choose │ │ │
2232 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2235 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2236 │ │ D5. ETHNICITY: Are you of │
2237 │ │ Hispanic or Latino origin or │
2239 │ ├───────────────┬───────────────┤
2241 │ ├───────────────┼───────────────┤
2243 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2244 │D5a. What would you say is Cuban │ 20│n/a │
2245 │your primary ethnic Mexican │ 311│n/a │
2246 │background? Spanish │ 48│n/a │
2247 │ South American │ 34│n/a │
2248 │ Central American│ 52│n/a │
2249 │ Puerto Rican, OR│ 78│n/a │
2250 │ Something else │ 68│n/a │
2251 │ Multiple - │ 7│n/a │
2252 │ cannot choose │ │ │
2254 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯