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