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
12 dnl * THRU (numeric ranges)
14 dnl - Date/time variables and values
16 dnl * MISSING, OTHERNM
17 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
19 dnl - Summary functions:
20 dnl * U-prefix for unweighted summaries.
21 dnl * areaPCT.SUM and UareaPCT.SUM functions.
22 dnl - SPLIT FILE with SEPARATE splits
23 dnl - Definition of columns/rows when labels are rotated from one axis to another.
26 dnl - Multiple response sets
27 dnl - MRSETS subcommand.
28 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
31 dnl - Summary functions:
32 dnl * .LCL and .UCL suffixes.
35 dnl * Data-dependent sorting.
37 AT_SETUP([CTABLES parsing])
38 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
39 AT_DATA([ctables.sps],
42 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
43 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
44 /FORMAT UNITS=CM EMPTY="(-)"
45 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
46 /VLABELS VARIABLES=qn17 DISPLAY=NAME
47 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
48 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
49 /VLABELS VARIABLES=qn20 DISPLAY=NONE
50 /MRSETS COUNTDUPLICATES=NO
51 /MRSETS COUNTDUPLICATES=YES
54 /WEIGHT VARIABLE=qns3a
56 /HIDESMALLCOUNTS COUNT=10
58 /SLABELS POSITION=COLUMN VISIBLE=YES
59 /SLABELS VISIBLE=NO POSITION=ROW
60 /SLABELS POSITION=LAYER
62 /CLABELS ROWLABELS=OPPOSITE
64 /CATEGORIES VARIABLES=qn1 qn17
65 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
66 POSITION=BEFORE EMPTY=INCLUDE.
67 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
68 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
69 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
71 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
74 ╭───────────────────┬────┬────╮
76 ├───────────────────┼────┼────┤
77 │Sa1. SAMPLE SOURCE:│5392│1607│
78 ╰───────────────────┴────┴────╯
82 ╭───────────────────┬─────╮
84 ├───────────────────┼─────┤
85 │Sa1. SAMPLE SOURCE:│ 5392│
86 ╰───────────────────┴─────╯
89 ╭────────────────────────┬─────╮
91 ├────────────────────────┼─────┤
92 │Sa1. SAMPLE SOURCE: RDD │ 5392│
94 ╰────────────────────────┴─────╯
97 ╭────────────────────────┬─────╮
99 ├────────────────────────┼─────┤
100 │Sa1. SAMPLE SOURCE: RDD │ 5392│
102 ╰────────────────────────┴─────╯
106 AT_SETUP([CTABLES parsing - negative])
107 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
108 AT_DATA([ctables.sps],
111 CTABLES /FORMAT MINCOLWIDTH='foo'.
112 CTABLES /TABLE qn1 [**].
113 CTABLES /TABLE qn1 [NOTAFUNCTION].
116 CTABLES /TABLE NOTAVAR.
118 CTABLES /TABLE string[S].
119 CTABLES /TABLE qn1 [PTILE 101].
120 CTABLES /TABLE qn1 [MEAN F0.1].
121 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
122 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
123 CTABLES /TABLE qn1 [MEAN TOTALS].
124 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
125 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
127 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
128 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
129 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
130 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
131 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
132 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
133 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
134 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
135 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
136 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
137 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
138 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
142 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
143 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
144 CTABLES /PCOMPUTE &k=EXPR([LO **]).
145 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
146 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
147 CTABLES /PCOMPUTE &k=EXPR([1**]).
148 CTABLES /PCOMPUTE &k=EXPR((1x)).
149 CTABLES /PCOMPUTE **k.
150 CTABLES /PCOMPUTE &1.
151 CTABLES /PCOMPUTE &k**.
152 CTABLES /PCOMPUTE &k=**.
153 CTABLES /PCOMPUTE &k=EXPR**.
154 CTABLES /PCOMPUTE &k=EXPR(1x).
155 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
156 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
157 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
158 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
159 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
160 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
161 CTABLES /FORMAT EMPTY=**.
162 CTABLES /FORMAT MISSING=**.
164 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
166 CTABLES /VLABELS VARIABLES=NOTAVAR.
167 CTABLES /VLABELS VARIABLES=qn1 **.
168 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
170 CTABLES /MRSETS COUNTDUPLICATES=**.
171 CTABLES /SMISSING **.
173 CTABLES /WEIGHT VARIABLE=NOTAVAR.
174 CTABLES /HIDESMALLCOUNTS COUNT=1.
176 CTABLES /HIDESMALLCOUNTS COUNT=2.
177 CTABLES /TABLE qn1**.
178 CTABLES /TABLE qn1 /SLABELS POSITION=**.
179 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
180 CTABLES /TABLE qn1 /SLABELS **.
181 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
182 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
183 CTABLES /TABLE qn1 /CLABELS **.
184 CTABLES /TABLE qn1 /CRITERIA **.
185 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
186 CTABLES /TABLE qn1 /TITLES **.
187 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
188 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
189 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
190 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
191 CTABLES /TABLE qn1 /SIGTEST **.
192 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
193 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
194 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
195 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
196 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
197 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
198 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
199 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
200 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
201 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
202 CTABLES /TABLE qn1 /COMPARETEST **.
203 CTABLES /TABLE qn1 / **.
204 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
205 CTABLES /TABLE qn20 > qnd1.
206 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
207 NUMERIC datetime (DATETIME17.0).
208 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
210 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
211 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
213 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
214 negative number for MINCOLWIDTH.
216 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
219 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
220 summary function name.
222 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
224 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
227 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
229 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
231 10 | CTABLES /TABLE string[S].
234 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
235 between 0 and 100 for PTILE.
237 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
238 requires a width between 1 and 40.
240 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
241 format NEGPAREN requires width 2 or greater.
243 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
244 format NEGPAREN requires width greater than decimals.
246 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
248 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
251 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
252 15 | CTABLES /TABLE qn1 [MEAN TOTALS].
255 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
257 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
259 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
262 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
263 16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
266 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
268 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
270 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
272 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
274 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
276 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
278 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
281 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
282 23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
285 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
286 between 0 and 100 for PTILE.
288 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
291 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
294 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
297 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
300 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
302 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
305 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
308 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
309 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
311 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
312 LABEL, POSITION, or EMPTY.
314 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
315 integer for SUBTOTAL.
317 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
319 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
321 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
323 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
325 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
327 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
329 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
331 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
333 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
335 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
337 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
339 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
341 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
342 the previous definition.
343 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
344 | ^~~~~~~~~~~~~~~~~~~
346 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
347 47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
348 | ^~~~~~~~~~~~~~~~~~~
350 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
353 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
354 Expecting summary function name.
356 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
357 between 0 and 100 for PTILE.
359 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
361 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
364 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
365 FORMAT, or HIDESOURCECATS.
367 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
369 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
371 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
372 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
374 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
377 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
380 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
382 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
385 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
386 DEFAULT, NAME, LABEL, BOTH, or NONE.
388 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
391 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
394 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
395 VARIABLE or LISTWISE.
397 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
400 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
402 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
403 greater for HIDESMALLCOUNTS COUNT.
405 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
406 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
407 HIDESMALLCOUNTS, or TABLE.
409 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
412 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
414 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
417 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
420 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
423 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
426 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
429 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
430 ROWLABELS, or COLLABELS.
432 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
435 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
436 in @<:@0,100@:}@ for CILEVEL.
438 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
439 CAPTION, CORNER, or TITLE.
441 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
444 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
445 in @<:@0,1@:}@ for ALPHA.
447 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
450 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
451 ALLVISIBLE or SUBTOTALS.
453 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
454 ALPHA, INCLUDEMRSETS, or CATEGORIES.
456 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
459 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
462 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
465 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
466 BONFERRONI, BH, or NONE.
468 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
471 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
474 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
475 ALLVISIBLE or SUBTOTALS.
477 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
480 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
483 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
486 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
487 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
490 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
491 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
493 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
496 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
497 97 | CTABLES /TABLE qn20 > qnd1.
500 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
501 97 | CTABLES /TABLE qn20 > qnd1.
504 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
505 97 | CTABLES /TABLE qn20 > qnd1.
508 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
509 categorical variables at the innermost nesting level.
510 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
511 | ^~~~~~~~~~~~~~~~~~~~
513 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
515 98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
518 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
519 specification as format DATETIME: Day (123) must be between 1 and 31..
520 100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
525 AT_SETUP([CTABLES parsing - more negative])
526 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
527 AT_DATA([ctables.sps],
529 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
530 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
531 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
534 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
535 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
537 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
539 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
540 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
541 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
542 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
544 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
545 CTABLES /PCOMPUTE &x=EXPR([**]).
546 CTABLES /PCOMPUTE &x=EXPR(**).
550 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
552 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
553 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
554 category not included in the category list.
555 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
560 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
561 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
565 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
566 list of categories here.
567 2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
572 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
573 category not included in the category list.
574 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
579 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
580 3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
584 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
585 variable's CATEGORIES specification.
587 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
588 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
589 subtotals by position, e.g. SUBTOTAL[1].
590 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
591 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
593 ^~~~~~~~~~~~~~~~~~~~~~~~
595 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
597 4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
598 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
601 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
602 applied only to string variables, but this subcommand tries to apply it to
603 numeric variable QN1.
604 7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
607 ctables.sps:8.53: error: CTABLES: This category specification may be applied
608 only to numeric variables, but this subcommand tries to apply it to string
610 8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
613 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
614 based on a summary function.
616 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
617 moved to be categorical, but qnd1 is a scale variable.
619 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
620 moved to have the same width, but QN1 has width 0 and string has width 8.
622 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
623 moved to have the same value labels, but QN1 and QNSA1 have different value
626 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
627 moved to have the same category specifications, but QN105BA and QN105BB have
628 different category specifications.
630 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
631 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'. To disable
632 this warning, insert parentheses.
633 17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
636 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
639 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
641 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
643 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
644 variable must be specified.
646 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
648 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
650 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
653 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
655 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
658 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
660 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
663 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
664 has a summary even if the syntax does not explicitly specify one.
665 23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
670 AT_SETUP([CTABLES one categorical variable])
671 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
672 AT_DATA([ctables.sps],
675 CTABLES /TABLE BY qn1.
676 CTABLES /TABLE BY BY qn1.
678 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
680 ╭────────────────────────────────────────────────────────────────────────┬─────╮
682 ├────────────────────────────────────────────────────────────────────────┼─────┤
683 │ 1. How often do you usually drive a car or other Every day │ 4667│
684 │motor vehicle? Several days a week │ 1274│
685 │ Once a week or less │ 361│
686 │ Only certain times a │ 130│
689 ╰────────────────────────────────────────────────────────────────────────┴─────╯
692 ╭──────────────────────────────────────────────────────────────────────────────╮
693 │ 1. How often do you usually drive a car or other motor vehicle? │
694 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
695 │ │ Several days a │ Once a week or │ Only certain times a │ │
696 │Every day│ week │ less │ year │Never│
697 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
698 │ Count │ Count │ Count │ Count │Count│
699 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
700 │ 4667│ 1274│ 361│ 130│ 540│
701 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
713 AT_SETUP([CTABLES one string variable])
714 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
715 AT_DATA([ctables.sps],
718 MISSING VALUES licensed('DontKnow', 'Refused').
719 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
720 CTABLES /TABLE licensed.
721 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
722 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
723 * Notice that the string matching is case-sensitive.
724 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
725 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
727 /PCOMPUTE ¬yes=EXPR(['No']+['DontKnow']+['Refused'])
728 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
730 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'No', 'DontKnow', 'Refused'].
732 /PCOMPUTE ¬yes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
733 /PPROPERTIES ¬yes LABEL='Not Yes' HIDESOURCECATS=YES
735 /CATEGORIES VARIABLES=licensed ['Yes', ¬yes, 'DontKnow' THRU 'No', 'Refused'].
737 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
747 ╭─────────────────┬─────┬───────╮
749 ├─────────────────┼─────┼───────┤
750 │licensed DontKnow│ 4│ │
754 │ Total │ 6999│ 6951│
755 ╰─────────────────┴─────┴───────╯
758 ╭──────────────┬─────╮
760 ├──────────────┼─────┤
761 │licensed Yes │ 6379│
764 ╰──────────────┴─────╯
767 ╭──────────────┬─────╮
769 ├──────────────┼─────┤
770 │licensed Yes │ 6379│
773 ╰──────────────┴─────╯
776 ╭────────────────┬─────╮
778 ├────────────────┼─────┤
783 ╰────────────────┴─────╯
786 ╭────────────────┬─────╮
788 ├────────────────┼─────┤
789 │licensed Yes │ 6379│
791 ╰────────────────┴─────╯
794 ╭────────────────┬─────╮
796 ├────────────────┼─────┤
797 │licensed Yes │ 6379│
799 ╰────────────────┴─────╯
803 AT_SETUP([CTABLES one scale variable])
804 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
805 AT_DATA([ctables.sps],
807 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
808 CTABLES /TABLE BY qnd1.
809 CTABLES /TABLE BY BY qnd1.
811 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
813 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
814 │ │ │ │ │ │ Std │ │ │
815 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
816 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
817 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
818 │age? │ │ │ │ │ │ │ │
819 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
822 ╭──────────────────────────╮
823 │D1. AGE: What is your age?│
824 ├──────────────────────────┤
826 ├──────────────────────────┤
828 ╰──────────────────────────╯
831 D1. AGE: What is your age?
840 AT_SETUP([CTABLES simple stacking])
841 AT_KEYWORDS([stack stacked])
842 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
843 AT_DATA([ctables.sps],
845 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
847 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
849 ╭───────────────────────────────────────────────────────────────┬──────────────╮
856 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
857 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
858 │too much to drink to drive safely will A. Get certain │ │ │
859 │stopped by the police? Very likely │ 21%│ 22%│
860 │ Somewhat │ 38%│ 42%│
862 │ Somewhat │ 21%│ 18%│
866 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
867 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
868 │too much to drink to drive safely will B. Have an certain │ │ │
869 │accident? Very likely │ 36%│ 45%│
870 │ Somewhat │ 39%│ 32%│
876 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
877 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
878 │too much to drink to drive safely will C. Be certain │ │ │
879 │convicted for drunk driving? Very likely │ 32%│ 28%│
880 │ Somewhat │ 27%│ 32%│
882 │ Somewhat │ 15%│ 15%│
886 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
887 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
888 │too much to drink to drive safely will D. Be certain │ │ │
889 │arrested for drunk driving? Very likely │ 26%│ 27%│
890 │ Somewhat │ 32%│ 35%│
892 │ Somewhat │ 17%│ 15%│
896 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
900 AT_SETUP([CTABLES show or hide empty categories])
901 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
902 AT_DATA([ctables.sps],
904 IF (qn105ba = 2) qn105ba = 1.
905 IF (qns3a = 1) qns3a = 2.
906 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
907 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
908 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
909 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
910 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
911 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
912 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
914 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
916 ╭──────────────────────────────────────────────────────────────┬───────────────╮
923 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
924 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
925 │too much to drink to drive safely will A. Get certain │ │ │
926 │stopped by the police? Very likely│ .│ 0%│
933 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
936 ╭──────────────────────────────────────────────────────────────┬───────────────╮
943 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
944 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
945 │too much to drink to drive safely will A. Get certain │ │ │
946 │stopped by the police? Somewhat │ .│ 40%│
952 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
955 ╭────────────────────────────────────────────────────────────────────┬─────────╮
962 ├────────────────────────────────────────────────────────────────────┼─────────┤
963 │105b. How likely is it that drivers who have had too Almost │ 32%│
964 │much to drink to drive safely will A. Get stopped by certain │ │
965 │the police? Very likely │ 0%│
972 ╰────────────────────────────────────────────────────────────────────┴─────────╯
975 ╭────────────────────────────────────────────────────────────────────┬─────────╮
982 ├────────────────────────────────────────────────────────────────────┼─────────┤
983 │105b. How likely is it that drivers who have had too Almost │ 32%│
984 │much to drink to drive safely will A. Get stopped by certain │ │
985 │the police? Somewhat │ 40%│
991 ╰────────────────────────────────────────────────────────────────────┴─────────╯
995 AT_SETUP([CTABLES sorting categories])
996 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
997 AT_DATA([ctables.sps],
999 IF (QND5A=6) QND5A=-1.
1000 IF (QND5A=5) QND5A=-2.
1001 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
1002 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
1003 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
1004 /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
1006 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1008 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1010 ├────────────────────────────────────────────────────────────────────────┼─────┤
1011 │D5a. What would you say is your primary ethnic -2.00 │ 52│
1012 │background? -1.00 │ 78│
1016 │ South American │ 34│
1017 │ Central American │ 0│
1018 │ Puerto Rican, OR │ 0│
1019 │ Something else │ 68│
1020 │ Multiple - cannot choose│ 7│
1022 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1025 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1027 ├────────────────────────────────────────────────────────────────────────┼─────┤
1028 │D5a. What would you say is your primary ethnic Multiple - cannot choose│ 7│
1029 │background? one │ │
1030 │ Something else │ 68│
1031 │ Puerto Rican, OR │ 0│
1032 │ Central American │ 0│
1033 │ South American │ 34│
1039 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1042 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1044 ├────────────────────────────────────────────────────────────────────────┼─────┤
1045 │D5a. What would you say is your primary ethnic Central American │ 0│
1046 │background? Cuban │ 20│
1048 │ Multiple - cannot choose│ 7│
1050 │ Puerto Rican, OR │ 0│
1051 │ Something else │ 68│
1052 │ South American │ 34│
1056 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1059 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1061 ├────────────────────────────────────────────────────────────────────────┼─────┤
1062 │D5a. What would you say is your primary ethnic Spanish │ 48│
1063 │background? South American │ 34│
1064 │ Something else │ 68│
1065 │ Puerto Rican, OR │ 0│
1066 │ Multiple - cannot choose│ 7│
1070 │ Central American │ 0│
1073 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1077 AT_SETUP([CTABLES simple nesting])
1078 AT_KEYWORDS([nest nested])
1079 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1080 AT_DATA([ctables.sps],
1082 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1083 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1084 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1085 /CATEGORIES VARIABLES=qns3a TOTAL=YES
1086 /CLABELS ROW=OPPOSITE.
1088 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1090 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1093 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1094 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
1095 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
1096 │drive safely will A. Get stopped by Total │ 700│ 10%│
1097 │the police? ╶──────────────────────────┼─────┼──────┤
1098 │ Very S3a. Male │ 660│ 10%│
1099 │ likely GENDER: Female│ 842│ 12%│
1100 │ Total │ 1502│ 22%│
1101 │ ╶──────────────────────────┼─────┼──────┤
1102 │ Somewhat S3a. Male │ 1174│ 17%│
1103 │ likely GENDER: Female│ 1589│ 23%│
1104 │ Total │ 2763│ 40%│
1105 │ ╶──────────────────────────┼─────┼──────┤
1106 │ Somewhat S3a. Male │ 640│ 9%│
1107 │ unlikely GENDER: Female│ 667│ 10%│
1108 │ Total │ 1307│ 19%│
1109 │ ╶──────────────────────────┼─────┼──────┤
1110 │ Very S3a. Male │ 311│ 5%│
1111 │ unlikely GENDER: Female│ 298│ 4%│
1113 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1114 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
1115 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
1116 │drive safely will B. Have an accident? Total │ 1100│ 16%│
1117 │ ╶──────────────────────────┼─────┼──────┤
1118 │ Very S3a. Male │ 1104│ 16%│
1119 │ likely GENDER: Female│ 1715│ 25%│
1120 │ Total │ 2819│ 41%│
1121 │ ╶──────────────────────────┼─────┼──────┤
1122 │ Somewhat S3a. Male │ 1203│ 17%│
1123 │ likely GENDER: Female│ 1214│ 18%│
1124 │ Total │ 2417│ 35%│
1125 │ ╶──────────────────────────┼─────┼──────┤
1126 │ Somewhat S3a. Male │ 262│ 4%│
1127 │ unlikely GENDER: Female│ 168│ 2%│
1129 │ ╶──────────────────────────┼─────┼──────┤
1130 │ Very S3a. Male │ 81│ 1%│
1131 │ unlikely GENDER: Female│ 59│ 1%│
1133 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1134 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
1135 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
1136 │drive safely will C. Be convicted for Total │ 1149│ 17%│
1137 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1138 │ Very S3a. Male │ 988│ 14%│
1139 │ likely GENDER: Female│ 1049│ 15%│
1140 │ Total │ 2037│ 30%│
1141 │ ╶──────────────────────────┼─────┼──────┤
1142 │ Somewhat S3a. Male │ 822│ 12%│
1143 │ likely GENDER: Female│ 1210│ 18%│
1144 │ Total │ 2032│ 30%│
1145 │ ╶──────────────────────────┼─────┼──────┤
1146 │ Somewhat S3a. Male │ 446│ 7%│
1147 │ unlikely GENDER: Female│ 548│ 8%│
1149 │ ╶──────────────────────────┼─────┼──────┤
1150 │ Very S3a. Male │ 268│ 4%│
1151 │ unlikely GENDER: Female│ 354│ 5%│
1153 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1154 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
1155 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
1156 │drive safely will D. Be arrested for Total │ 1101│ 16%│
1157 │drunk driving? ╶──────────────────────────┼─────┼──────┤
1158 │ Very S3a. Male │ 805│ 12%│
1159 │ likely GENDER: Female│ 1029│ 15%│
1160 │ Total │ 1834│ 27%│
1161 │ ╶──────────────────────────┼─────┼──────┤
1162 │ Somewhat S3a. Male │ 975│ 14%│
1163 │ likely GENDER: Female│ 1332│ 19%│
1164 │ Total │ 2307│ 34%│
1165 │ ╶──────────────────────────┼─────┼──────┤
1166 │ Somewhat S3a. Male │ 535│ 8%│
1167 │ unlikely GENDER: Female│ 560│ 8%│
1168 │ Total │ 1095│ 16%│
1169 │ ╶──────────────────────────┼─────┼──────┤
1170 │ Very S3a. Male │ 270│ 4%│
1171 │ unlikely GENDER: Female│ 279│ 4%│
1173 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1176 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1177 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
1178 │ │ certain│likely│ likely │ unlikely│unlikely│
1179 │ ├────────┼──────┼─────────┼─────────┼────────┤
1181 │ │ Table %│ % │ Table % │ Table % │ Table %│
1182 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1183 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
1184 │GENDER: is it that drivers│ │ │ │ │ │
1185 │ who have had too │ │ │ │ │ │
1186 │ much to drink to │ │ │ │ │ │
1187 │ drive safely will │ │ │ │ │ │
1188 │ A. Get stopped by │ │ │ │ │ │
1189 │ the police? │ │ │ │ │ │
1190 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1191 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
1192 │ is it that drivers│ │ │ │ │ │
1193 │ who have had too │ │ │ │ │ │
1194 │ much to drink to │ │ │ │ │ │
1195 │ drive safely will │ │ │ │ │ │
1196 │ A. Get stopped by │ │ │ │ │ │
1197 │ the police? │ │ │ │ │ │
1198 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1199 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
1200 │ is it that drivers│ │ │ │ │ │
1201 │ who have had too │ │ │ │ │ │
1202 │ much to drink to │ │ │ │ │ │
1203 │ drive safely will │ │ │ │ │ │
1204 │ A. Get stopped by │ │ │ │ │ │
1205 │ the police? │ │ │ │ │ │
1206 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1207 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
1208 │GENDER: is it that drivers│ │ │ │ │ │
1209 │ who have had too │ │ │ │ │ │
1210 │ much to drink to │ │ │ │ │ │
1211 │ drive safely will │ │ │ │ │ │
1212 │ B. Have an │ │ │ │ │ │
1213 │ accident? │ │ │ │ │ │
1214 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1215 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
1216 │ is it that drivers│ │ │ │ │ │
1217 │ who have had too │ │ │ │ │ │
1218 │ much to drink to │ │ │ │ │ │
1219 │ drive safely will │ │ │ │ │ │
1220 │ B. Have an │ │ │ │ │ │
1221 │ accident? │ │ │ │ │ │
1222 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1223 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
1224 │ is it that drivers│ │ │ │ │ │
1225 │ who have had too │ │ │ │ │ │
1226 │ much to drink to │ │ │ │ │ │
1227 │ drive safely will │ │ │ │ │ │
1228 │ B. Have an │ │ │ │ │ │
1229 │ accident? │ │ │ │ │ │
1230 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1231 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
1232 │GENDER: is it that drivers│ │ │ │ │ │
1233 │ who have had too │ │ │ │ │ │
1234 │ much to drink to │ │ │ │ │ │
1235 │ drive safely will │ │ │ │ │ │
1236 │ C. Be convicted │ │ │ │ │ │
1237 │ for drunk driving?│ │ │ │ │ │
1238 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1239 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
1240 │ is it that drivers│ │ │ │ │ │
1241 │ who have had too │ │ │ │ │ │
1242 │ much to drink to │ │ │ │ │ │
1243 │ drive safely will │ │ │ │ │ │
1244 │ C. Be convicted │ │ │ │ │ │
1245 │ for drunk driving?│ │ │ │ │ │
1246 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1247 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
1248 │ is it that drivers│ │ │ │ │ │
1249 │ who have had too │ │ │ │ │ │
1250 │ much to drink to │ │ │ │ │ │
1251 │ drive safely will │ │ │ │ │ │
1252 │ C. Be convicted │ │ │ │ │ │
1253 │ for drunk driving?│ │ │ │ │ │
1254 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1255 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
1256 │GENDER: is it that drivers│ │ │ │ │ │
1257 │ who have had too │ │ │ │ │ │
1258 │ much to drink to │ │ │ │ │ │
1259 │ drive safely will │ │ │ │ │ │
1260 │ D. Be arrested for│ │ │ │ │ │
1261 │ drunk driving? │ │ │ │ │ │
1262 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1263 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
1264 │ is it that drivers│ │ │ │ │ │
1265 │ who have had too │ │ │ │ │ │
1266 │ much to drink to │ │ │ │ │ │
1267 │ drive safely will │ │ │ │ │ │
1268 │ D. Be arrested for│ │ │ │ │ │
1269 │ drunk driving? │ │ │ │ │ │
1270 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1271 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
1272 │ is it that drivers│ │ │ │ │ │
1273 │ who have had too │ │ │ │ │ │
1274 │ much to drink to │ │ │ │ │ │
1275 │ drive safely will │ │ │ │ │ │
1276 │ D. Be arrested for│ │ │ │ │ │
1277 │ drunk driving? │ │ │ │ │ │
1278 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1282 AT_SETUP([CTABLES nesting and scale variables])
1283 AT_KEYWORDS([nest nested])
1284 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1285 AT_DATA([ctables.sps],
1287 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1288 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1289 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1290 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1291 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1293 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1295 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1301 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1302 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
1303 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
1305 │ Once a week or │ 44│ 54│
1307 │ Only certain │ 34│ 41│
1308 │ times a year │ │ │
1310 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1313 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1314 │ │Minimum│Maximum│Mean│
1315 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1316 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
1317 │What is GENDER: months, has there been a │ │ │ │
1318 │your time when you felt you │ │ │ │
1319 │age? should cut down on your No │ 16│ 86│ 46│
1321 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1322 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
1323 │ months, has there been a │ │ │ │
1324 │ time when you felt you │ │ │ │
1325 │ should cut down on your No │ 16│ 86│ 48│
1327 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1328 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
1329 │What is GENDER: months, has there been a │ │ │ │
1330 │your time when people criticized No │ 16│ 86│ 46│
1331 │age? your drinking? │ │ │ │
1332 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
1333 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
1334 │ months, has there been a │ │ │ │
1335 │ time when people criticized No │ 16│ 86│ 48│
1336 │ your drinking? │ │ │ │
1337 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1340 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1341 │ │S1. Including yourself, how many members of this│
1342 │ │ household are age 16 or older? │
1343 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1344 │ │ │ │ │ │ │ │ 6 or │
1345 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1346 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1347 │ │Column│Column│Column│Column│Column│Column│Column│
1348 │ │ % │ % │ % │ % │ % │ % │ % │
1349 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1350 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1351 │SAMPLE How certain │ │ │ │ │ │ │ │
1352 │SOURCE: likely │ │ │ │ │ │ │ │
1353 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1354 │ that likely │ │ │ │ │ │ │ │
1355 │ drivers │ │ │ │ │ │ │ │
1356 │ who have │ │ │ │ │ │ │ │
1357 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1358 │ much to likely │ │ │ │ │ │ │ │
1359 │ drink to │ │ │ │ │ │ │ │
1360 │ drive │ │ │ │ │ │ │ │
1361 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1362 │ will A. unlikely│ │ │ │ │ │ │ │
1363 │ Get │ │ │ │ │ │ │ │
1364 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1365 │ by the unlikely│ │ │ │ │ │ │ │
1366 │ police? │ │ │ │ │ │ │ │
1367 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1370 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1373 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1374 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
1375 │group typical month did you have one or more │ │ │
1376 │ alcoholic beverages to drink? │ │ │
1377 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1378 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
1379 │ typical month did you have one or more │ │ │
1380 │ alcoholic beverages to drink? │ │ │
1381 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1382 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
1383 │ typical month did you have one or more │ │ │
1384 │ alcoholic beverages to drink? │ │ │
1385 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1386 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
1387 │ typical month did you have one or more │ │ │
1388 │ alcoholic beverages to drink? │ │ │
1389 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1390 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
1391 │ typical month did you have one or more │ │ │
1392 │ alcoholic beverages to drink? │ │ │
1393 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
1394 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
1395 │ older typical month did you have one or more │ │ │
1396 │ alcoholic beverages to drink? │ │ │
1397 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1402 AT_SETUP([CTABLES SLABELS])
1403 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1404 AT_DATA([ctables.sps],
1406 CTABLES /TABLE qn1 [COUNT COLPCT].
1407 CTABLES /TABLE qn1 [COUNT COLPCT]
1408 /SLABELS POSITION=ROW.
1409 CTABLES /TABLE qn1 [COUNT COLPCT]
1410 /SLABELS POSITION=ROW VISIBLE=NO.
1412 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1414 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1417 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1418 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
1419 │other motor vehicle? Several days a week│ 1274│ 18.3%│
1420 │ Once a week or less│ 361│ 5.2%│
1421 │ Only certain times │ 130│ 1.9%│
1423 │ Never │ 540│ 7.7%│
1424 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1427 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1428 │ 1. How often do you usually drive a car or Every day Count │ 4667│
1429 │other motor vehicle? Column │66.9%│
1431 │ ╶───────────────────────────┼─────┤
1432 │ Several days a week Count │ 1274│
1435 │ ╶───────────────────────────┼─────┤
1436 │ Once a week or less Count │ 361│
1439 │ ╶───────────────────────────┼─────┤
1440 │ Only certain times Count │ 130│
1441 │ a year Column │ 1.9%│
1443 │ ╶───────────────────────────┼─────┤
1444 │ Never Count │ 540│
1447 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1450 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1451 │ 1. How often do you usually drive a car or other Every day │ 4667│
1452 │motor vehicle? │66.9%│
1453 │ Several days a week │ 1274│
1455 │ Once a week or less │ 361│
1457 │ Only certain times a │ 130│
1461 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1465 AT_SETUP([CTABLES simple totals])
1466 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1467 AT_DATA([ctables.sps],
1470 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1471 DESCRIPTIVES qn18/STATISTICS=MEAN.
1472 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1473 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1475 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1477 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1479 ├────────────────────────────────────────────────────────────────────────┼─────┤
1480 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
1481 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
1484 │ Wine coolers │ 137│
1485 │ Hard liquor or │ 888│
1487 │ Flavored malt │ 83│
1489 │ Number responding │ 4221│
1490 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1492 Descriptive Statistics
1493 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1495 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1496 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
1497 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
1498 │Valid N (listwise) │6999│ │
1499 │Missing N (listwise) │2781│ │
1500 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1503 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1504 │ │ │ │ Valid│Total│
1505 │ │Mean│Count│ N │ N │
1506 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1507 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
1508 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1509 │ you usually drink per sitting? │ │ │ │ │
1510 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1511 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
1512 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1513 │ you usually drink per sitting? │ │ │ │ │
1514 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1515 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
1516 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1517 │ you usually drink per sitting? │ │ │ │ │
1518 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1519 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
1520 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1521 │ you usually drink per sitting? │ │ │ │ │
1522 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1523 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
1524 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
1525 │ you usually drink per sitting? │ │ │ │ │
1526 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1530 AT_SETUP([CTABLES subtotals])
1531 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1532 AT_DATA([ctables.sps],
1534 CTABLES /TABLE=qn105ba BY qns1
1535 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1536 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1537 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1538 CTABLES /TABLE=qn105ba BY qns1
1539 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1540 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1542 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1544 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1545 │ │ S1. Including yourself, how many members of this household │
1546 │ │ are age 16 or older? │
1547 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1548 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1549 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1550 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1551 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1552 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1553 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1554 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1555 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1556 │ likely │ │ │ │ │ │ │ │
1557 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1558 │ unlikely │ │ │ │ │ │ │ │
1559 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1560 │ unlikely │ │ │ │ │ │ │ │
1561 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1564 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1565 │ │ S1. Including yourself, how many members of this household │
1566 │ │ are age 16 or older? │
1567 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1568 │ │ │ │ │ │ │ │ 6 or │
1569 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
1570 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1571 │ │ │ │ │ │ Column│ │ │
1572 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
1573 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1574 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
1575 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
1576 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1577 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1578 │ likely │ │ │ │ │ │ │ │
1579 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
1580 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
1581 │ unlikely │ │ │ │ │ │ │ │
1582 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
1583 │ unlikely │ │ │ │ │ │ │ │
1584 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
1585 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1588 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1589 │ │ S1. Including yourself, how many members of this household │
1590 │ │ are age 16 or older? │
1591 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1592 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
1593 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1594 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
1595 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1596 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
1597 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
1598 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
1599 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
1600 │ likely │ │ │ │ │ │ │ │
1601 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
1602 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
1603 │ unlikely │ │ │ │ │ │ │ │
1604 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
1605 │ unlikely │ │ │ │ │ │ │ │
1606 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
1607 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1611 AT_SETUP([CTABLES PCOMPUTE])
1612 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1613 AT_DATA([ctables.sps],
1616 /PCOMPUTE &x=EXPR([3] + [4])
1617 /PCOMPUTE &y=EXPR([4] + [5])
1618 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1619 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1620 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1621 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1623 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1625 /PCOMPUTE &x=EXPR([3] + [4])
1626 /PCOMPUTE &y=EXPR([4] + [5])
1627 /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1628 /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1629 /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1630 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1632 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1634 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1635 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1636 │ ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1637 │ │ 1 │ 2 │ Subtotal │ 3 │ 4 │ 5 │ 3+4 │ 4+5 │ Subtotal │ Total │
1638 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1639 │ │ │ │ │ │ │ │ │ │ │ Row│ │ Row│ │ │ │ Row│ │ │ │ │
1640 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│ % │Count│ % │ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1641 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1642 │105b. How Almost │ 147│30.3%│ 246│50.7%│ 393│81.0%│ 62│12.8%│ 19│3.9%│ 11│2.3%│ 81.00│16.7%│ 30│6.2%│ 92│19.0%│ 485│100.0%│
1643 │likely is certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1644 │it that │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1645 │drivers Very │ 384│34.3%│ 552│49.2%│ 936│83.5%│ 120│10.7%│ 51│4.5%│ 14│1.2%│171.00│15.3%│ 65│5.8%│ 185│16.5%│ 1121│100.0%│
1646 │who have likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1647 │had too │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1648 │much to Somewhat│ 590│27.8%│ 1249│58.8%│ 1839│86.6%│ 193│ 9.1%│ 72│3.4%│ 20│ .9%│265.00│12.5%│ 92│4.3%│ 285│13.4%│ 2124│100.0%│
1649 │drink to likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1650 │drive │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1651 │safely Somewhat│ 278│26.6%│ 647│61.8%│ 925│88.3%│ 84│ 8.0%│ 32│3.1%│ 6│ .6%│116.00│11.1%│ 38│3.6%│ 122│11.7%│ 1047│100.0%│
1652 │will A. unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1653 │Get │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1654 │stopped by Very │ 141│28.5%│ 290│58.7%│ 431│87.2%│ 41│ 8.3%│ 18│3.6%│ 4│ .8%│ 59.00│11.9%│ 22│4.5%│ 63│12.8%│ 494│100.0%│
1655 │the unlikely│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1656 │police? │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1657 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1660 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1661 │ │ S1. Including yourself, how many members of this household are age 16 or older? │
1662 │ ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1663 │ │ 1 │ 2 │ Subtotal │ 3 │ 3+4 │ 4+5 │ Subtotal │ Total │
1664 │ ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1665 │ │ │ │ │ │ │ │ │ │ │ │ │ Row│ │ │ │ │
1666 │ │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│ % │Count│Row %│Count│ Row %│
1667 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1668 │105b. How likely is it that Almost │ 147│30.3%│ 246│50.7%│ 393│81.0%│ 62│12.8%│ 81.00│16.7%│ 30│6.2%│ 92│19.0%│ 485│100.0%│
1669 │drivers who have had too much certain │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1670 │to drink to drive safely will Very │ 384│34.3%│ 552│49.2%│ 936│83.5%│ 120│10.7%│171.00│15.3%│ 65│5.8%│ 185│16.5%│ 1121│100.0%│
1671 │A. Get stopped by the police? likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1672 │ Somewhat │ 590│27.8%│ 1249│58.8%│ 1839│86.6%│ 193│ 9.1%│265.00│12.5%│ 92│4.3%│ 285│13.4%│ 2124│100.0%│
1673 │ likely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1674 │ Somewhat │ 278│26.6%│ 647│61.8%│ 925│88.3%│ 84│ 8.0%│116.00│11.1%│ 38│3.6%│ 122│11.7%│ 1047│100.0%│
1675 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1676 │ Very │ 141│28.5%│ 290│58.7%│ 431│87.2%│ 41│ 8.3%│ 59.00│11.9%│ 22│4.5%│ 63│12.8%│ 494│100.0%│
1677 │ unlikely │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1678 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1682 AT_SETUP([CTABLES CLABELS])
1683 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1684 AT_DATA([ctables.sps],
1686 CTABLES /TABLE AgeGroup BY qns3a.
1687 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1688 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1689 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1690 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1693 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1695 ╭───────────────────────┬────────────╮
1701 ├───────────────────────┼─────┼──────┤
1702 │Age group 15 or younger│ 0│ 0│
1703 │ 16 to 25 │ 594│ 505│
1704 │ 26 to 35 │ 476│ 491│
1705 │ 36 to 45 │ 489│ 548│
1706 │ 46 to 55 │ 526│ 649│
1707 │ 56 to 65 │ 516│ 731│
1708 │ 66 or older │ 531│ 943│
1709 ╰───────────────────────┴─────┴──────╯
1712 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1714 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1716 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1717 │ │ 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 │
1718 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
1719 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1720 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
1721 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1722 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
1723 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1724 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1727 ╭──────────────────────────────┬────────────╮
1731 ├──────────────────────────────┼────────────┤
1732 │Age group 15 or younger Male │ 0│
1734 │ ╶────────────────────┼────────────┤
1735 │ 16 to 25 Male │ 594│
1737 │ ╶────────────────────┼────────────┤
1738 │ 26 to 35 Male │ 476│
1740 │ ╶────────────────────┼────────────┤
1741 │ 36 to 45 Male │ 489│
1743 │ ╶────────────────────┼────────────┤
1744 │ 46 to 55 Male │ 526│
1746 │ ╶────────────────────┼────────────┤
1747 │ 56 to 65 Male │ 516│
1749 │ ╶────────────────────┼────────────┤
1750 │ 66 or older Male │ 531│
1752 ╰──────────────────────────────┴────────────╯
1756 ╭─────────┬────────────╮
1762 ├─────────┼─────┼──────┤
1764 ╰─────────┴─────┴──────╯
1768 ╭─────────┬────────────╮
1774 ├─────────┼─────┼──────┤
1775 │Age group│ 594│ 505│
1776 ╰─────────┴─────┴──────╯
1780 ╭─────────┬────────────╮
1786 ├─────────┼─────┼──────┤
1787 │Age group│ 476│ 491│
1788 ╰─────────┴─────┴──────╯
1792 ╭─────────┬────────────╮
1798 ├─────────┼─────┼──────┤
1799 │Age group│ 489│ 548│
1800 ╰─────────┴─────┴──────╯
1804 ╭─────────┬────────────╮
1810 ├─────────┼─────┼──────┤
1811 │Age group│ 526│ 649│
1812 ╰─────────┴─────┴──────╯
1816 ╭─────────┬────────────╮
1822 ├─────────┼─────┼──────┤
1823 │Age group│ 516│ 731│
1824 ╰─────────┴─────┴──────╯
1828 ╭─────────┬────────────╮
1834 ├─────────┼─────┼──────┤
1835 │Age group│ 531│ 943│
1836 ╰─────────┴─────┴──────╯
1840 ╭───────────────────────┬────────────╮
1844 ├───────────────────────┼────────────┤
1845 │Age group 15 or younger│ 0│
1851 │ 66 or older │ 531│
1852 ╰───────────────────────┴────────────╯
1856 ╭───────────────────────┬────────────╮
1860 ├───────────────────────┼────────────┤
1861 │Age group 15 or younger│ 0│
1867 │ 66 or older │ 943│
1868 ╰───────────────────────┴────────────╯
1872 AT_SETUP([CTABLES missing values])
1873 AT_DATA([ctables.sps],
1874 [[DATA LIST LIST NOTABLE/x y.
1913 MISSING VALUES x (1, 2) y (2, 3).
1914 VARIABLE LEVEL ALL (NOMINAL).
1916 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1917 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1918 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1919 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
1920 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1921 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1922 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1923 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1924 /CATEGORIES VARIABLES=ALL TOTAL=YES
1925 /SLABELS POSITION=ROW.
1926 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1927 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1928 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1929 /SLABELS POSITION=ROW.
1930 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
1931 TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1932 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1933 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1934 /SLABELS POSITION=ROW.
1936 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1938 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1939 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1940 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1941 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1942 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1943 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1944 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1945 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1946 dnl Note that Column Total N % doesn't add up to 100 because missing
1947 dnl values are included in the total but not shown as a category and this
1948 dnl is expected behavior.
1951 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1952 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1953 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1954 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1955 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1956 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1957 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1958 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1959 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1960 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1961 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1962 dnl values are included in the total but not shown as a category and this
1963 dnl is expected behavior.
1966 ╭────────────────────────┬───────────────────────────╮
1968 │ ├──────┬──────┬──────┬──────┤
1969 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1970 ├────────────────────────┼──────┼──────┼──────┼──────┤
1971 │x 3.00 Count │ 1│ 1│ 1│ 3│
1972 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1973 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1974 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1975 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1976 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1977 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1978 │ Valid N │ │ │ │ 3│
1979 │ Total N │ │ │ │ 6│
1980 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1981 │ 4.00 Count │ 1│ 1│ 1│ 3│
1982 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1983 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1984 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1985 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1986 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1987 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1988 │ Valid N │ │ │ │ 3│
1989 │ Total N │ │ │ │ 6│
1990 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1991 │ 5.00 Count │ 1│ 1│ 1│ 3│
1992 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1993 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1994 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1995 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1996 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1997 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1998 │ Valid N │ │ │ │ 3│
1999 │ Total N │ │ │ │ 6│
2000 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2001 │ Total Count │ 3│ 3│ 3│ 9│
2002 │ Column % │100.0%│100.0%│100.0%│ .│
2003 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
2004 │ Column Total N %│100.0%│100.0%│100.0%│ .│
2005 │ Row % │ .│ .│ .│ .│
2006 │ Row Valid N % │ .│ .│ .│ .│
2007 │ Row Total N % │ .│ .│ .│ .│
2008 │ Valid N │ 3│ 3│ 3│ 9│
2009 │ Total N │ 6│ 6│ 6│ 36│
2010 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2013 ╭────────────────────────┬─────────────────────────────────────────╮
2015 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
2016 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2017 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2018 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2019 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2020 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2021 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2022 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2023 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2024 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2025 │ Valid N │ │ │ │ │ │ 0│
2026 │ Total N │ │ │ │ │ │ 6│
2027 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2028 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2029 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2030 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
2031 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2032 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2033 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2034 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2035 │ Valid N │ │ │ │ │ │ 0│
2036 │ Total N │ │ │ │ │ │ 6│
2037 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2038 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2039 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2040 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2041 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2042 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2043 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2044 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2045 │ Valid N │ │ │ │ │ │ 3│
2046 │ Total N │ │ │ │ │ │ 6│
2047 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2048 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2049 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2050 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2051 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2052 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2053 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2054 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2055 │ Valid N │ │ │ │ │ │ 3│
2056 │ Total N │ │ │ │ │ │ 6│
2057 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2058 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
2059 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2060 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
2061 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
2062 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2063 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
2064 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2065 │ Valid N │ │ │ │ │ │ 3│
2066 │ Total N │ │ │ │ │ │ 6│
2067 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2068 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
2069 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2070 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
2071 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
2072 │ Row % │ .│ .│ .│ .│ .│ .│
2073 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
2074 │ Row Total N % │ .│ .│ .│ .│ .│ .│
2075 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
2076 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
2077 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2080 ╭────────────────────────┬──────────────────────────────────╮
2082 │ ├──────┬──────┬──────┬──────┬──────┤
2083 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2084 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2085 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
2086 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2087 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2088 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2089 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2090 │ Row Valid N % │ .│ .│ .│ .│ .│
2091 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2092 │ Valid N │ │ │ │ │ 0│
2093 │ Total N │ │ │ │ │ 6│
2094 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2095 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
2096 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2097 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
2098 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2099 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2100 │ Row Valid N % │ .│ .│ .│ .│ .│
2101 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2102 │ Valid N │ │ │ │ │ 0│
2103 │ Total N │ │ │ │ │ 6│
2104 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2105 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
2106 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2107 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2108 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2109 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2110 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2111 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2112 │ Valid N │ │ │ │ │ 3│
2113 │ Total N │ │ │ │ │ 6│
2114 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2115 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
2116 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
2117 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
2118 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
2119 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2120 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
2121 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2122 │ Valid N │ │ │ │ │ 3│
2123 │ Total N │ │ │ │ │ 6│
2124 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2125 │ Total Count │ 4│ 4│ 4│ 4│ 16│
2126 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
2127 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
2128 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
2129 │ Row % │ .│ .│ .│ .│ .│
2130 │ Row Valid N % │ .│ .│ .│ .│ .│
2131 │ Row Total N % │ .│ .│ .│ .│ .│
2132 │ Valid N │ 2│ 0│ 2│ 2│ 6│
2133 │ Total N │ 5│ 5│ 5│ 5│ 30│
2134 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2138 AT_SETUP([CTABLES SMISSING=LISTWISE])
2139 AT_KEYWORDS([SMISSING LISTWISE])
2140 AT_DATA([ctables.sps],
2141 [[DATA LIST LIST NOTABLE/x y z.
2149 VARIABLE LEVEL x (NOMINAL).
2151 CTABLES /TABLE (y + z) > x.
2152 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2154 * The following doesn't come out as listwise because the tables are
2155 separate, not linked by an > operator.
2156 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2158 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2188 AT_SETUP([CTABLES VLABELS - variables on different axes])
2189 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2190 AT_DATA([ctables.sps],
2192 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2193 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME /TABLE qnd5a BY qns3a.
2194 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL /TABLE qnd5a BY qns3a.
2195 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH /TABLE qnd5a BY qns3a.
2196 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a BY qns3a.
2198 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2200 ╭────────────────────────────────────────────────────────────────┬────────────╮
2206 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2207 │D5a. What would you say is your primary Cuban │ 13│ 7│
2208 │ethnic background? Mexican │ 175│ 136│
2210 │ South American │ 21│ 13│
2211 │ Central American │ 27│ 25│
2212 │ Puerto Rican, OR │ 37│ 41│
2213 │ Something else │ 35│ 33│
2214 │ Multiple - cannot │ 2│ 5│
2216 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2219 ╭──────────────────────────────────┬────────────╮
2225 ├──────────────────────────────────┼─────┼──────┤
2226 │QND5A Cuban │ 13│ 7│
2227 │ Mexican │ 175│ 136│
2229 │ South American │ 21│ 13│
2230 │ Central American │ 27│ 25│
2231 │ Puerto Rican, OR │ 37│ 41│
2232 │ Something else │ 35│ 33│
2233 │ Multiple - cannot choose one│ 2│ 5│
2234 ╰──────────────────────────────────┴─────┴──────╯
2237 ╭────────────────────────────────────────────────────────────────┬────────────╮
2243 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2244 │D5a. What would you say is your primary Cuban │ 13│ 7│
2245 │ethnic background? Mexican │ 175│ 136│
2247 │ South American │ 21│ 13│
2248 │ Central American │ 27│ 25│
2249 │ Puerto Rican, OR │ 37│ 41│
2250 │ Something else │ 35│ 33│
2251 │ Multiple - cannot │ 2│ 5│
2253 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2256 ╭────────────────────────────────────────────────────────────┬────────────────╮
2259 │ ├───────┬────────┤
2261 │ ├───────┼────────┤
2263 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2264 │QND5A D5a. What would you say is your Cuban │ 13│ 7│
2265 │primary ethnic background? Mexican │ 175│ 136│
2267 │ South American │ 21│ 13│
2268 │ Central American │ 27│ 25│
2269 │ Puerto Rican, OR │ 37│ 41│
2270 │ Something else │ 35│ 33│
2271 │ Multiple - cannot │ 2│ 5│
2273 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2276 ╭────────────────────────────┬─────┬──────╮
2280 ├────────────────────────────┼─────┼──────┤
2282 │Mexican │ 175│ 136│
2284 │South American │ 21│ 13│
2285 │Central American │ 27│ 25│
2286 │Puerto Rican, OR │ 37│ 41│
2287 │Something else │ 35│ 33│
2288 │Multiple - cannot choose one│ 2│ 5│
2289 ╰────────────────────────────┴─────┴──────╯
2293 AT_SETUP([CTABLES VLABELS - stacked variables])
2294 AT_KEYWORDS([stack stacking])
2295 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2296 AT_DATA([ctables.sps],
2298 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2299 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2300 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2301 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2302 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2304 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2306 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2308 ├───────────────────────────────────────────────────────────────────────┼─────┤
2309 │D5a. What would you say is your primary ethnic Cuban │ 20│
2310 │background? Mexican │ 311│
2312 │ South American │ 34│
2313 │ Central American │ 52│
2314 │ Puerto Rican, OR │ 78│
2315 │ Something else │ 68│
2316 │ Multiple - cannot │ 7│
2318 ├───────────────────────────────────────────────────────────────────────┼─────┤
2321 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2324 ╭─────────────────────────────────────────┬─────╮
2326 ├─────────────────────────────────────────┼─────┤
2330 │ South American │ 34│
2331 │ Central American │ 52│
2332 │ Puerto Rican, OR │ 78│
2333 │ Something else │ 68│
2334 │ Multiple - cannot choose one│ 7│
2335 ├─────────────────────────────────────────┼─────┤
2336 │S3a. GENDER: Male │ 3132│
2338 ╰─────────────────────────────────────────┴─────╯
2341 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2343 ├───────────────────────────────────────────────────────────────────────┼─────┤
2344 │D5a. What would you say is your primary ethnic Cuban │ 20│
2345 │background? Mexican │ 311│
2347 │ South American │ 34│
2348 │ Central American │ 52│
2349 │ Puerto Rican, OR │ 78│
2350 │ Something else │ 68│
2351 │ Multiple - cannot │ 7│
2353 ├───────────────────────────────────────────────────────────────────────┼─────┤
2355 ├───────────────────────────────────────────────────────────────────────┼─────┤
2357 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2360 ╭─────────────────────────────┬─────╮
2362 ├─────────────────────────────┼─────┤
2364 ├─────────────────────────────┼─────┤
2366 ├─────────────────────────────┼─────┤
2368 ├─────────────────────────────┼─────┤
2369 │South American │ 34│
2370 ├─────────────────────────────┼─────┤
2371 │Central American │ 52│
2372 ├─────────────────────────────┼─────┤
2373 │Puerto Rican, OR │ 78│
2374 ├─────────────────────────────┼─────┤
2375 │Something else │ 68│
2376 ├─────────────────────────────┼─────┤
2377 │Multiple - cannot choose one │ 7│
2378 ├─────────────────────────────┼─────┤
2379 │S3a. GENDER: Male │ 3132│
2381 ╰─────────────────────────────┴─────╯
2384 ╭────────────────────────────┬─────╮
2386 ├────────────────────────────┼─────┤
2390 │South American │ 34│
2391 │Central American │ 52│
2392 │Puerto Rican, OR │ 78│
2393 │Something else │ 68│
2394 │Multiple - cannot choose one│ 7│
2397 ╰────────────────────────────┴─────╯
2401 AT_SETUP([CTABLES VLABELS - nested variables])
2402 AT_KEYWORDS([nest nesting])
2403 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2404 AT_DATA([ctables.sps],
2406 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2407 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2408 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2409 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2410 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2412 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2414 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2416 ├───────────────────────────────────────────────────────────────────────┼─────┤
2417 │D5a. What would you say is your Cuban QNS3A Male │ 13│
2418 │primary ethnic background? Female│ 7│
2419 │ ╶─────────────────────────────────┼─────┤
2420 │ Mexican QNS3A Male │ 175│
2422 │ ╶─────────────────────────────────┼─────┤
2423 │ Spanish QNS3A Male │ 20│
2425 │ ╶─────────────────────────────────┼─────┤
2426 │ South American QNS3A Male │ 21│
2428 │ ╶─────────────────────────────────┼─────┤
2429 │ Central American QNS3A Male │ 27│
2431 │ ╶─────────────────────────────────┼─────┤
2432 │ Puerto Rican, OR QNS3A Male │ 37│
2434 │ ╶─────────────────────────────────┼─────┤
2435 │ Something else QNS3A Male │ 35│
2437 │ ╶─────────────────────────────────┼─────┤
2438 │ Multiple - cannot QNS3A Male │ 2│
2439 │ choose one Female│ 5│
2440 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2443 ╭──────────────────────────────────────────────────────┬─────╮
2445 ├──────────────────────────────────────────────────────┼─────┤
2446 │QND5A Cuban S3a. GENDER: Male │ 13│
2448 │ ╶────────────────────────────────────────────────┼─────┤
2449 │ Mexican S3a. GENDER: Male │ 175│
2451 │ ╶────────────────────────────────────────────────┼─────┤
2452 │ Spanish S3a. GENDER: Male │ 20│
2454 │ ╶────────────────────────────────────────────────┼─────┤
2455 │ South American S3a. GENDER: Male │ 21│
2457 │ ╶────────────────────────────────────────────────┼─────┤
2458 │ Central American S3a. GENDER: Male │ 27│
2460 │ ╶────────────────────────────────────────────────┼─────┤
2461 │ Puerto Rican, OR S3a. GENDER: Male │ 37│
2463 │ ╶────────────────────────────────────────────────┼─────┤
2464 │ Something else S3a. GENDER: Male │ 35│
2466 │ ╶────────────────────────────────────────────────┼─────┤
2467 │ Multiple - cannot choose one S3a. GENDER: Male │ 2│
2469 ╰──────────────────────────────────────────────────────┴─────╯
2472 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2474 ├───────────────────────────────────────────────────────────────────────┼─────┤
2475 │D5a. What would you say is your primary Cuban Male │ 13│
2476 │ethnic background? Female│ 7│
2477 │ ╶────────────────────────────┼─────┤
2478 │ Mexican Male │ 175│
2480 │ ╶────────────────────────────┼─────┤
2481 │ Spanish Male │ 20│
2483 │ ╶────────────────────────────┼─────┤
2484 │ South American Male │ 21│
2486 │ ╶────────────────────────────┼─────┤
2487 │ Central American Male │ 27│
2489 │ ╶────────────────────────────┼─────┤
2490 │ Puerto Rican, OR Male │ 37│
2492 │ ╶────────────────────────────┼─────┤
2493 │ Something else Male │ 35│
2495 │ ╶────────────────────────────┼─────┤
2496 │ Multiple - cannot Male │ 2│
2497 │ choose one Female│ 5│
2498 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2501 ╭────────────────────────────────────────────────┬─────╮
2503 ├────────────────────────────────────────────────┼─────┤
2504 │Cuban S3a. GENDER: Male │ 13│
2506 ├────────────────────────────────────────────────┼─────┤
2507 │Mexican S3a. GENDER: Male │ 175│
2509 ├────────────────────────────────────────────────┼─────┤
2510 │Spanish S3a. GENDER: Male │ 20│
2512 ├────────────────────────────────────────────────┼─────┤
2513 │South American S3a. GENDER: Male │ 21│
2515 ├────────────────────────────────────────────────┼─────┤
2516 │Central American S3a. GENDER: Male │ 27│
2518 ├────────────────────────────────────────────────┼─────┤
2519 │Puerto Rican, OR S3a. GENDER: Male │ 37│
2521 ├────────────────────────────────────────────────┼─────┤
2522 │Something else S3a. GENDER: Male │ 35│
2524 ├────────────────────────────────────────────────┼─────┤
2525 │Multiple - cannot choose one S3a. GENDER: Male │ 2│
2527 ╰────────────────────────────────────────────────┴─────╯
2530 ╭───────────────────────────────────┬─────╮
2532 ├───────────────────────────────────┼─────┤
2535 ├───────────────────────────────────┼─────┤
2536 │Mexican Male │ 175│
2538 ├───────────────────────────────────┼─────┤
2541 ├───────────────────────────────────┼─────┤
2542 │South American Male │ 21│
2544 ├───────────────────────────────────┼─────┤
2545 │Central American Male │ 27│
2547 ├───────────────────────────────────┼─────┤
2548 │Puerto Rican, OR Male │ 37│
2550 ├───────────────────────────────────┼─────┤
2551 │Something else Male │ 35│
2553 ├───────────────────────────────────┼─────┤
2554 │Multiple - cannot choose one Male │ 2│
2556 ╰───────────────────────────────────┴─────╯
2560 AT_SETUP([CTABLES FORMAT EMPTY])
2561 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2562 AT_DATA([ctables.sps],
2564 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2565 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2566 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2568 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2570 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2571 │ │ D5. ETHNICITY: Are you of │
2572 │ │ Hispanic or Latino origin or │
2574 │ ├───────────────┬───────────────┤
2576 │ ├───────────────┼───────────────┤
2578 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2579 │D5a. What would you say is Cuban │ 20│ 0│
2580 │your primary ethnic Mexican │ 311│ 0│
2581 │background? Spanish │ 48│ 0│
2582 │ South American │ 34│ 0│
2583 │ Central American│ 52│ 0│
2584 │ Puerto Rican, OR│ 78│ 0│
2585 │ Something else │ 68│ 0│
2586 │ Multiple - │ 7│ 0│
2587 │ cannot choose │ │ │
2589 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2592 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2593 │ │ D5. ETHNICITY: Are you of │
2594 │ │ Hispanic or Latino origin or │
2596 │ ├───────────────┬───────────────┤
2598 │ ├───────────────┼───────────────┤
2600 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2601 │D5a. What would you say is Cuban │ 20│ │
2602 │your primary ethnic Mexican │ 311│ │
2603 │background? Spanish │ 48│ │
2604 │ South American │ 34│ │
2605 │ Central American│ 52│ │
2606 │ Puerto Rican, OR│ 78│ │
2607 │ Something else │ 68│ │
2609 │ cannot choose │ │ │
2611 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2614 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2615 │ │ D5. ETHNICITY: Are you of │
2616 │ │ Hispanic or Latino origin or │
2618 │ ├───────────────┬───────────────┤
2620 │ ├───────────────┼───────────────┤
2622 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2623 │D5a. What would you say is Cuban │ 20│n/a │
2624 │your primary ethnic Mexican │ 311│n/a │
2625 │background? Spanish │ 48│n/a │
2626 │ South American │ 34│n/a │
2627 │ Central American│ 52│n/a │
2628 │ Puerto Rican, OR│ 78│n/a │
2629 │ Something else │ 68│n/a │
2630 │ Multiple - │ 7│n/a │
2631 │ cannot choose │ │ │
2633 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2637 AT_SETUP([CTABLES FORMAT MISSING])
2638 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2639 AT_DATA([ctables.sps],
2641 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2643 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2645 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2646 │ │ D5. ETHNICITY: Are you of │
2647 │ │ Hispanic or Latino origin or │
2649 │ ├───────────────┬───────────────┤
2651 │ ├───────────────┼───────────────┤
2652 │ │ Column % │ Column % │
2653 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2654 │D5a. What would you say is Cuban │ 3.2%│(no data) │
2655 │your primary ethnic Mexican │ 50.3%│(no data) │
2656 │background? Spanish │ 7.8%│(no data) │
2657 │ South American │ 5.5%│(no data) │
2658 │ Central American│ 8.4%│(no data) │
2659 │ Puerto Rican, OR│ 12.6%│(no data) │
2660 │ Something else │ 11.0%│(no data) │
2661 │ Multiple - │ 1.1%│(no data) │
2662 │ cannot choose │ │ │
2664 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2668 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2669 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2670 AT_DATA([ctables.sps],
2672 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2673 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2674 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2676 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2678 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2680 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2681 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2682 │occasion? 1 │ 491│ 34.9%│
2702 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2705 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2707 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2708 │38. How many drinks did you have on that Less than one│ 7│ .5%│
2709 │occasion? 1 │ 491│ 34.9%│
2729 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2732 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2734 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2735 │38. How many drinks did you have on that Less than one│<10 │ .5%│
2736 │occasion? 1 │ 491│ 34.9%│
2756 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2760 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2761 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2762 AT_DATA([ctables.sps],
2764 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2766 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2778 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2779 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2780 maximumColumnWidth="192"
2781 minimumColumnWidth="96"
2785 AT_SETUP([CTABLES special formats])
2786 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2787 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2788 AT_DATA([ctables.sps],
2790 COMPUTE x = qnd3 - 4.
2791 CTABLES /TABLE x[MINIMUM NEGPAREN8.1, MINIMUM NEQUAL8.1, MINIMUM PAREN8.1, MINIMUM PCTPAREN8.1, MAXIMUM NEGPAREN8.1, MAXIMUM NEQUAL8.1, MAXIMUM PAREN8.1, MAXIMUM PCTPAREN8.1].
2793 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2795 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2796 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2797 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2798 │x│(3.0) │N=-3.0 │(-3.0) │(-3.0%)│8.0 │N=8.0 │(8.0) │(8.0%) │
2799 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2803 AT_SETUP([CTABLES TITLES])
2804 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2805 AT_DATA([ctables.sps],
2808 /VLABELS VARIABLES=qn1 DISPLAY=NONE
2809 /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2810 /TITLES TITLE='How often do you drive?'
2811 CAPTION='Generated )TIME on )DATE'
2814 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
2815 s&../../..&MM/DD/YY&'], [0], [dnl
2816 How often do you drive?
2817 ╭───────────────────────────────────┬─────────────────────────────────────────╮
2819 │ ├────────────────────┬────────────────────┤
2821 │ ├────────────────────┼────────────────────┤
2822 │ │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
2823 │ │ you of Hispanic or │ you of Hispanic or │
2824 │ │ Latino origin or │ Latino origin or │
2825 │( ( 1. How often do you usually │ descent? │ descent? │
2826 │drive a car or other motor ├─────────┬──────────┼─────────┬──────────┤
2827 │vehicle?) ) BY S3a. GENDER: > D5. │ Yes │ No │ Yes │ No │
2828 │ETHNICITY: Are you of Hispanic or ├─────────┼──────────┼─────────┼──────────┤
2829 │Latino origin or descent? │ Count │ Count │ Count │ Count │
2830 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
2831 │Every day │ 218│ 2066│ 166│ 2175│
2832 │Several days a week │ 44│ 391│ 45│ 782│
2833 │Once a week or less │ 16│ 109│ 12│ 223│
2834 │Only certain times a year │ 15│ 41│ 11│ 61│
2835 │Never │ 39│ 150│ 56│ 278│
2836 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
2837 Generated HH:MM:SS on MM/DD/YY
2841 AT_SETUP([CTABLES area definitions])
2842 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2843 AT_DATA([ctables.sps],
2846 /VLABELS VARIABLES=ALL DISPLAY=NAME
2847 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLE.ID, LAYER.ID, SUBTABLE.ID]
2848 /SLABELS POSITION=ROW
2849 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROW.ID, LAYERROW.ID]
2850 /SLABELS POSITION=ROW
2851 /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COL.ID, LAYERCOL.ID]
2852 /SLABELS POSITION=ROW.
2854 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
2857 ╭─────────────────────────────┬─────────────┬──────╮
2859 │ ├──────┬──────┼───┬──┤
2861 │ ├──────┼──────┤ │ │
2862 │ │ QN86 │ QN86 │ │ │
2863 │ ├───┬──┼───┬──┤ │ │
2864 │ │Yes│No│Yes│No│Yes│No│
2865 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
2866 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2867 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2868 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
2869 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2870 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2871 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2872 │ Subtable ID│ 1│ 1│ 2│ 2│ 3│ 3│
2873 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
2874 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2875 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2876 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
2877 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2878 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2879 │ Layer ID │ 1│ 1│ 1│ 1│ 2│ 2│
2880 │ Subtable ID│ 4│ 4│ 5│ 5│ 6│ 6│
2881 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
2885 ╭─────────────────────────────┬─────────────┬──────╮
2887 │ ├──────┬──────┼───┬──┤
2889 │ ├──────┼──────┤ │ │
2890 │ │ QN86 │ QN86 │ │ │
2891 │ ├───┬──┼───┬──┤ │ │
2892 │ │Yes│No│Yes│No│Yes│No│
2893 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
2894 │QN61 Yes QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2895 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2896 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
2897 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2898 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2899 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2900 │ Subtable ID│ 7│ 7│ 8│ 8│ 9│ 9│
2901 │ ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
2902 │ No QN57 Yes Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2903 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2904 │ Subtable ID│ 10│10│ 11│11│ 12│12│
2905 │ ╶───────────────┼───┼──┼───┼──┼───┼──┤
2906 │ No Table ID │ 1│ 1│ 1│ 1│ 2│ 2│
2907 │ Layer ID │ 3│ 3│ 3│ 3│ 4│ 4│
2908 │ Subtable ID│ 10│10│ 11│11│ 12│12│
2909 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
2913 ╭──────────────────────────────┬─────────────┬──────╮
2915 │ ├──────┬──────┼───┬──┤
2917 │ ├──────┼──────┤ │ │
2918 │ │ QN86 │ QN86 │ │ │
2919 │ ├───┬──┼───┬──┤ │ │
2920 │ │Yes│No│Yes│No│Yes│No│
2921 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
2922 │QN61 Yes QN57 Yes Row ID │ 1│ 1│ 2│ 2│ 3│ 3│
2923 │ Layer Row ID│ 1│ 1│ 1│ 1│ 2│ 2│
2924 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2925 │ No Row ID │ 4│ 4│ 5│ 5│ 6│ 6│
2926 │ Layer Row ID│ 3│ 3│ 3│ 3│ 4│ 4│
2927 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
2928 │ No QN57 Yes Row ID │ 7│ 7│ 8│ 8│ 9│ 9│
2929 │ Layer Row ID│ 5│ 5│ 5│ 5│ 6│ 6│
2930 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2931 │ No Row ID │ 10│10│ 11│11│ 12│12│
2932 │ Layer Row ID│ 7│ 7│ 7│ 7│ 8│ 8│
2933 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
2937 ╭──────────────────────────────┬─────────────┬──────╮
2939 │ ├──────┬──────┼───┬──┤
2941 │ ├──────┼──────┤ │ │
2942 │ │ QN86 │ QN86 │ │ │
2943 │ ├───┬──┼───┬──┤ │ │
2944 │ │Yes│No│Yes│No│Yes│No│
2945 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
2946 │QN61 Yes QN57 Yes Row ID │ 13│13│ 14│14│ 15│15│
2947 │ Layer Row ID│ 9│ 9│ 9│ 9│ 10│10│
2948 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2949 │ No Row ID │ 16│16│ 17│17│ 18│18│
2950 │ Layer Row ID│ 11│11│ 11│11│ 12│12│
2951 │ ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
2952 │ No QN57 Yes Row ID │ 19│19│ 20│20│ 21│21│
2953 │ Layer Row ID│ 13│13│ 13│13│ 14│14│
2954 │ ╶────────────────┼───┼──┼───┼──┼───┼──┤
2955 │ No Row ID │ 22│22│ 23│23│ 24│24│
2956 │ Layer Row ID│ 15│15│ 15│15│ 16│16│
2957 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
2961 ╭─────────────────────────────────┬─────────────┬──────╮
2963 │ ├──────┬──────┼───┬──┤
2965 │ ├──────┼──────┤ │ │
2966 │ │ QN86 │ QN86 │ │ │
2967 │ ├───┬──┼───┬──┤ │ │
2968 │ │Yes│No│Yes│No│Yes│No│
2969 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
2970 │QN61 Yes QN57 Yes Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
2971 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2972 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2973 │ No Column ID │ 1│ 2│ 3│ 4│ 5│ 6│
2974 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2975 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
2976 │ No QN57 Yes Column ID │ 7│ 8│ 9│10│ 11│12│
2977 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2978 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2979 │ No Column ID │ 7│ 8│ 9│10│ 11│12│
2980 │ Layer Column ID│ 1│ 2│ 3│ 4│ 5│ 6│
2981 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
2985 ╭─────────────────────────────────┬─────────────┬──────╮
2987 │ ├──────┬──────┼───┬──┤
2989 │ ├──────┼──────┤ │ │
2990 │ │ QN86 │ QN86 │ │ │
2991 │ ├───┬──┼───┬──┤ │ │
2992 │ │Yes│No│Yes│No│Yes│No│
2993 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
2994 │QN61 Yes QN57 Yes Column ID │ 13│14│ 15│16│ 17│18│
2995 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2996 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
2997 │ No Column ID │ 13│14│ 15│16│ 17│18│
2998 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
2999 │ ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3000 │ No QN57 Yes Column ID │ 19│20│ 21│22│ 23│24│
3001 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3002 │ ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3003 │ No Column ID │ 19│20│ 21│22│ 23│24│
3004 │ Layer Column ID│ 7│ 8│ 9│10│ 11│12│
3005 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3009 AT_SETUP([CTABLES categorical summary functions])
3010 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3011 AT_DATA([ctables.sps],
3014 /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
3015 /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
3016 /SLABELS POSITION=ROW.
3018 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
3020 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
3021 │ │ D5a. What would you say is your primary ethnic background? │
3022 │ ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
3023 │ │ │ │ │ │ │ │ │ Multiple - │ │ │ │
3024 │ │ │ │ │ South │ Central │ Puerto │ Something│ cannot choose│ Don't│ │ │
3025 │ │Cuban│Mexican│Spanish│ American │ American │Rican, OR│ else │ one │ know │Refused│Total│
3026 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3027 │Region NE Count │ 6│ 8│ 8│ 11│ 7│ 39│ 23│ 2│ 0│ 1│ 105│
3028 │ Row % │ 5.7%│ 7.6%│ 7.6%│ 10.5%│ 6.7%│ 37.1%│ 21.9%│ 1.9%│ .0%│ 1.0%│ │
3029 │ Row │ 5.8%│ 7.7%│ 7.7%│ 10.6%│ 6.7%│ 37.5%│ 22.1%│ 1.9%│ .0%│ .0%│ │
3030 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3031 │ % │ │ │ │ │ │ │ │ │ │ │ │
3032 │ Row │ .4%│ .6%│ .6%│ .8%│ .5%│ 2.8%│ 1.6%│ .1%│ .0%│ .1%│ │
3033 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3034 │ % │ │ │ │ │ │ │ │ │ │ │ │
3035 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 104│
3036 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1409│
3037 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3038 │ MW Count │ 3│ 24│ 1│ 4│ 5│ 9│ 6│ 0│ 0│ 1│ 53│
3039 │ Row % │ 5.7%│ 45.3%│ 1.9%│ 7.5%│ 9.4%│ 17.0%│ 11.3%│ .0%│ .0%│ 1.9%│ │
3040 │ Row │ 5.8%│ 46.2%│ 1.9%│ 7.7%│ 9.6%│ 17.3%│ 11.5%│ .0%│ .0%│ .0%│ │
3041 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3042 │ % │ │ │ │ │ │ │ │ │ │ │ │
3043 │ Row │ .2%│ 1.5%│ .1%│ .2%│ .3%│ .5%│ .4%│ .0%│ .0%│ .1%│ │
3044 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3045 │ % │ │ │ │ │ │ │ │ │ │ │ │
3046 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 52│
3047 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1654│
3048 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3049 │ S Count │ 10│ 113│ 11│ 14│ 25│ 23│ 20│ 2│ 3│ 2│ 223│
3050 │ Row % │ 4.5%│ 50.7%│ 4.9%│ 6.3%│ 11.2%│ 10.3%│ 9.0%│ .9%│ 1.3%│ .9%│ │
3051 │ Row │ 4.6%│ 51.8%│ 5.0%│ 6.4%│ 11.5%│ 10.6%│ 9.2%│ .9%│ .0%│ .0%│ │
3052 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3053 │ % │ │ │ │ │ │ │ │ │ │ │ │
3054 │ Row │ .4%│ 4.7%│ .5%│ .6%│ 1.0%│ 1.0%│ .8%│ .1%│ .1%│ .1%│ │
3055 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3056 │ % │ │ │ │ │ │ │ │ │ │ │ │
3057 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 218│
3058 │ Total N│ │ │ │ │ │ │ │ │ │ │ 2390│
3059 │ ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
3060 │ W Count │ 1│ 166│ 28│ 5│ 15│ 7│ 19│ 3│ 0│ 1│ 245│
3061 │ Row % │ .4%│ 67.8%│ 11.4%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .4%│ │
3062 │ Row │ .4%│ 68.0%│ 11.5%│ 2.0%│ 6.1%│ 2.9%│ 7.8%│ 1.2%│ .0%│ .0%│ │
3063 │ Valid N│ │ │ │ │ │ │ │ │ │ │ │
3064 │ % │ │ │ │ │ │ │ │ │ │ │ │
3065 │ Row │ .1%│ 10.7%│ 1.8%│ .3%│ 1.0%│ .5%│ 1.2%│ .2%│ .0%│ .1%│ │
3066 │ Total N│ │ │ │ │ │ │ │ │ │ │ │
3067 │ % │ │ │ │ │ │ │ │ │ │ │ │
3068 │ Valid N│ │ │ │ │ │ │ │ │ │ │ 244│
3069 │ Total N│ │ │ │ │ │ │ │ │ │ │ 1546│
3070 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
3075 AT_SETUP([CTABLES scale summary functions])
3076 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3077 AT_DATA([ctables.sps],
3081 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
3082 CTABLES later, to make the results easier to verify.
3083 SPLIT FILE BY REGION.
3086 /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
3087 /FORMAT NOTABLE /MISSING=INCLUDE.
3091 /VLABELS VARIABLE=qn19a DISPLAY=NAME /*XXX NONE yields an assertion failure
3092 /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, COLPCT.SUM]
3093 /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
3094 /SLABELS POSITION=ROW.
3096 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
3098 ╭────────────────┬────────╮
3100 ├────────────────┼────────┤
3103 │ ╶─────────┼────────┤
3105 │ ╶─────────┼────────┤
3107 │ ╶─────────┼────────┤
3109 │ ╶─────────┼────────┤
3111 │ ╶─────────┼────────┤
3113 │ ╶─────────┼────────┤
3115 │ ╶─────────┼────────┤
3117 │ ╶─────────┼────────┤
3119 │ ╶─────────┼────────┤
3121 │ ╶─────────┼────────┤
3123 ├────────────────┼────────┤
3126 │ ╶─────────┼────────┤
3128 │ ╶─────────┼────────┤
3130 │ ╶─────────┼────────┤
3132 │ ╶─────────┼────────┤
3134 │ ╶─────────┼────────┤
3136 │ ╶─────────┼────────┤
3138 │ ╶─────────┼────────┤
3140 │ ╶─────────┼────────┤
3142 │ ╶─────────┼────────┤
3144 │ ╶─────────┼────────┤
3146 ├────────────────┼────────┤
3149 │ ╶─────────┼────────┤
3151 │ ╶─────────┼────────┤
3153 │ ╶─────────┼────────┤
3155 │ ╶─────────┼────────┤
3157 │ ╶─────────┼────────┤
3159 │ ╶─────────┼────────┤
3161 │ ╶─────────┼────────┤
3163 │ ╶─────────┼────────┤
3165 │ ╶─────────┼────────┤
3167 │ ╶─────────┼────────┤
3169 ├────────────────┼────────┤
3172 │ ╶─────────┼────────┤
3174 │ ╶─────────┼────────┤
3176 │ ╶─────────┼────────┤
3178 │ ╶─────────┼────────┤
3180 │ ╶─────────┼────────┤
3182 │ ╶─────────┼────────┤
3184 │ ╶─────────┼────────┤
3186 │ ╶─────────┼────────┤
3188 │ ╶─────────┼────────┤
3190 │ ╶─────────┼────────┤
3192 ╰────────────────┴────────╯
3195 ╭───────────────────────────┬────────╮
3197 ├───────────────────────────┼────────┤
3198 │REGION NE Valid N │ 936│
3201 │ Std Error of Mean│ .14│
3204 │ Std Deviation │ 4.41│
3212 │ Column Sum % │ 21.8%│
3213 │ ╶────────────────────┼────────┤
3214 │ MW Valid N │ 1019│
3217 │ Std Error of Mean│ .16│
3220 │ Std Deviation │ 5.15│
3228 │ Column Sum % │ 24.3%│
3229 │ ╶────────────────────┼────────┤
3231 │ Missing │ 1114.00│
3233 │ Std Error of Mean│ .18│
3236 │ Std Deviation │ 6.44│
3244 │ Column Sum % │ 31.2%│
3245 │ ╶────────────────────┼────────┤
3249 │ Std Error of Mean│ .17│
3252 │ Std Deviation │ 5.25│
3260 │ Column Sum % │ 22.7%│
3261 ╰───────────────────────────┴────────╯
3266 AT_SETUP([CTABLES hidden scale VLABELS])
3267 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3268 AT_DATA([ctables.sps],
3271 /TABLE region BY qn19a + qn35
3272 /SLABELS POSITION=ROW.
3274 /VLABELS VARIABLE=qn19a DISPLAY=NONE
3275 /TABLE region BY qn19a + qn35
3276 /SLABELS POSITION=ROW.
3278 /VLABELS VARIABLE=qn35 DISPLAY=NONE
3279 /TABLE region BY qn19a + qn35
3280 /SLABELS POSITION=ROW.
3282 * This one in particular caused a crash because no categories were
3283 created on the column axis, so passing in 0 for the index was still
3284 too big for that number of categories. It was fixed by creating a
3285 name-only category for each variable despite the "NONE" request,
3286 then hiding the entire dimension's labels if all its labels were
3289 /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
3290 /TABLE region BY qn19a + qn35
3291 /SLABELS POSITION=ROW.
3293 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3295 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
3296 │ │ 19a. About how old were you│ 35. In the past thirty days, how│
3297 │ │ when you first starting │ many times have you driven a │
3298 │ │ drinking alcohol, not │ motor vehicle WITHIN TWO HOURS │
3299 │ │ counting small tastes or │ AFTER drinking alcoholic │
3300 │ │ sips of alcohol. │ beverages? │
3301 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
3302 │Region NE Mean│ 19.33│ 2│
3303 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3304 │ MW Mean│ 19.83│ 2│
3305 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3307 │ ╶───────┼────────────────────────────┼─────────────────────────────────┤
3309 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
3312 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
3313 │ │ │ 35. In the past thirty days, how many times have you │
3314 │ │ │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
3315 │ │QN19A│ alcoholic beverages? │
3316 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
3317 │Region NE Mean│19.33│ 2│
3318 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3320 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3322 │ ╶───────┼─────┼────────────────────────────────────────────────────────┤
3324 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
3327 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
3328 │ │ 19a. About how old were you when you first starting │ │
3329 │ │ drinking alcohol, not counting small tastes or sips of │ │
3331 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
3332 │Region NE Mean│ 19.33│ 2│
3333 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3334 │ MW Mean│ 19.83│ 2│
3335 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3337 │ ╶───────┼─────────────────────────────────────────────────────────┼────┤
3339 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
3342 ╭──────────────┬───────╮
3343 │Region NE Mean│19.33 2│
3350 ╰──────────────┴───────╯