3 dnl Features not yet implemented:
5 dnl - Preprocessing to distinguish categorical from scale.
7 dnl Features not yet tested:
8 dnl - Parsing (positive and negative)
9 dnl - String variables and values
10 dnl - Testing details of missing value handling in summaries.
11 dnl - test CLABELS ROWLABELS=LAYER.
13 dnl - Test WEIGHT and adjustment weights.
14 dnl - EMPTY=INCLUDE For string ranges.
15 dnl - Summary functions:
16 dnl * Separate summary functions for totals and subtotals.
17 dnl * )CILEVEL in summary label specification
21 dnl * ascending/descending
25 dnl * THRU (numeric ranges)
26 dnl * THRU (string ranges)
29 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
32 dnl - HIDESMALLCOUNTS.
33 dnl - Date/time variables and values
34 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
35 dnl - TITLES: )DATE, )TIME, )TABLE.
37 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
38 dnl * MISSING, OTHERNM
39 dnl * strings and string ranges
40 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
44 dnl - Summary functions:
45 dnl * U-prefix for unweighted summaries.
46 dnl * areaPCT.SUM and UareaPCT.SUM functions.
47 dnl - SPLIT FILE with SEPARATE splits
48 dnl - Definition of columns/rows when labels are rotated from one axis to another.
51 dnl - Multiple response sets
52 dnl - MRSETS subcommand.
53 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
56 dnl - Summary functions:
57 dnl * .LCL and .UCL suffixes.
60 dnl * Data-dependent sorting.
64 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
65 dnl produces a bad median:
67 dnl +--------------------------+-----------------------+
68 dnl | | S3a. GENDER: |
69 dnl | +-----------+-----------+
70 dnl | | Male | Female |
71 dnl | +----+------+----+------+
72 dnl | |Mean|Median|Mean|Median|
73 dnl +--------------------------+----+------+----+------+
74 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
75 dnl +--------------------------+----+------+----+------+
79 # AT_SETUP([CTABLES parsing])
80 # AT_DATA([ctables.sps],
81 # [[DATA LIST LIST NOTABLE /x y z.
82 # CTABLES /TABLE=(x + y) > z.
83 # CTABLES /TABLE=(x[c] + y[c]) > z.
84 # CTABLES /TABLE=(x + y) > z[c].
85 # CTABLES /TABLE=x BY y BY z.
86 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
87 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
89 # AT_CHECK([pspp ctables.sps])
92 AT_SETUP([CTABLES one categorical variable])
93 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
94 AT_DATA([ctables.sps],
97 CTABLES /TABLE BY qn1.
98 CTABLES /TABLE BY BY qn1.
100 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
102 ╭────────────────────────────────────────────────────────────────────────┬─────╮
104 ├────────────────────────────────────────────────────────────────────────┼─────┤
105 │ 1. How often do you usually drive a car or other Every day │ 4667│
106 │motor vehicle? Several days a week │ 1274│
107 │ Once a week or less │ 361│
108 │ Only certain times a │ 130│
111 ╰────────────────────────────────────────────────────────────────────────┴─────╯
114 ╭──────────────────────────────────────────────────────────────────────────────╮
115 │ 1. How often do you usually drive a car or other motor vehicle? │
116 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
117 │ │ Several days a │ Once a week or │ Only certain times a │ │
118 │Every day│ week │ less │ year │Never│
119 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
120 │ Count │ Count │ Count │ Count │Count│
121 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
122 │ 4667│ 1274│ 361│ 130│ 540│
123 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
135 AT_SETUP([CTABLES one scale variable])
136 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
137 AT_DATA([ctables.sps],
139 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
140 CTABLES /TABLE BY qnd1.
141 CTABLES /TABLE BY BY qnd1.
143 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
145 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
146 │ │ │ │ │ │ Std │ │ │
147 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
148 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
149 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
150 │age? │ │ │ │ │ │ │ │
151 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
154 ╭──────────────────────────╮
155 │D1. AGE: What is your age?│
156 ├──────────────────────────┤
158 ├──────────────────────────┤
160 ╰──────────────────────────╯
163 D1. AGE: What is your age?
172 AT_SETUP([CTABLES simple stacking])
173 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
174 AT_DATA([ctables.sps],
176 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
178 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
180 ╭───────────────────────────────────────────────────────────────┬──────────────╮
187 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
188 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
189 │too much to drink to drive safely will A. Get certain │ │ │
190 │stopped by the police? Very likely │ 21%│ 22%│
191 │ Somewhat │ 38%│ 42%│
193 │ Somewhat │ 21%│ 18%│
197 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
198 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
199 │too much to drink to drive safely will B. Have an certain │ │ │
200 │accident? Very likely │ 36%│ 45%│
201 │ Somewhat │ 39%│ 32%│
207 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
208 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
209 │too much to drink to drive safely will C. Be certain │ │ │
210 │convicted for drunk driving? Very likely │ 32%│ 28%│
211 │ Somewhat │ 27%│ 32%│
213 │ Somewhat │ 15%│ 15%│
217 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
218 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
219 │too much to drink to drive safely will D. Be certain │ │ │
220 │arrested for drunk driving? Very likely │ 26%│ 27%│
221 │ Somewhat │ 32%│ 35%│
223 │ Somewhat │ 17%│ 15%│
227 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
231 AT_SETUP([CTABLES show or hide empty categories])
232 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
233 AT_DATA([ctables.sps],
235 IF (qn105ba = 2) qn105ba = 1.
236 IF (qns3a = 1) qns3a = 2.
237 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
238 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
239 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
240 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
241 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
242 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
243 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
245 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
247 ╭──────────────────────────────────────────────────────────────┬───────────────╮
254 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
255 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
256 │too much to drink to drive safely will A. Get certain │ │ │
257 │stopped by the police? Very likely│ .│ 0%│
264 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
267 ╭──────────────────────────────────────────────────────────────┬───────────────╮
274 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
275 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
276 │too much to drink to drive safely will A. Get certain │ │ │
277 │stopped by the police? Somewhat │ .│ 40%│
283 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
286 ╭────────────────────────────────────────────────────────────────────┬─────────╮
293 ├────────────────────────────────────────────────────────────────────┼─────────┤
294 │105b. How likely is it that drivers who have had too Almost │ 32%│
295 │much to drink to drive safely will A. Get stopped by certain │ │
296 │the police? Very likely │ 0%│
303 ╰────────────────────────────────────────────────────────────────────┴─────────╯
306 ╭────────────────────────────────────────────────────────────────────┬─────────╮
313 ├────────────────────────────────────────────────────────────────────┼─────────┤
314 │105b. How likely is it that drivers who have had too Almost │ 32%│
315 │much to drink to drive safely will A. Get stopped by certain │ │
316 │the police? Somewhat │ 40%│
322 ╰────────────────────────────────────────────────────────────────────┴─────────╯
326 AT_SETUP([CTABLES simple nesting])
327 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
328 AT_DATA([ctables.sps],
330 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
331 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
332 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
333 /CATEGORIES VARIABLES=qns3a TOTAL=YES
334 /CLABELS ROW=OPPOSITE.
336 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
338 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
341 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
342 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
343 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
344 │drive safely will A. Get stopped by Total │ 700│ 10%│
345 │the police? ╶──────────────────────────┼─────┼──────┤
346 │ Very S3a. Male │ 660│ 10%│
347 │ likely GENDER: Female│ 842│ 12%│
349 │ ╶──────────────────────────┼─────┼──────┤
350 │ Somewhat S3a. Male │ 1174│ 17%│
351 │ likely GENDER: Female│ 1589│ 23%│
353 │ ╶──────────────────────────┼─────┼──────┤
354 │ Somewhat S3a. Male │ 640│ 9%│
355 │ unlikely GENDER: Female│ 667│ 10%│
357 │ ╶──────────────────────────┼─────┼──────┤
358 │ Very S3a. Male │ 311│ 5%│
359 │ unlikely GENDER: Female│ 298│ 4%│
361 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
362 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
363 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
364 │drive safely will B. Have an accident? Total │ 1100│ 16%│
365 │ ╶──────────────────────────┼─────┼──────┤
366 │ Very S3a. Male │ 1104│ 16%│
367 │ likely GENDER: Female│ 1715│ 25%│
369 │ ╶──────────────────────────┼─────┼──────┤
370 │ Somewhat S3a. Male │ 1203│ 17%│
371 │ likely GENDER: Female│ 1214│ 18%│
373 │ ╶──────────────────────────┼─────┼──────┤
374 │ Somewhat S3a. Male │ 262│ 4%│
375 │ unlikely GENDER: Female│ 168│ 2%│
377 │ ╶──────────────────────────┼─────┼──────┤
378 │ Very S3a. Male │ 81│ 1%│
379 │ unlikely GENDER: Female│ 59│ 1%│
381 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
382 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
383 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
384 │drive safely will C. Be convicted for Total │ 1149│ 17%│
385 │drunk driving? ╶──────────────────────────┼─────┼──────┤
386 │ Very S3a. Male │ 988│ 14%│
387 │ likely GENDER: Female│ 1049│ 15%│
389 │ ╶──────────────────────────┼─────┼──────┤
390 │ Somewhat S3a. Male │ 822│ 12%│
391 │ likely GENDER: Female│ 1210│ 18%│
393 │ ╶──────────────────────────┼─────┼──────┤
394 │ Somewhat S3a. Male │ 446│ 7%│
395 │ unlikely GENDER: Female│ 548│ 8%│
397 │ ╶──────────────────────────┼─────┼──────┤
398 │ Very S3a. Male │ 268│ 4%│
399 │ unlikely GENDER: Female│ 354│ 5%│
401 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
402 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
403 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
404 │drive safely will D. Be arrested for Total │ 1101│ 16%│
405 │drunk driving? ╶──────────────────────────┼─────┼──────┤
406 │ Very S3a. Male │ 805│ 12%│
407 │ likely GENDER: Female│ 1029│ 15%│
409 │ ╶──────────────────────────┼─────┼──────┤
410 │ Somewhat S3a. Male │ 975│ 14%│
411 │ likely GENDER: Female│ 1332│ 19%│
413 │ ╶──────────────────────────┼─────┼──────┤
414 │ Somewhat S3a. Male │ 535│ 8%│
415 │ unlikely GENDER: Female│ 560│ 8%│
417 │ ╶──────────────────────────┼─────┼──────┤
418 │ Very S3a. Male │ 270│ 4%│
419 │ unlikely GENDER: Female│ 279│ 4%│
421 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
424 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
425 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
426 │ │ certain│likely│ likely │ unlikely│unlikely│
427 │ ├────────┼──────┼─────────┼─────────┼────────┤
429 │ │ Table %│ % │ Table % │ Table % │ Table %│
430 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
431 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
432 │GENDER: is it that drivers│ │ │ │ │ │
433 │ who have had too │ │ │ │ │ │
434 │ much to drink to │ │ │ │ │ │
435 │ drive safely will │ │ │ │ │ │
436 │ A. Get stopped by │ │ │ │ │ │
437 │ the police? │ │ │ │ │ │
438 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
439 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
440 │ is it that drivers│ │ │ │ │ │
441 │ who have had too │ │ │ │ │ │
442 │ much to drink to │ │ │ │ │ │
443 │ drive safely will │ │ │ │ │ │
444 │ A. Get stopped by │ │ │ │ │ │
445 │ the police? │ │ │ │ │ │
446 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
447 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
448 │ is it that drivers│ │ │ │ │ │
449 │ who have had too │ │ │ │ │ │
450 │ much to drink to │ │ │ │ │ │
451 │ drive safely will │ │ │ │ │ │
452 │ A. Get stopped by │ │ │ │ │ │
453 │ the police? │ │ │ │ │ │
454 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
455 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
456 │GENDER: is it that drivers│ │ │ │ │ │
457 │ who have had too │ │ │ │ │ │
458 │ much to drink to │ │ │ │ │ │
459 │ drive safely will │ │ │ │ │ │
460 │ B. Have an │ │ │ │ │ │
461 │ accident? │ │ │ │ │ │
462 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
463 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
464 │ is it that drivers│ │ │ │ │ │
465 │ who have had too │ │ │ │ │ │
466 │ much to drink to │ │ │ │ │ │
467 │ drive safely will │ │ │ │ │ │
468 │ B. Have an │ │ │ │ │ │
469 │ accident? │ │ │ │ │ │
470 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
471 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
472 │ is it that drivers│ │ │ │ │ │
473 │ who have had too │ │ │ │ │ │
474 │ much to drink to │ │ │ │ │ │
475 │ drive safely will │ │ │ │ │ │
476 │ B. Have an │ │ │ │ │ │
477 │ accident? │ │ │ │ │ │
478 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
479 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
480 │GENDER: is it that drivers│ │ │ │ │ │
481 │ who have had too │ │ │ │ │ │
482 │ much to drink to │ │ │ │ │ │
483 │ drive safely will │ │ │ │ │ │
484 │ C. Be convicted │ │ │ │ │ │
485 │ for drunk driving?│ │ │ │ │ │
486 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
487 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
488 │ is it that drivers│ │ │ │ │ │
489 │ who have had too │ │ │ │ │ │
490 │ much to drink to │ │ │ │ │ │
491 │ drive safely will │ │ │ │ │ │
492 │ C. Be convicted │ │ │ │ │ │
493 │ for drunk driving?│ │ │ │ │ │
494 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
495 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
496 │ is it that drivers│ │ │ │ │ │
497 │ who have had too │ │ │ │ │ │
498 │ much to drink to │ │ │ │ │ │
499 │ drive safely will │ │ │ │ │ │
500 │ C. Be convicted │ │ │ │ │ │
501 │ for drunk driving?│ │ │ │ │ │
502 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
503 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
504 │GENDER: is it that drivers│ │ │ │ │ │
505 │ who have had too │ │ │ │ │ │
506 │ much to drink to │ │ │ │ │ │
507 │ drive safely will │ │ │ │ │ │
508 │ D. Be arrested for│ │ │ │ │ │
509 │ drunk driving? │ │ │ │ │ │
510 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
511 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
512 │ is it that drivers│ │ │ │ │ │
513 │ who have had too │ │ │ │ │ │
514 │ much to drink to │ │ │ │ │ │
515 │ drive safely will │ │ │ │ │ │
516 │ D. Be arrested for│ │ │ │ │ │
517 │ drunk driving? │ │ │ │ │ │
518 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
519 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
520 │ is it that drivers│ │ │ │ │ │
521 │ who have had too │ │ │ │ │ │
522 │ much to drink to │ │ │ │ │ │
523 │ drive safely will │ │ │ │ │ │
524 │ D. Be arrested for│ │ │ │ │ │
525 │ drunk driving? │ │ │ │ │ │
526 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
530 AT_SETUP([CTABLES nesting and scale variables])
531 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
532 AT_DATA([ctables.sps],
534 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
535 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
536 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
537 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
538 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
540 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
542 ╭─────────────────────────────────────────────────────────────────┬────────────╮
548 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
549 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
550 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
552 │ Once a week or │ 44│ 54│
554 │ Only certain │ 34│ 41│
557 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
560 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
561 │ │Minimum│Maximum│Mean│
562 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
563 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
564 │What is GENDER: months, has there been a │ │ │ │
565 │your time when you felt you │ │ │ │
566 │age? should cut down on your No │ 16│ 86│ 46│
568 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
569 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
570 │ months, has there been a │ │ │ │
571 │ time when you felt you │ │ │ │
572 │ should cut down on your No │ 16│ 86│ 48│
574 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
575 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
576 │What is GENDER: months, has there been a │ │ │ │
577 │your time when people criticized No │ 16│ 86│ 46│
578 │age? your drinking? │ │ │ │
579 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
580 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
581 │ months, has there been a │ │ │ │
582 │ time when people criticized No │ 16│ 86│ 48│
583 │ your drinking? │ │ │ │
584 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
587 ╭─────────────────────────────┬────────────────────────────────────────────────╮
588 │ │S1. Including yourself, how many members of this│
589 │ │ household are age 16 or older? │
590 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
591 │ │ │ │ │ │ │ │ 6 or │
592 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
593 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
594 │ │Column│Column│Column│Column│Column│Column│Column│
595 │ │ % │ % │ % │ % │ % │ % │ % │
596 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
597 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
598 │SAMPLE How certain │ │ │ │ │ │ │ │
599 │SOURCE: likely │ │ │ │ │ │ │ │
600 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
601 │ that likely │ │ │ │ │ │ │ │
602 │ drivers │ │ │ │ │ │ │ │
603 │ who have │ │ │ │ │ │ │ │
604 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
605 │ much to likely │ │ │ │ │ │ │ │
606 │ drink to │ │ │ │ │ │ │ │
607 │ drive │ │ │ │ │ │ │ │
608 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
609 │ will A. unlikely│ │ │ │ │ │ │ │
610 │ Get │ │ │ │ │ │ │ │
611 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
612 │ by the unlikely│ │ │ │ │ │ │ │
613 │ police? │ │ │ │ │ │ │ │
614 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
617 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
620 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
621 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
622 │group typical month did you have one or more │ │ │
623 │ alcoholic beverages to drink? │ │ │
624 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
625 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
626 │ typical month did you have one or more │ │ │
627 │ alcoholic beverages to drink? │ │ │
628 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
629 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
630 │ typical month did you have one or more │ │ │
631 │ alcoholic beverages to drink? │ │ │
632 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
633 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
634 │ typical month did you have one or more │ │ │
635 │ alcoholic beverages to drink? │ │ │
636 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
637 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
638 │ typical month did you have one or more │ │ │
639 │ alcoholic beverages to drink? │ │ │
640 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
641 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
642 │ older typical month did you have one or more │ │ │
643 │ alcoholic beverages to drink? │ │ │
644 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
649 AT_SETUP([CTABLES SLABELS])
650 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
651 AT_DATA([ctables.sps],
653 CTABLES /TABLE qn1 [COUNT COLPCT].
654 CTABLES /TABLE qn1 [COUNT COLPCT]
655 /SLABELS POSITION=ROW.
656 CTABLES /TABLE qn1 [COUNT COLPCT]
657 /SLABELS POSITION=ROW VISIBLE=NO.
659 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
661 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
664 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
665 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
666 │other motor vehicle? Several days a week│ 1274│ 18.3%│
667 │ Once a week or less│ 361│ 5.2%│
668 │ Only certain times │ 130│ 1.9%│
671 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
674 ╭────────────────────────────────────────────────────────────────────────┬─────╮
675 │ 1. How often do you usually drive a car or Every day Count │ 4667│
676 │other motor vehicle? Column │66.9%│
678 │ ╶───────────────────────────┼─────┤
679 │ Several days a week Count │ 1274│
682 │ ╶───────────────────────────┼─────┤
683 │ Once a week or less Count │ 361│
686 │ ╶───────────────────────────┼─────┤
687 │ Only certain times Count │ 130│
688 │ a year Column │ 1.9%│
690 │ ╶───────────────────────────┼─────┤
694 ╰────────────────────────────────────────────────────────────────────────┴─────╯
697 ╭────────────────────────────────────────────────────────────────────────┬─────╮
698 │ 1. How often do you usually drive a car or other Every day │ 4667│
699 │motor vehicle? │66.9%│
700 │ Several days a week │ 1274│
702 │ Once a week or less │ 361│
704 │ Only certain times a │ 130│
708 ╰────────────────────────────────────────────────────────────────────────┴─────╯
712 AT_SETUP([CTABLES simple totals])
713 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
714 AT_DATA([ctables.sps],
717 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
718 DESCRIPTIVES qn18/STATISTICS=MEAN.
719 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
720 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
722 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
724 ╭────────────────────────────────────────────────────────────────────────┬─────╮
726 ├────────────────────────────────────────────────────────────────────────┼─────┤
727 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
728 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
731 │ Wine coolers │ 137│
732 │ Hard liquor or │ 888│
734 │ Flavored malt │ 83│
736 │ Number responding │ 4221│
737 ╰────────────────────────────────────────────────────────────────────────┴─────╯
739 Descriptive Statistics
740 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
742 ├────────────────────────────────────────────────────────────────────┼────┼────┤
743 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
744 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
745 │Valid N (listwise) │6999│ │
746 │Missing N (listwise) │2781│ │
747 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
750 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
752 │ │Mean│Count│ N │ N │
753 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
754 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
755 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
756 │ you usually drink per sitting? │ │ │ │ │
757 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
758 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
759 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
760 │ you usually drink per sitting? │ │ │ │ │
761 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
762 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
763 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
764 │ you usually drink per sitting? │ │ │ │ │
765 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
766 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
767 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
768 │ you usually drink per sitting? │ │ │ │ │
769 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
770 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
771 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
772 │ you usually drink per sitting? │ │ │ │ │
773 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
777 AT_SETUP([CTABLES subtotals])
778 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
779 AT_DATA([ctables.sps],
781 CTABLES /TABLE=qn105ba BY qns1
782 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
783 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
784 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
785 CTABLES /TABLE=qn105ba BY qns1
786 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
787 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
789 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
791 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
792 │ │ S1. Including yourself, how many members of this household │
793 │ │ are age 16 or older? │
794 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
795 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
796 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
797 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
798 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
799 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
800 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
801 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
802 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
803 │ likely │ │ │ │ │ │ │ │
804 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
805 │ unlikely │ │ │ │ │ │ │ │
806 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
807 │ unlikely │ │ │ │ │ │ │ │
808 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
811 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
812 │ │ S1. Including yourself, how many members of this household │
813 │ │ are age 16 or older? │
814 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
815 │ │ │ │ │ │ │ │ 6 or │
816 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
817 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
818 │ │ │ │ │ │ Column│ │ │
819 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
820 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
821 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
822 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
823 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
824 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
825 │ likely │ │ │ │ │ │ │ │
826 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
827 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
828 │ unlikely │ │ │ │ │ │ │ │
829 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
830 │ unlikely │ │ │ │ │ │ │ │
831 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
832 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
835 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
836 │ │ S1. Including yourself, how many members of this household │
837 │ │ are age 16 or older? │
838 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
839 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
840 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
841 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
842 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
843 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
844 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
845 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
846 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
847 │ likely │ │ │ │ │ │ │ │
848 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
849 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
850 │ unlikely │ │ │ │ │ │ │ │
851 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
852 │ unlikely │ │ │ │ │ │ │ │
853 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
854 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
858 AT_SETUP([CTABLES PCOMPUTE])
859 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
860 AT_DATA([ctables.sps],
863 /PCOMPUTE &x=EXPR([3] + [4])
864 /PCOMPUTE &y=EXPR([4] + [5])
865 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
866 /PPROPERTIES &y LABEL='4+5'
867 /TABLE=qn105ba BY qns1
868 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
870 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
872 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
873 │ │ S1. Including yourself, how many members of this household │
874 │ │ are age 16 or older? │
875 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
876 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
877 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
878 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
879 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
880 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
881 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
882 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
883 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
884 │ likely │ │ │ │ │ │ │ │
885 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
886 │ unlikely │ │ │ │ │ │ │ │
887 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
888 │ unlikely │ │ │ │ │ │ │ │
889 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
893 AT_SETUP([CTABLES CLABELS])
894 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
895 AT_DATA([ctables.sps],
897 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
898 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
900 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
902 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
904 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
906 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
907 │ │ 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 │
908 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
909 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
910 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
911 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
912 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
913 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
914 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
917 ╭──────────────────────────────┬────────────╮
921 ├──────────────────────────────┼────────────┤
922 │Age group 15 or younger Male │ 0│
924 │ ╶────────────────────┼────────────┤
925 │ 16 to 25 Male │ 594│
927 │ ╶────────────────────┼────────────┤
928 │ 26 to 35 Male │ 476│
930 │ ╶────────────────────┼────────────┤
931 │ 36 to 45 Male │ 489│
933 │ ╶────────────────────┼────────────┤
934 │ 46 to 55 Male │ 526│
936 │ ╶────────────────────┼────────────┤
937 │ 56 to 65 Male │ 516│
939 │ ╶────────────────────┼────────────┤
940 │ 66 or older Male │ 531│
942 ╰──────────────────────────────┴────────────╯
946 AT_SETUP([CTABLES missing values])
947 AT_DATA([ctables.sps],
948 [[DATA LIST LIST NOTABLE/x y.
987 MISSING VALUES x (1, 2) y (2, 3).
988 VARIABLE LEVEL ALL (NOMINAL).
990 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
991 /CATEGORIES VARIABLES=ALL TOTAL=YES.
992 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
993 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
994 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
995 /CATEGORIES VARIABLES=ALL TOTAL=YES
996 /SLABELS POSITION=ROW.
997 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
998 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
999 /SLABELS POSITION=ROW.
1000 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
1001 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1002 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1003 /SLABELS POSITION=ROW.
1005 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1007 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1008 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1009 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1010 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1011 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1012 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1013 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1014 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1015 dnl Note that Column Total N % doesn't add up to 100 because missing
1016 dnl values are included in the total but not shown as a category and this
1017 dnl is expected behavior.
1020 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1021 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1022 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1023 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1024 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1025 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1026 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1027 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1028 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1029 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1030 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1031 dnl values are included in the total but not shown as a category and this
1032 dnl is expected behavior.
1035 ╭────────────────────────┬───────────────────────────╮
1037 │ ├──────┬──────┬──────┬──────┤
1038 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1039 ├────────────────────────┼──────┼──────┼──────┼──────┤
1040 │x 3.00 Count │ 1│ 1│ 1│ 3│
1041 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1042 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1043 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1044 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1045 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1046 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1047 │ Valid N │ │ │ │ 3│
1048 │ Total N │ │ │ │ 6│
1049 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1050 │ 4.00 Count │ 1│ 1│ 1│ 3│
1051 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1052 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1053 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1054 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1055 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1056 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1057 │ Valid N │ │ │ │ 3│
1058 │ Total N │ │ │ │ 6│
1059 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1060 │ 5.00 Count │ 1│ 1│ 1│ 3│
1061 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1062 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1063 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1064 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1065 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1066 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1067 │ Valid N │ │ │ │ 3│
1068 │ Total N │ │ │ │ 6│
1069 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1070 │ Total Count │ 3│ 3│ 3│ 9│
1071 │ Column % │100.0%│100.0%│100.0%│ .│
1072 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1073 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1074 │ Row % │ .│ .│ .│ .│
1075 │ Row Valid N % │ .│ .│ .│ .│
1076 │ Row Total N % │ .│ .│ .│ .│
1077 │ Valid N │ 3│ 3│ 3│ 9│
1078 │ Total N │ 6│ 6│ 6│ 36│
1079 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1082 ╭────────────────────────┬─────────────────────────────────────────╮
1084 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1085 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1086 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1087 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1088 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1089 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1090 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1091 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1092 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1093 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1094 │ Valid N │ │ │ │ │ │ 0│
1095 │ Total N │ │ │ │ │ │ 6│
1096 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1097 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1098 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1099 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1100 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1101 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1102 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1103 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1104 │ Valid N │ │ │ │ │ │ 0│
1105 │ Total N │ │ │ │ │ │ 6│
1106 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1107 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1108 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1109 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1110 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1111 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1112 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1113 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1114 │ Valid N │ │ │ │ │ │ 3│
1115 │ Total N │ │ │ │ │ │ 6│
1116 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1117 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1118 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1119 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1120 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1121 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1122 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1123 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1124 │ Valid N │ │ │ │ │ │ 3│
1125 │ Total N │ │ │ │ │ │ 6│
1126 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1127 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1128 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1129 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1130 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1131 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1132 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1133 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1134 │ Valid N │ │ │ │ │ │ 3│
1135 │ Total N │ │ │ │ │ │ 6│
1136 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1137 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1138 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1139 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1140 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1141 │ Row % │ .│ .│ .│ .│ .│ .│
1142 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1143 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1144 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1145 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1146 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1149 ╭────────────────────────┬──────────────────────────────────╮
1151 │ ├──────┬──────┬──────┬──────┬──────┤
1152 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1153 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1154 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1155 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1156 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1157 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1158 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1159 │ Row Valid N % │ .│ .│ .│ .│ .│
1160 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1161 │ Valid N │ │ │ │ │ 0│
1162 │ Total N │ │ │ │ │ 6│
1163 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1164 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1165 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1166 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1167 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1168 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1169 │ Row Valid N % │ .│ .│ .│ .│ .│
1170 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1171 │ Valid N │ │ │ │ │ 0│
1172 │ Total N │ │ │ │ │ 6│
1173 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1174 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1175 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1176 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1177 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1178 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1179 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1180 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1181 │ Valid N │ │ │ │ │ 3│
1182 │ Total N │ │ │ │ │ 6│
1183 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1184 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1185 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1186 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1187 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1188 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1189 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1190 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1191 │ Valid N │ │ │ │ │ 3│
1192 │ Total N │ │ │ │ │ 6│
1193 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1194 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1195 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1196 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1197 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1198 │ Row % │ .│ .│ .│ .│ .│
1199 │ Row Valid N % │ .│ .│ .│ .│ .│
1200 │ Row Total N % │ .│ .│ .│ .│ .│
1201 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1202 │ Total N │ 5│ 5│ 5│ 5│ 30│
1203 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1207 AT_SETUP([CTABLES SMISSING=LISTWISE])
1208 AT_KEYWORDS([SMISSING LISTWISE])
1209 AT_DATA([ctables.sps],
1210 [[DATA LIST LIST NOTABLE/x y z.
1218 VARIABLE LEVEL x (NOMINAL).
1220 CTABLES /TABLE (y + z) > x.
1221 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1223 * The following doesn't come out as listwise because the tables are
1224 separate, not linked by an > operator.
1225 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1227 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl