3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Parsing (positive and negative)
6 dnl - String variables and values
7 dnl - Testing details of missing value handling in summaries.
8 dnl - test CLABELS ROWLABELS=LAYER.
10 dnl - Test WEIGHT and adjustment weights.
11 dnl - EMPTY=INCLUDE For string ranges.
12 dnl - Summary functions:
13 dnl * Separate summary functions for totals and subtotals.
14 dnl * )CILEVEL in summary label specification
18 dnl * ascending/descending
22 dnl * THRU (numeric ranges)
23 dnl * THRU (string ranges)
26 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
29 dnl - HIDESMALLCOUNTS.
30 dnl - Date/time variables and values
31 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
32 dnl - TITLES: )DATE, )TIME, )TABLE.
34 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
35 dnl * MISSING, OTHERNM
36 dnl * strings and string ranges
37 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
41 dnl - Summary functions:
42 dnl * U-prefix for unweighted summaries.
43 dnl * areaPCT.SUM and UareaPCT.SUM functions.
44 dnl - SPLIT FILE with SEPARATE splits
45 dnl - Definition of columns/rows when labels are rotated from one axis to another.
48 dnl - Multiple response sets
49 dnl - MRSETS subcommand.
50 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
53 dnl - Summary functions:
54 dnl * .LCL and .UCL suffixes.
57 dnl * Data-dependent sorting.
61 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
62 dnl produces a bad median:
64 dnl +--------------------------+-----------------------+
65 dnl | | S3a. GENDER: |
66 dnl | +-----------+-----------+
67 dnl | | Male | Female |
68 dnl | +----+------+----+------+
69 dnl | |Mean|Median|Mean|Median|
70 dnl +--------------------------+----+------+----+------+
71 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
72 dnl +--------------------------+----+------+----+------+
76 AT_SETUP([CTABLES parsing])
77 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
78 AT_DATA([ctables.sps],
81 /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
82 /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
83 /FORMAT UNITS=CM EMPTY="(-)"
84 /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
85 /VLABELS VARIABLES=qn17 DISPLAY=NAME
86 /VLABELS VARIABLES=qns3a DISPLAY=LABEL
87 /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
88 /VLABELS VARIABLES=qn20 DISPLAY=NONE
89 /MRSETS COUNTDUPLICATES=NO
90 /MRSETS COUNTDUPLICATES=YES
93 /WEIGHT VARIABLE=qns3a
95 /HIDESMALLCOUNTS COUNT=10
97 /SLABELS POSITION=COLUMN VISIBLE=YES
98 /SLABELS VISIBLE=NO POSITION=ROW
99 /SLABELS POSITION=LAYER
101 /CLABELS ROWLABELS=OPPOSITE
102 /CLABELS ROWLABELS=LAYER
103 /CLABELS COLLABELS=OPPOSITE
104 /CLABELS COLLABELS=LAYER
106 /CATEGORIES VARIABLES=qn1 qn17
107 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
108 POSITION=BEFORE EMPTY=INCLUDE.
110 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
113 ╭───────────────────────────────┬──╮
114 │qnd1 D1. AGE: What is your age?│49│
115 ╰───────────────────────────────┴──╯
119 AT_SETUP([CTABLES one categorical variable])
120 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
121 AT_DATA([ctables.sps],
124 CTABLES /TABLE BY qn1.
125 CTABLES /TABLE BY BY qn1.
127 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
129 ╭────────────────────────────────────────────────────────────────────────┬─────╮
131 ├────────────────────────────────────────────────────────────────────────┼─────┤
132 │ 1. How often do you usually drive a car or other Every day │ 4667│
133 │motor vehicle? Several days a week │ 1274│
134 │ Once a week or less │ 361│
135 │ Only certain times a │ 130│
138 ╰────────────────────────────────────────────────────────────────────────┴─────╯
141 ╭──────────────────────────────────────────────────────────────────────────────╮
142 │ 1. How often do you usually drive a car or other motor vehicle? │
143 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
144 │ │ Several days a │ Once a week or │ Only certain times a │ │
145 │Every day│ week │ less │ year │Never│
146 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
147 │ Count │ Count │ Count │ Count │Count│
148 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
149 │ 4667│ 1274│ 361│ 130│ 540│
150 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
162 AT_SETUP([CTABLES one scale variable])
163 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
164 AT_DATA([ctables.sps],
166 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
167 CTABLES /TABLE BY qnd1.
168 CTABLES /TABLE BY BY qnd1.
170 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
172 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
173 │ │ │ │ │ │ Std │ │ │
174 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
175 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
176 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
177 │age? │ │ │ │ │ │ │ │
178 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
181 ╭──────────────────────────╮
182 │D1. AGE: What is your age?│
183 ├──────────────────────────┤
185 ├──────────────────────────┤
187 ╰──────────────────────────╯
190 D1. AGE: What is your age?
199 AT_SETUP([CTABLES simple stacking])
200 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
201 AT_DATA([ctables.sps],
203 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
205 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
207 ╭───────────────────────────────────────────────────────────────┬──────────────╮
214 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
215 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
216 │too much to drink to drive safely will A. Get certain │ │ │
217 │stopped by the police? Very likely │ 21%│ 22%│
218 │ Somewhat │ 38%│ 42%│
220 │ Somewhat │ 21%│ 18%│
224 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
225 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
226 │too much to drink to drive safely will B. Have an certain │ │ │
227 │accident? Very likely │ 36%│ 45%│
228 │ Somewhat │ 39%│ 32%│
234 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
235 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
236 │too much to drink to drive safely will C. Be certain │ │ │
237 │convicted for drunk driving? Very likely │ 32%│ 28%│
238 │ Somewhat │ 27%│ 32%│
240 │ Somewhat │ 15%│ 15%│
244 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
245 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
246 │too much to drink to drive safely will D. Be certain │ │ │
247 │arrested for drunk driving? Very likely │ 26%│ 27%│
248 │ Somewhat │ 32%│ 35%│
250 │ Somewhat │ 17%│ 15%│
254 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
258 AT_SETUP([CTABLES show or hide empty categories])
259 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
260 AT_DATA([ctables.sps],
262 IF (qn105ba = 2) qn105ba = 1.
263 IF (qns3a = 1) qns3a = 2.
264 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
265 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
266 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
267 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
268 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
269 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
270 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
272 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
274 ╭──────────────────────────────────────────────────────────────┬───────────────╮
281 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
282 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
283 │too much to drink to drive safely will A. Get certain │ │ │
284 │stopped by the police? Very likely│ .│ 0%│
291 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
294 ╭──────────────────────────────────────────────────────────────┬───────────────╮
301 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
302 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
303 │too much to drink to drive safely will A. Get certain │ │ │
304 │stopped by the police? Somewhat │ .│ 40%│
310 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
313 ╭────────────────────────────────────────────────────────────────────┬─────────╮
320 ├────────────────────────────────────────────────────────────────────┼─────────┤
321 │105b. How likely is it that drivers who have had too Almost │ 32%│
322 │much to drink to drive safely will A. Get stopped by certain │ │
323 │the police? Very likely │ 0%│
330 ╰────────────────────────────────────────────────────────────────────┴─────────╯
333 ╭────────────────────────────────────────────────────────────────────┬─────────╮
340 ├────────────────────────────────────────────────────────────────────┼─────────┤
341 │105b. How likely is it that drivers who have had too Almost │ 32%│
342 │much to drink to drive safely will A. Get stopped by certain │ │
343 │the police? Somewhat │ 40%│
349 ╰────────────────────────────────────────────────────────────────────┴─────────╯
353 AT_SETUP([CTABLES simple nesting])
354 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
355 AT_DATA([ctables.sps],
357 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
358 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
359 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
360 /CATEGORIES VARIABLES=qns3a TOTAL=YES
361 /CLABELS ROW=OPPOSITE.
363 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
365 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
368 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
369 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
370 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
371 │drive safely will A. Get stopped by Total │ 700│ 10%│
372 │the police? ╶──────────────────────────┼─────┼──────┤
373 │ Very S3a. Male │ 660│ 10%│
374 │ likely GENDER: Female│ 842│ 12%│
376 │ ╶──────────────────────────┼─────┼──────┤
377 │ Somewhat S3a. Male │ 1174│ 17%│
378 │ likely GENDER: Female│ 1589│ 23%│
380 │ ╶──────────────────────────┼─────┼──────┤
381 │ Somewhat S3a. Male │ 640│ 9%│
382 │ unlikely GENDER: Female│ 667│ 10%│
384 │ ╶──────────────────────────┼─────┼──────┤
385 │ Very S3a. Male │ 311│ 5%│
386 │ unlikely GENDER: Female│ 298│ 4%│
388 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
389 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
390 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
391 │drive safely will B. Have an accident? Total │ 1100│ 16%│
392 │ ╶──────────────────────────┼─────┼──────┤
393 │ Very S3a. Male │ 1104│ 16%│
394 │ likely GENDER: Female│ 1715│ 25%│
396 │ ╶──────────────────────────┼─────┼──────┤
397 │ Somewhat S3a. Male │ 1203│ 17%│
398 │ likely GENDER: Female│ 1214│ 18%│
400 │ ╶──────────────────────────┼─────┼──────┤
401 │ Somewhat S3a. Male │ 262│ 4%│
402 │ unlikely GENDER: Female│ 168│ 2%│
404 │ ╶──────────────────────────┼─────┼──────┤
405 │ Very S3a. Male │ 81│ 1%│
406 │ unlikely GENDER: Female│ 59│ 1%│
408 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
409 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
410 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
411 │drive safely will C. Be convicted for Total │ 1149│ 17%│
412 │drunk driving? ╶──────────────────────────┼─────┼──────┤
413 │ Very S3a. Male │ 988│ 14%│
414 │ likely GENDER: Female│ 1049│ 15%│
416 │ ╶──────────────────────────┼─────┼──────┤
417 │ Somewhat S3a. Male │ 822│ 12%│
418 │ likely GENDER: Female│ 1210│ 18%│
420 │ ╶──────────────────────────┼─────┼──────┤
421 │ Somewhat S3a. Male │ 446│ 7%│
422 │ unlikely GENDER: Female│ 548│ 8%│
424 │ ╶──────────────────────────┼─────┼──────┤
425 │ Very S3a. Male │ 268│ 4%│
426 │ unlikely GENDER: Female│ 354│ 5%│
428 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
429 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
430 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
431 │drive safely will D. Be arrested for Total │ 1101│ 16%│
432 │drunk driving? ╶──────────────────────────┼─────┼──────┤
433 │ Very S3a. Male │ 805│ 12%│
434 │ likely GENDER: Female│ 1029│ 15%│
436 │ ╶──────────────────────────┼─────┼──────┤
437 │ Somewhat S3a. Male │ 975│ 14%│
438 │ likely GENDER: Female│ 1332│ 19%│
440 │ ╶──────────────────────────┼─────┼──────┤
441 │ Somewhat S3a. Male │ 535│ 8%│
442 │ unlikely GENDER: Female│ 560│ 8%│
444 │ ╶──────────────────────────┼─────┼──────┤
445 │ Very S3a. Male │ 270│ 4%│
446 │ unlikely GENDER: Female│ 279│ 4%│
448 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
451 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
452 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
453 │ │ certain│likely│ likely │ unlikely│unlikely│
454 │ ├────────┼──────┼─────────┼─────────┼────────┤
456 │ │ Table %│ % │ Table % │ Table % │ Table %│
457 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
458 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
459 │GENDER: is it that drivers│ │ │ │ │ │
460 │ who have had too │ │ │ │ │ │
461 │ much to drink to │ │ │ │ │ │
462 │ drive safely will │ │ │ │ │ │
463 │ A. Get stopped by │ │ │ │ │ │
464 │ the police? │ │ │ │ │ │
465 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
466 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
467 │ is it that drivers│ │ │ │ │ │
468 │ who have had too │ │ │ │ │ │
469 │ much to drink to │ │ │ │ │ │
470 │ drive safely will │ │ │ │ │ │
471 │ A. Get stopped by │ │ │ │ │ │
472 │ the police? │ │ │ │ │ │
473 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
474 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
475 │ is it that drivers│ │ │ │ │ │
476 │ who have had too │ │ │ │ │ │
477 │ much to drink to │ │ │ │ │ │
478 │ drive safely will │ │ │ │ │ │
479 │ A. Get stopped by │ │ │ │ │ │
480 │ the police? │ │ │ │ │ │
481 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
482 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
483 │GENDER: is it that drivers│ │ │ │ │ │
484 │ who have had too │ │ │ │ │ │
485 │ much to drink to │ │ │ │ │ │
486 │ drive safely will │ │ │ │ │ │
487 │ B. Have an │ │ │ │ │ │
488 │ accident? │ │ │ │ │ │
489 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
490 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
491 │ is it that drivers│ │ │ │ │ │
492 │ who have had too │ │ │ │ │ │
493 │ much to drink to │ │ │ │ │ │
494 │ drive safely will │ │ │ │ │ │
495 │ B. Have an │ │ │ │ │ │
496 │ accident? │ │ │ │ │ │
497 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
498 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
499 │ is it that drivers│ │ │ │ │ │
500 │ who have had too │ │ │ │ │ │
501 │ much to drink to │ │ │ │ │ │
502 │ drive safely will │ │ │ │ │ │
503 │ B. Have an │ │ │ │ │ │
504 │ accident? │ │ │ │ │ │
505 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
506 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
507 │GENDER: is it that drivers│ │ │ │ │ │
508 │ who have had too │ │ │ │ │ │
509 │ much to drink to │ │ │ │ │ │
510 │ drive safely will │ │ │ │ │ │
511 │ C. Be convicted │ │ │ │ │ │
512 │ for drunk driving?│ │ │ │ │ │
513 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
514 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
515 │ is it that drivers│ │ │ │ │ │
516 │ who have had too │ │ │ │ │ │
517 │ much to drink to │ │ │ │ │ │
518 │ drive safely will │ │ │ │ │ │
519 │ C. Be convicted │ │ │ │ │ │
520 │ for drunk driving?│ │ │ │ │ │
521 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
522 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
523 │ is it that drivers│ │ │ │ │ │
524 │ who have had too │ │ │ │ │ │
525 │ much to drink to │ │ │ │ │ │
526 │ drive safely will │ │ │ │ │ │
527 │ C. Be convicted │ │ │ │ │ │
528 │ for drunk driving?│ │ │ │ │ │
529 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
530 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
531 │GENDER: is it that drivers│ │ │ │ │ │
532 │ who have had too │ │ │ │ │ │
533 │ much to drink to │ │ │ │ │ │
534 │ drive safely will │ │ │ │ │ │
535 │ D. Be arrested for│ │ │ │ │ │
536 │ drunk driving? │ │ │ │ │ │
537 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
538 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
539 │ is it that drivers│ │ │ │ │ │
540 │ who have had too │ │ │ │ │ │
541 │ much to drink to │ │ │ │ │ │
542 │ drive safely will │ │ │ │ │ │
543 │ D. Be arrested for│ │ │ │ │ │
544 │ drunk driving? │ │ │ │ │ │
545 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
546 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
547 │ is it that drivers│ │ │ │ │ │
548 │ who have had too │ │ │ │ │ │
549 │ much to drink to │ │ │ │ │ │
550 │ drive safely will │ │ │ │ │ │
551 │ D. Be arrested for│ │ │ │ │ │
552 │ drunk driving? │ │ │ │ │ │
553 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
557 AT_SETUP([CTABLES nesting and scale variables])
558 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
559 AT_DATA([ctables.sps],
561 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
562 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
563 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
564 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
565 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
567 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
569 ╭─────────────────────────────────────────────────────────────────┬────────────╮
575 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
576 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
577 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
579 │ Once a week or │ 44│ 54│
581 │ Only certain │ 34│ 41│
584 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
587 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
588 │ │Minimum│Maximum│Mean│
589 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
590 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
591 │What is GENDER: months, has there been a │ │ │ │
592 │your time when you felt you │ │ │ │
593 │age? should cut down on your No │ 16│ 86│ 46│
595 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
596 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
597 │ months, has there been a │ │ │ │
598 │ time when you felt you │ │ │ │
599 │ should cut down on your No │ 16│ 86│ 48│
601 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
602 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
603 │What is GENDER: months, has there been a │ │ │ │
604 │your time when people criticized No │ 16│ 86│ 46│
605 │age? your drinking? │ │ │ │
606 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
607 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
608 │ months, has there been a │ │ │ │
609 │ time when people criticized No │ 16│ 86│ 48│
610 │ your drinking? │ │ │ │
611 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
614 ╭─────────────────────────────┬────────────────────────────────────────────────╮
615 │ │S1. Including yourself, how many members of this│
616 │ │ household are age 16 or older? │
617 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
618 │ │ │ │ │ │ │ │ 6 or │
619 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
620 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
621 │ │Column│Column│Column│Column│Column│Column│Column│
622 │ │ % │ % │ % │ % │ % │ % │ % │
623 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
624 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
625 │SAMPLE How certain │ │ │ │ │ │ │ │
626 │SOURCE: likely │ │ │ │ │ │ │ │
627 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
628 │ that likely │ │ │ │ │ │ │ │
629 │ drivers │ │ │ │ │ │ │ │
630 │ who have │ │ │ │ │ │ │ │
631 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
632 │ much to likely │ │ │ │ │ │ │ │
633 │ drink to │ │ │ │ │ │ │ │
634 │ drive │ │ │ │ │ │ │ │
635 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
636 │ will A. unlikely│ │ │ │ │ │ │ │
637 │ Get │ │ │ │ │ │ │ │
638 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
639 │ by the unlikely│ │ │ │ │ │ │ │
640 │ police? │ │ │ │ │ │ │ │
641 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
644 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
647 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
648 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
649 │group typical month did you have one or more │ │ │
650 │ alcoholic beverages to drink? │ │ │
651 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
652 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
653 │ typical month did you have one or more │ │ │
654 │ alcoholic beverages to drink? │ │ │
655 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
656 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
657 │ typical month did you have one or more │ │ │
658 │ alcoholic beverages to drink? │ │ │
659 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
660 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
661 │ typical month did you have one or more │ │ │
662 │ alcoholic beverages to drink? │ │ │
663 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
664 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
665 │ typical month did you have one or more │ │ │
666 │ alcoholic beverages to drink? │ │ │
667 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
668 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
669 │ older typical month did you have one or more │ │ │
670 │ alcoholic beverages to drink? │ │ │
671 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
676 AT_SETUP([CTABLES SLABELS])
677 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
678 AT_DATA([ctables.sps],
680 CTABLES /TABLE qn1 [COUNT COLPCT].
681 CTABLES /TABLE qn1 [COUNT COLPCT]
682 /SLABELS POSITION=ROW.
683 CTABLES /TABLE qn1 [COUNT COLPCT]
684 /SLABELS POSITION=ROW VISIBLE=NO.
686 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
688 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
691 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
692 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
693 │other motor vehicle? Several days a week│ 1274│ 18.3%│
694 │ Once a week or less│ 361│ 5.2%│
695 │ Only certain times │ 130│ 1.9%│
698 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
701 ╭────────────────────────────────────────────────────────────────────────┬─────╮
702 │ 1. How often do you usually drive a car or Every day Count │ 4667│
703 │other motor vehicle? Column │66.9%│
705 │ ╶───────────────────────────┼─────┤
706 │ Several days a week Count │ 1274│
709 │ ╶───────────────────────────┼─────┤
710 │ Once a week or less Count │ 361│
713 │ ╶───────────────────────────┼─────┤
714 │ Only certain times Count │ 130│
715 │ a year Column │ 1.9%│
717 │ ╶───────────────────────────┼─────┤
721 ╰────────────────────────────────────────────────────────────────────────┴─────╯
724 ╭────────────────────────────────────────────────────────────────────────┬─────╮
725 │ 1. How often do you usually drive a car or other Every day │ 4667│
726 │motor vehicle? │66.9%│
727 │ Several days a week │ 1274│
729 │ Once a week or less │ 361│
731 │ Only certain times a │ 130│
735 ╰────────────────────────────────────────────────────────────────────────┴─────╯
739 AT_SETUP([CTABLES simple totals])
740 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
741 AT_DATA([ctables.sps],
744 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
745 DESCRIPTIVES qn18/STATISTICS=MEAN.
746 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
747 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
749 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
751 ╭────────────────────────────────────────────────────────────────────────┬─────╮
753 ├────────────────────────────────────────────────────────────────────────┼─────┤
754 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
755 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
758 │ Wine coolers │ 137│
759 │ Hard liquor or │ 888│
761 │ Flavored malt │ 83│
763 │ Number responding │ 4221│
764 ╰────────────────────────────────────────────────────────────────────────┴─────╯
766 Descriptive Statistics
767 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
769 ├────────────────────────────────────────────────────────────────────┼────┼────┤
770 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
771 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
772 │Valid N (listwise) │6999│ │
773 │Missing N (listwise) │2781│ │
774 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
777 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
779 │ │Mean│Count│ N │ N │
780 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
781 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
782 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
783 │ you usually drink per sitting? │ │ │ │ │
784 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
785 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
786 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
787 │ you usually drink per sitting? │ │ │ │ │
788 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
789 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
790 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
791 │ you usually drink per sitting? │ │ │ │ │
792 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
793 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
794 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
795 │ you usually drink per sitting? │ │ │ │ │
796 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
797 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
798 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
799 │ you usually drink per sitting? │ │ │ │ │
800 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
804 AT_SETUP([CTABLES subtotals])
805 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
806 AT_DATA([ctables.sps],
808 CTABLES /TABLE=qn105ba BY qns1
809 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
810 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
811 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
812 CTABLES /TABLE=qn105ba BY qns1
813 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
814 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
816 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
818 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
819 │ │ S1. Including yourself, how many members of this household │
820 │ │ are age 16 or older? │
821 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
822 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
823 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
824 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
825 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
826 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
827 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
828 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
829 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
830 │ likely │ │ │ │ │ │ │ │
831 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
832 │ unlikely │ │ │ │ │ │ │ │
833 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
834 │ unlikely │ │ │ │ │ │ │ │
835 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
838 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
839 │ │ S1. Including yourself, how many members of this household │
840 │ │ are age 16 or older? │
841 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
842 │ │ │ │ │ │ │ │ 6 or │
843 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
844 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
845 │ │ │ │ │ │ Column│ │ │
846 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
847 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
848 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
849 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
850 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
851 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
852 │ likely │ │ │ │ │ │ │ │
853 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
854 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
855 │ unlikely │ │ │ │ │ │ │ │
856 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
857 │ unlikely │ │ │ │ │ │ │ │
858 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
859 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
862 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
863 │ │ S1. Including yourself, how many members of this household │
864 │ │ are age 16 or older? │
865 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
866 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
867 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
868 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
869 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
870 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
871 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
872 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
873 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
874 │ likely │ │ │ │ │ │ │ │
875 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
876 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
877 │ unlikely │ │ │ │ │ │ │ │
878 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
879 │ unlikely │ │ │ │ │ │ │ │
880 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
881 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
885 AT_SETUP([CTABLES PCOMPUTE])
886 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
887 AT_DATA([ctables.sps],
890 /PCOMPUTE &x=EXPR([3] + [4])
891 /PCOMPUTE &y=EXPR([4] + [5])
892 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
893 /PPROPERTIES &y LABEL='4+5'
894 /TABLE=qn105ba BY qns1
895 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
897 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
899 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
900 │ │ S1. Including yourself, how many members of this household │
901 │ │ are age 16 or older? │
902 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
903 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
904 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
905 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
906 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
907 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
908 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
909 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
910 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
911 │ likely │ │ │ │ │ │ │ │
912 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
913 │ unlikely │ │ │ │ │ │ │ │
914 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
915 │ unlikely │ │ │ │ │ │ │ │
916 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
920 AT_SETUP([CTABLES CLABELS])
921 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
922 AT_DATA([ctables.sps],
924 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
925 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
927 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
929 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
931 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
933 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
934 │ │ 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 │
935 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
936 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
937 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
938 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
939 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
940 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
941 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
944 ╭──────────────────────────────┬────────────╮
948 ├──────────────────────────────┼────────────┤
949 │Age group 15 or younger Male │ 0│
951 │ ╶────────────────────┼────────────┤
952 │ 16 to 25 Male │ 594│
954 │ ╶────────────────────┼────────────┤
955 │ 26 to 35 Male │ 476│
957 │ ╶────────────────────┼────────────┤
958 │ 36 to 45 Male │ 489│
960 │ ╶────────────────────┼────────────┤
961 │ 46 to 55 Male │ 526│
963 │ ╶────────────────────┼────────────┤
964 │ 56 to 65 Male │ 516│
966 │ ╶────────────────────┼────────────┤
967 │ 66 or older Male │ 531│
969 ╰──────────────────────────────┴────────────╯
973 AT_SETUP([CTABLES missing values])
974 AT_DATA([ctables.sps],
975 [[DATA LIST LIST NOTABLE/x y.
1014 MISSING VALUES x (1, 2) y (2, 3).
1015 VARIABLE LEVEL ALL (NOMINAL).
1017 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1018 /CATEGORIES VARIABLES=ALL TOTAL=YES.
1019 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
1020 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
1021 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]]
1022 /CATEGORIES VARIABLES=ALL TOTAL=YES
1023 /SLABELS POSITION=ROW.
1024 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]]
1025 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
1026 /SLABELS POSITION=ROW.
1027 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]]
1028 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
1029 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1030 /SLABELS POSITION=ROW.
1032 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1034 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1035 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1036 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1037 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1038 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1039 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1040 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1041 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1042 dnl Note that Column Total N % doesn't add up to 100 because missing
1043 dnl values are included in the total but not shown as a category and this
1044 dnl is expected behavior.
1047 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1048 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1049 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1050 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1051 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1052 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1053 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1054 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1055 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1056 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1057 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1058 dnl values are included in the total but not shown as a category and this
1059 dnl is expected behavior.
1062 ╭────────────────────────┬───────────────────────────╮
1064 │ ├──────┬──────┬──────┬──────┤
1065 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1066 ├────────────────────────┼──────┼──────┼──────┼──────┤
1067 │x 3.00 Count │ 1│ 1│ 1│ 3│
1068 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1069 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1070 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1071 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1072 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1073 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1074 │ Valid N │ │ │ │ 3│
1075 │ Total N │ │ │ │ 6│
1076 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1077 │ 4.00 Count │ 1│ 1│ 1│ 3│
1078 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1079 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1080 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1081 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1082 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1083 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1084 │ Valid N │ │ │ │ 3│
1085 │ Total N │ │ │ │ 6│
1086 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1087 │ 5.00 Count │ 1│ 1│ 1│ 3│
1088 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1089 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1090 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1091 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1092 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1093 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1094 │ Valid N │ │ │ │ 3│
1095 │ Total N │ │ │ │ 6│
1096 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1097 │ Total Count │ 3│ 3│ 3│ 9│
1098 │ Column % │100.0%│100.0%│100.0%│ .│
1099 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1100 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1101 │ Row % │ .│ .│ .│ .│
1102 │ Row Valid N % │ .│ .│ .│ .│
1103 │ Row Total N % │ .│ .│ .│ .│
1104 │ Valid N │ 3│ 3│ 3│ 9│
1105 │ Total N │ 6│ 6│ 6│ 36│
1106 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1109 ╭────────────────────────┬─────────────────────────────────────────╮
1111 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1112 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1113 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1114 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1115 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1116 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1117 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1118 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1119 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1120 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1121 │ Valid N │ │ │ │ │ │ 0│
1122 │ Total N │ │ │ │ │ │ 6│
1123 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1124 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1125 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1126 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1127 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1128 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1129 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1130 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1131 │ Valid N │ │ │ │ │ │ 0│
1132 │ Total N │ │ │ │ │ │ 6│
1133 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1134 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1135 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1136 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1137 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1138 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1139 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1140 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1141 │ Valid N │ │ │ │ │ │ 3│
1142 │ Total N │ │ │ │ │ │ 6│
1143 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1144 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1145 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1146 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1147 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1148 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1149 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1150 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1151 │ Valid N │ │ │ │ │ │ 3│
1152 │ Total N │ │ │ │ │ │ 6│
1153 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1154 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1155 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1156 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1157 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1158 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1159 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1160 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1161 │ Valid N │ │ │ │ │ │ 3│
1162 │ Total N │ │ │ │ │ │ 6│
1163 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1164 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1165 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1166 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1167 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1168 │ Row % │ .│ .│ .│ .│ .│ .│
1169 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1170 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1171 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1172 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1173 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1176 ╭────────────────────────┬──────────────────────────────────╮
1178 │ ├──────┬──────┬──────┬──────┬──────┤
1179 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1180 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1181 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1182 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1183 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1184 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1185 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1186 │ Row Valid N % │ .│ .│ .│ .│ .│
1187 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1188 │ Valid N │ │ │ │ │ 0│
1189 │ Total N │ │ │ │ │ 6│
1190 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1191 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1192 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1193 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1194 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1195 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1196 │ Row Valid N % │ .│ .│ .│ .│ .│
1197 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1198 │ Valid N │ │ │ │ │ 0│
1199 │ Total N │ │ │ │ │ 6│
1200 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1201 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1202 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1203 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1204 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1205 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1206 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1207 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1208 │ Valid N │ │ │ │ │ 3│
1209 │ Total N │ │ │ │ │ 6│
1210 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1211 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1212 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1213 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1214 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1215 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1216 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1217 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1218 │ Valid N │ │ │ │ │ 3│
1219 │ Total N │ │ │ │ │ 6│
1220 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1221 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1222 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1223 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1224 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1225 │ Row % │ .│ .│ .│ .│ .│
1226 │ Row Valid N % │ .│ .│ .│ .│ .│
1227 │ Row Total N % │ .│ .│ .│ .│ .│
1228 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1229 │ Total N │ 5│ 5│ 5│ 5│ 30│
1230 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1234 AT_SETUP([CTABLES SMISSING=LISTWISE])
1235 AT_KEYWORDS([SMISSING LISTWISE])
1236 AT_DATA([ctables.sps],
1237 [[DATA LIST LIST NOTABLE/x y z.
1245 VARIABLE LEVEL x (NOMINAL).
1247 CTABLES /TABLE (y + z) > x.
1248 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1250 * The following doesn't come out as listwise because the tables are
1251 separate, not linked by an > operator.
1252 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1254 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl