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