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 - )CILEVEL in summary specifications
9 dnl - Summary functions:
10 dnl * Unimplemented ones.
11 dnl * U-prefix for unweighted summaries.
12 dnl * .LCL and .UCL suffixes.
15 dnl * Data-dependent sorting.
17 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell
18 dnl * MISSING, OTHERNM
21 dnl Features not yet tested:
22 dnl - Parsing (positive and negative)
23 dnl - String variables and values
24 dnl - Testing details of missing value handling in summaries.
25 dnl - test CLABELS ROWLABELS=LAYER.
27 dnl - Test WEIGHT and adjustment weights.
28 dnl - Test PCOMPUTE and PPROPERTIES.
29 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
30 dnl - EMPTY=INCLUDE For string ranges.
31 dnl - Summary functions:
32 dnl * Separate summary functions for totals and subtotals.
36 dnl * THRU (numeric ranges)
37 dnl * THRU (string ranges)
40 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
43 dnl - HIDESMALLCOUNTS.
44 dnl - Date/time variables and values
45 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
46 dnl - TITLES: )DATE, )TIME, )TABLE.
51 dnl - Multiple response sets
52 dnl - MRSETS subcommand.
53 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
59 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
60 dnl produces a bad median:
62 dnl +--------------------------+-----------------------+
63 dnl | | S3a. GENDER: |
64 dnl | +-----------+-----------+
65 dnl | | Male | Female |
66 dnl | +----+------+----+------+
67 dnl | |Mean|Median|Mean|Median|
68 dnl +--------------------------+----+------+----+------+
69 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
70 dnl +--------------------------+----+------+----+------+
74 # AT_SETUP([CTABLES parsing])
75 # AT_DATA([ctables.sps],
76 # [[DATA LIST LIST NOTABLE /x y z.
77 # CTABLES /TABLE=(x + y) > z.
78 # CTABLES /TABLE=(x[c] + y[c]) > z.
79 # CTABLES /TABLE=(x + y) > z[c].
80 # CTABLES /TABLE=x BY y BY z.
81 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
82 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
84 # AT_CHECK([pspp ctables.sps])
87 AT_SETUP([CTABLES one categorical variable])
88 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
89 AT_DATA([ctables.sps],
92 CTABLES /TABLE BY qn1.
93 CTABLES /TABLE BY BY qn1.
95 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
97 ╭────────────────────────────────────────────────────────────────────────┬─────╮
99 ├────────────────────────────────────────────────────────────────────────┼─────┤
100 │ 1. How often do you usually drive a car or other Every day │ 4667│
101 │motor vehicle? Several days a week │ 1274│
102 │ Once a week or less │ 361│
103 │ Only certain times a │ 130│
106 ╰────────────────────────────────────────────────────────────────────────┴─────╯
109 ╭──────────────────────────────────────────────────────────────────────────────╮
110 │ 1. How often do you usually drive a car or other motor vehicle? │
111 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
112 │ │ Several days a │ Once a week or │ Only certain times a │ │
113 │Every day│ week │ less │ year │Never│
114 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
115 │ Count │ Count │ Count │ Count │Count│
116 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
117 │ 4667│ 1274│ 361│ 130│ 540│
118 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
130 AT_SETUP([CTABLES one scale variable])
131 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
132 AT_DATA([ctables.sps],
134 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
135 CTABLES /TABLE BY qnd1.
136 CTABLES /TABLE BY BY qnd1.
138 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
140 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
141 │ │ │ │ │ │ Std │ │ │
142 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
143 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
144 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
145 │age? │ │ │ │ │ │ │ │
146 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
149 ╭──────────────────────────╮
150 │D1. AGE: What is your age?│
151 ├──────────────────────────┤
153 ├──────────────────────────┤
155 ╰──────────────────────────╯
158 D1. AGE: What is your age?
167 AT_SETUP([CTABLES simple stacking])
168 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
169 AT_DATA([ctables.sps],
171 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
173 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
175 ╭───────────────────────────────────────────────────────────────┬──────────────╮
182 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
183 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
184 │too much to drink to drive safely will A. Get certain │ │ │
185 │stopped by the police? Very likely │ 21%│ 22%│
186 │ Somewhat │ 38%│ 42%│
188 │ Somewhat │ 21%│ 18%│
192 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
193 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
194 │too much to drink to drive safely will B. Have an certain │ │ │
195 │accident? Very likely │ 36%│ 45%│
196 │ Somewhat │ 39%│ 32%│
202 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
203 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
204 │too much to drink to drive safely will C. Be certain │ │ │
205 │convicted for drunk driving? Very likely │ 32%│ 28%│
206 │ Somewhat │ 27%│ 32%│
208 │ Somewhat │ 15%│ 15%│
212 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
213 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
214 │too much to drink to drive safely will D. Be certain │ │ │
215 │arrested for drunk driving? Very likely │ 26%│ 27%│
216 │ Somewhat │ 32%│ 35%│
218 │ Somewhat │ 17%│ 15%│
222 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
226 AT_SETUP([CTABLES show or hide empty categories])
227 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
228 AT_DATA([ctables.sps],
230 IF (qn105ba = 2) qn105ba = 1.
231 IF (qns3a = 1) qns3a = 2.
232 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
233 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
234 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
235 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
236 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
237 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
238 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
240 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
242 ╭──────────────────────────────────────────────────────────────┬───────────────╮
249 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
250 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
251 │too much to drink to drive safely will A. Get certain │ │ │
252 │stopped by the police? Very likely│ .│ 0%│
259 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
262 ╭──────────────────────────────────────────────────────────────┬───────────────╮
269 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
270 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
271 │too much to drink to drive safely will A. Get certain │ │ │
272 │stopped by the police? Somewhat │ .│ 40%│
278 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
281 ╭────────────────────────────────────────────────────────────────────┬─────────╮
288 ├────────────────────────────────────────────────────────────────────┼─────────┤
289 │105b. How likely is it that drivers who have had too Almost │ 32%│
290 │much to drink to drive safely will A. Get stopped by certain │ │
291 │the police? Very likely │ 0%│
298 ╰────────────────────────────────────────────────────────────────────┴─────────╯
301 ╭────────────────────────────────────────────────────────────────────┬─────────╮
308 ├────────────────────────────────────────────────────────────────────┼─────────┤
309 │105b. How likely is it that drivers who have had too Almost │ 32%│
310 │much to drink to drive safely will A. Get stopped by certain │ │
311 │the police? Somewhat │ 40%│
317 ╰────────────────────────────────────────────────────────────────────┴─────────╯
321 AT_SETUP([CTABLES simple nesting])
322 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
323 AT_DATA([ctables.sps],
325 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
326 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
327 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
328 /CATEGORIES VARIABLES=qns3a TOTAL=YES
329 /CLABELS ROW=OPPOSITE.
331 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
333 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
336 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
337 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
338 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
339 │drive safely will A. Get stopped by Total │ 700│ 10%│
340 │the police? ╶──────────────────────────┼─────┼──────┤
341 │ Very S3a. Male │ 660│ 10%│
342 │ likely GENDER: Female│ 842│ 12%│
344 │ ╶──────────────────────────┼─────┼──────┤
345 │ Somewhat S3a. Male │ 1174│ 17%│
346 │ likely GENDER: Female│ 1589│ 23%│
348 │ ╶──────────────────────────┼─────┼──────┤
349 │ Somewhat S3a. Male │ 640│ 9%│
350 │ unlikely GENDER: Female│ 667│ 10%│
352 │ ╶──────────────────────────┼─────┼──────┤
353 │ Very S3a. Male │ 311│ 5%│
354 │ unlikely GENDER: Female│ 298│ 4%│
356 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
357 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
358 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
359 │drive safely will B. Have an accident? Total │ 1100│ 16%│
360 │ ╶──────────────────────────┼─────┼──────┤
361 │ Very S3a. Male │ 1104│ 16%│
362 │ likely GENDER: Female│ 1715│ 25%│
364 │ ╶──────────────────────────┼─────┼──────┤
365 │ Somewhat S3a. Male │ 1203│ 17%│
366 │ likely GENDER: Female│ 1214│ 18%│
368 │ ╶──────────────────────────┼─────┼──────┤
369 │ Somewhat S3a. Male │ 262│ 4%│
370 │ unlikely GENDER: Female│ 168│ 2%│
372 │ ╶──────────────────────────┼─────┼──────┤
373 │ Very S3a. Male │ 81│ 1%│
374 │ unlikely GENDER: Female│ 59│ 1%│
376 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
377 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
378 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
379 │drive safely will C. Be convicted for Total │ 1149│ 17%│
380 │drunk driving? ╶──────────────────────────┼─────┼──────┤
381 │ Very S3a. Male │ 988│ 14%│
382 │ likely GENDER: Female│ 1049│ 15%│
384 │ ╶──────────────────────────┼─────┼──────┤
385 │ Somewhat S3a. Male │ 822│ 12%│
386 │ likely GENDER: Female│ 1210│ 18%│
388 │ ╶──────────────────────────┼─────┼──────┤
389 │ Somewhat S3a. Male │ 446│ 7%│
390 │ unlikely GENDER: Female│ 548│ 8%│
392 │ ╶──────────────────────────┼─────┼──────┤
393 │ Very S3a. Male │ 268│ 4%│
394 │ unlikely GENDER: Female│ 354│ 5%│
396 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
397 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
398 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
399 │drive safely will D. Be arrested for Total │ 1101│ 16%│
400 │drunk driving? ╶──────────────────────────┼─────┼──────┤
401 │ Very S3a. Male │ 805│ 12%│
402 │ likely GENDER: Female│ 1029│ 15%│
404 │ ╶──────────────────────────┼─────┼──────┤
405 │ Somewhat S3a. Male │ 975│ 14%│
406 │ likely GENDER: Female│ 1332│ 19%│
408 │ ╶──────────────────────────┼─────┼──────┤
409 │ Somewhat S3a. Male │ 535│ 8%│
410 │ unlikely GENDER: Female│ 560│ 8%│
412 │ ╶──────────────────────────┼─────┼──────┤
413 │ Very S3a. Male │ 270│ 4%│
414 │ unlikely GENDER: Female│ 279│ 4%│
416 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
419 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
420 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
421 │ │ certain│likely│ likely │ unlikely│unlikely│
422 │ ├────────┼──────┼─────────┼─────────┼────────┤
424 │ │ Table %│ % │ Table % │ Table % │ Table %│
425 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
426 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
427 │GENDER: is it that drivers│ │ │ │ │ │
428 │ who have had too │ │ │ │ │ │
429 │ much to drink to │ │ │ │ │ │
430 │ drive safely will │ │ │ │ │ │
431 │ A. Get stopped by │ │ │ │ │ │
432 │ the police? │ │ │ │ │ │
433 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
434 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
435 │ is it that drivers│ │ │ │ │ │
436 │ who have had too │ │ │ │ │ │
437 │ much to drink to │ │ │ │ │ │
438 │ drive safely will │ │ │ │ │ │
439 │ A. Get stopped by │ │ │ │ │ │
440 │ the police? │ │ │ │ │ │
441 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
442 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
443 │ is it that drivers│ │ │ │ │ │
444 │ who have had too │ │ │ │ │ │
445 │ much to drink to │ │ │ │ │ │
446 │ drive safely will │ │ │ │ │ │
447 │ A. Get stopped by │ │ │ │ │ │
448 │ the police? │ │ │ │ │ │
449 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
450 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
451 │GENDER: is it that drivers│ │ │ │ │ │
452 │ who have had too │ │ │ │ │ │
453 │ much to drink to │ │ │ │ │ │
454 │ drive safely will │ │ │ │ │ │
455 │ B. Have an │ │ │ │ │ │
456 │ accident? │ │ │ │ │ │
457 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
458 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
459 │ is it that drivers│ │ │ │ │ │
460 │ who have had too │ │ │ │ │ │
461 │ much to drink to │ │ │ │ │ │
462 │ drive safely will │ │ │ │ │ │
463 │ B. Have an │ │ │ │ │ │
464 │ accident? │ │ │ │ │ │
465 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
466 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
467 │ is it that drivers│ │ │ │ │ │
468 │ who have had too │ │ │ │ │ │
469 │ much to drink to │ │ │ │ │ │
470 │ drive safely will │ │ │ │ │ │
471 │ B. Have an │ │ │ │ │ │
472 │ accident? │ │ │ │ │ │
473 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
474 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
475 │GENDER: is it that drivers│ │ │ │ │ │
476 │ who have had too │ │ │ │ │ │
477 │ much to drink to │ │ │ │ │ │
478 │ drive safely will │ │ │ │ │ │
479 │ C. Be convicted │ │ │ │ │ │
480 │ for drunk driving?│ │ │ │ │ │
481 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
482 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
483 │ is it that drivers│ │ │ │ │ │
484 │ who have had too │ │ │ │ │ │
485 │ much to drink to │ │ │ │ │ │
486 │ drive safely will │ │ │ │ │ │
487 │ C. Be convicted │ │ │ │ │ │
488 │ for drunk driving?│ │ │ │ │ │
489 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
490 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
491 │ is it that drivers│ │ │ │ │ │
492 │ who have had too │ │ │ │ │ │
493 │ much to drink to │ │ │ │ │ │
494 │ drive safely will │ │ │ │ │ │
495 │ C. Be convicted │ │ │ │ │ │
496 │ for drunk driving?│ │ │ │ │ │
497 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
498 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
499 │GENDER: is it that drivers│ │ │ │ │ │
500 │ who have had too │ │ │ │ │ │
501 │ much to drink to │ │ │ │ │ │
502 │ drive safely will │ │ │ │ │ │
503 │ D. Be arrested for│ │ │ │ │ │
504 │ drunk driving? │ │ │ │ │ │
505 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
506 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
507 │ is it that drivers│ │ │ │ │ │
508 │ who have had too │ │ │ │ │ │
509 │ much to drink to │ │ │ │ │ │
510 │ drive safely will │ │ │ │ │ │
511 │ D. Be arrested for│ │ │ │ │ │
512 │ drunk driving? │ │ │ │ │ │
513 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
514 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
515 │ is it that drivers│ │ │ │ │ │
516 │ who have had too │ │ │ │ │ │
517 │ much to drink to │ │ │ │ │ │
518 │ drive safely will │ │ │ │ │ │
519 │ D. Be arrested for│ │ │ │ │ │
520 │ drunk driving? │ │ │ │ │ │
521 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
525 AT_SETUP([CTABLES nesting and scale variables])
526 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
527 AT_DATA([ctables.sps],
529 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
530 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
531 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
532 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
533 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
535 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
537 ╭─────────────────────────────────────────────────────────────────┬────────────╮
543 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
544 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
545 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
547 │ Once a week or │ 44│ 54│
549 │ Only certain │ 34│ 41│
552 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
555 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
556 │ │Minimum│Maximum│Mean│
557 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
558 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
559 │What is GENDER: months, has there been a │ │ │ │
560 │your time when you felt you │ │ │ │
561 │age? should cut down on your No │ 16│ 86│ 46│
563 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
564 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
565 │ months, has there been a │ │ │ │
566 │ time when you felt you │ │ │ │
567 │ should cut down on your No │ 16│ 86│ 48│
569 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
570 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
571 │What is GENDER: months, has there been a │ │ │ │
572 │your time when people criticized No │ 16│ 86│ 46│
573 │age? your drinking? │ │ │ │
574 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
575 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
576 │ months, has there been a │ │ │ │
577 │ time when people criticized No │ 16│ 86│ 48│
578 │ your drinking? │ │ │ │
579 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
582 ╭─────────────────────────────┬────────────────────────────────────────────────╮
583 │ │S1. Including yourself, how many members of this│
584 │ │ household are age 16 or older? │
585 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
586 │ │ │ │ │ │ │ │ 6 or │
587 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
588 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
589 │ │Column│Column│Column│Column│Column│Column│Column│
590 │ │ % │ % │ % │ % │ % │ % │ % │
591 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
592 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
593 │SAMPLE How certain │ │ │ │ │ │ │ │
594 │SOURCE: likely │ │ │ │ │ │ │ │
595 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
596 │ that likely │ │ │ │ │ │ │ │
597 │ drivers │ │ │ │ │ │ │ │
598 │ who have │ │ │ │ │ │ │ │
599 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
600 │ much to likely │ │ │ │ │ │ │ │
601 │ drink to │ │ │ │ │ │ │ │
602 │ drive │ │ │ │ │ │ │ │
603 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
604 │ will A. unlikely│ │ │ │ │ │ │ │
605 │ Get │ │ │ │ │ │ │ │
606 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
607 │ by the unlikely│ │ │ │ │ │ │ │
608 │ police? │ │ │ │ │ │ │ │
609 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
612 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
615 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
616 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
617 │group typical month did you have one or more │ │ │
618 │ alcoholic beverages to drink? │ │ │
619 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
620 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
621 │ typical month did you have one or more │ │ │
622 │ alcoholic beverages to drink? │ │ │
623 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
624 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
625 │ typical month did you have one or more │ │ │
626 │ alcoholic beverages to drink? │ │ │
627 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
628 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
629 │ typical month did you have one or more │ │ │
630 │ alcoholic beverages to drink? │ │ │
631 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
632 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
633 │ typical month did you have one or more │ │ │
634 │ alcoholic beverages to drink? │ │ │
635 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
636 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
637 │ older typical month did you have one or more │ │ │
638 │ alcoholic beverages to drink? │ │ │
639 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
644 AT_SETUP([CTABLES SLABELS])
645 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
646 AT_DATA([ctables.sps],
648 CTABLES /TABLE qn1 [COUNT COLPCT].
649 CTABLES /TABLE qn1 [COUNT COLPCT]
650 /SLABELS POSITION=ROW.
651 CTABLES /TABLE qn1 [COUNT COLPCT]
652 /SLABELS POSITION=ROW VISIBLE=NO.
654 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
656 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
659 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
660 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
661 │other motor vehicle? Several days a week│ 1274│ 18.3%│
662 │ Once a week or less│ 361│ 5.2%│
663 │ Only certain times │ 130│ 1.9%│
666 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
669 ╭────────────────────────────────────────────────────────────────────────┬─────╮
670 │ 1. How often do you usually drive a car or Every day Count │ 4667│
671 │other motor vehicle? Column │66.9%│
673 │ ╶───────────────────────────┼─────┤
674 │ Several days a week Count │ 1274│
677 │ ╶───────────────────────────┼─────┤
678 │ Once a week or less Count │ 361│
681 │ ╶───────────────────────────┼─────┤
682 │ Only certain times Count │ 130│
683 │ a year Column │ 1.9%│
685 │ ╶───────────────────────────┼─────┤
689 ╰────────────────────────────────────────────────────────────────────────┴─────╯
692 ╭────────────────────────────────────────────────────────────────────────┬─────╮
693 │ 1. How often do you usually drive a car or other Every day │ 4667│
694 │motor vehicle? │66.9%│
695 │ Several days a week │ 1274│
697 │ Once a week or less │ 361│
699 │ Only certain times a │ 130│
703 ╰────────────────────────────────────────────────────────────────────────┴─────╯
707 AT_SETUP([CTABLES simple totals])
708 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
709 AT_DATA([ctables.sps],
712 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
713 DESCRIPTIVES qn18/STATISTICS=MEAN.
714 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
715 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
717 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
719 ╭────────────────────────────────────────────────────────────────────────┬─────╮
721 ├────────────────────────────────────────────────────────────────────────┼─────┤
722 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
723 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
726 │ Wine coolers │ 137│
727 │ Hard liquor or │ 888│
729 │ Flavored malt │ 83│
731 │ Number responding │ 4221│
732 ╰────────────────────────────────────────────────────────────────────────┴─────╯
734 Descriptive Statistics
735 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
737 ├────────────────────────────────────────────────────────────────────┼────┼────┤
738 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
739 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
740 │Valid N (listwise) │6999│ │
741 │Missing N (listwise) │2781│ │
742 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
745 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
747 │ │Mean│Count│ N │ N │
748 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
749 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
750 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
751 │ you usually drink per sitting? │ │ │ │ │
752 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
753 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
754 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
755 │ you usually drink per sitting? │ │ │ │ │
756 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
757 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
758 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
759 │ you usually drink per sitting? │ │ │ │ │
760 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
761 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
762 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
763 │ you usually drink per sitting? │ │ │ │ │
764 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
765 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
766 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
767 │ you usually drink per sitting? │ │ │ │ │
768 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
772 AT_SETUP([CTABLES subtotals])
773 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
774 AT_DATA([ctables.sps],
776 CTABLES /TABLE=qn105ba BY qns1
777 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
778 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
779 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
780 CTABLES /TABLE=qn105ba BY qns1
781 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
782 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
784 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
786 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
787 │ │ S1. Including yourself, how many members of this household │
788 │ │ are age 16 or older? │
789 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
790 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
791 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
792 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
793 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
794 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
795 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
796 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
797 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
798 │ likely │ │ │ │ │ │ │ │
799 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
800 │ unlikely │ │ │ │ │ │ │ │
801 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
802 │ unlikely │ │ │ │ │ │ │ │
803 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
806 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
807 │ │ S1. Including yourself, how many members of this household │
808 │ │ are age 16 or older? │
809 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
810 │ │ │ │ │ │ │ │ 6 or │
811 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
812 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
813 │ │ │ │ │ │ Column│ │ │
814 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
815 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
816 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
817 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
818 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
819 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
820 │ likely │ │ │ │ │ │ │ │
821 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
822 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
823 │ unlikely │ │ │ │ │ │ │ │
824 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
825 │ unlikely │ │ │ │ │ │ │ │
826 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
827 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
830 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
831 │ │ S1. Including yourself, how many members of this household │
832 │ │ are age 16 or older? │
833 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
834 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
835 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
836 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
837 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
838 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
839 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
840 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
841 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
842 │ likely │ │ │ │ │ │ │ │
843 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
844 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
845 │ unlikely │ │ │ │ │ │ │ │
846 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
847 │ unlikely │ │ │ │ │ │ │ │
848 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
849 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
853 AT_SETUP([CTABLES PCOMPUTE])
854 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
855 AT_DATA([ctables.sps],
858 /PCOMPUTE &x=EXPR([3] + [4])
859 /PCOMPUTE &y=EXPR([4] + [5])
860 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
861 /PPROPERTIES &y LABEL='4+5'
862 /TABLE=qn105ba BY qns1
863 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
865 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
867 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
868 │ │ S1. Including yourself, how many members of this household │
869 │ │ are age 16 or older? │
870 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
871 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
872 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
873 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
874 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
875 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
876 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
877 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
878 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
879 │ likely │ │ │ │ │ │ │ │
880 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
881 │ unlikely │ │ │ │ │ │ │ │
882 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
883 │ unlikely │ │ │ │ │ │ │ │
884 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
888 AT_SETUP([CTABLES CLABELS])
889 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
890 AT_DATA([ctables.sps],
892 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
893 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
895 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
897 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
899 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
901 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
902 │ │ 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 │
903 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
904 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
905 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
906 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
907 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
908 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
909 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
912 ╭──────────────────────────────┬────────────╮
916 ├──────────────────────────────┼────────────┤
917 │Age group 15 or younger Male │ 0│
919 │ ╶────────────────────┼────────────┤
920 │ 16 to 25 Male │ 594│
922 │ ╶────────────────────┼────────────┤
923 │ 26 to 35 Male │ 476│
925 │ ╶────────────────────┼────────────┤
926 │ 36 to 45 Male │ 489│
928 │ ╶────────────────────┼────────────┤
929 │ 46 to 55 Male │ 526│
931 │ ╶────────────────────┼────────────┤
932 │ 56 to 65 Male │ 516│
934 │ ╶────────────────────┼────────────┤
935 │ 66 or older Male │ 531│
937 ╰──────────────────────────────┴────────────╯
941 AT_SETUP([CTABLES missing values])
942 AT_DATA([ctables.sps],
943 [[DATA LIST LIST NOTABLE/x y.
982 MISSING VALUES x (1, 2) y (2, 3).
983 VARIABLE LEVEL ALL (NOMINAL).
985 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
986 /CATEGORIES VARIABLES=ALL TOTAL=YES.
987 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
988 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
989 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]]
990 /CATEGORIES VARIABLES=ALL TOTAL=YES
991 /SLABELS POSITION=ROW.
992 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]]
993 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
994 /SLABELS POSITION=ROW.
995 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
996 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
997 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
998 /SLABELS POSITION=ROW.
1000 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1002 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1003 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1004 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1005 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1006 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1007 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1008 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1009 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1010 dnl Note that Column Total N % doesn't add up to 100 because missing
1011 dnl values are included in the total but not shown as a category and this
1012 dnl is expected behavior.
1015 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1016 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1017 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1018 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1019 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1020 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1021 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1022 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1023 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1024 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1025 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1026 dnl values are included in the total but not shown as a category and this
1027 dnl is expected behavior.
1030 ╭────────────────────────┬───────────────────────────╮
1032 │ ├──────┬──────┬──────┬──────┤
1033 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1034 ├────────────────────────┼──────┼──────┼──────┼──────┤
1035 │x 3.00 Count │ 1│ 1│ 1│ 3│
1036 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1037 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1038 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1039 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1040 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1041 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1042 │ Valid N │ │ │ │ 3│
1043 │ Total N │ │ │ │ 6│
1044 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1045 │ 4.00 Count │ 1│ 1│ 1│ 3│
1046 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1047 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1048 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1049 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1050 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1051 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1052 │ Valid N │ │ │ │ 3│
1053 │ Total N │ │ │ │ 6│
1054 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1055 │ 5.00 Count │ 1│ 1│ 1│ 3│
1056 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1057 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1058 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1059 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1060 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1061 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1062 │ Valid N │ │ │ │ 3│
1063 │ Total N │ │ │ │ 6│
1064 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1065 │ Total Count │ 3│ 3│ 3│ 9│
1066 │ Column % │100.0%│100.0%│100.0%│ .│
1067 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1068 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1069 │ Row % │ .│ .│ .│ .│
1070 │ Row Valid N % │ .│ .│ .│ .│
1071 │ Row Total N % │ .│ .│ .│ .│
1072 │ Valid N │ 3│ 3│ 3│ 9│
1073 │ Total N │ 6│ 6│ 6│ 36│
1074 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1077 ╭────────────────────────┬─────────────────────────────────────────╮
1079 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1080 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1081 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1082 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1083 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1084 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1085 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1086 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1087 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1088 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1089 │ Valid N │ │ │ │ │ │ 0│
1090 │ Total N │ │ │ │ │ │ 6│
1091 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1092 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1093 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1094 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1095 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1096 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1097 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1098 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1099 │ Valid N │ │ │ │ │ │ 0│
1100 │ Total N │ │ │ │ │ │ 6│
1101 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1102 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1103 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1104 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1105 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1106 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1107 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1108 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1109 │ Valid N │ │ │ │ │ │ 3│
1110 │ Total N │ │ │ │ │ │ 6│
1111 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1112 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1113 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1114 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1115 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1116 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1117 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1118 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1119 │ Valid N │ │ │ │ │ │ 3│
1120 │ Total N │ │ │ │ │ │ 6│
1121 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1122 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1123 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1124 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1125 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1126 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1127 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1128 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1129 │ Valid N │ │ │ │ │ │ 3│
1130 │ Total N │ │ │ │ │ │ 6│
1131 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1132 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1133 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1134 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1135 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1136 │ Row % │ .│ .│ .│ .│ .│ .│
1137 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1138 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1139 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1140 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1141 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1144 ╭────────────────────────┬──────────────────────────────────╮
1146 │ ├──────┬──────┬──────┬──────┬──────┤
1147 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1148 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1149 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1150 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1151 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1152 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1153 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1154 │ Row Valid N % │ .│ .│ .│ .│ .│
1155 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1156 │ Valid N │ │ │ │ │ 0│
1157 │ Total N │ │ │ │ │ 6│
1158 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1159 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1160 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1161 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1162 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1163 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1164 │ Row Valid N % │ .│ .│ .│ .│ .│
1165 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1166 │ Valid N │ │ │ │ │ 0│
1167 │ Total N │ │ │ │ │ 6│
1168 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1169 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1170 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1171 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1172 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1173 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1174 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1175 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1176 │ Valid N │ │ │ │ │ 3│
1177 │ Total N │ │ │ │ │ 6│
1178 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1179 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1180 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1181 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1182 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1183 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1184 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1185 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1186 │ Valid N │ │ │ │ │ 3│
1187 │ Total N │ │ │ │ │ 6│
1188 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1189 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1190 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1191 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1192 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1193 │ Row % │ .│ .│ .│ .│ .│
1194 │ Row Valid N % │ .│ .│ .│ .│ .│
1195 │ Row Total N % │ .│ .│ .│ .│ .│
1196 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1197 │ Total N │ 5│ 5│ 5│ 5│ 30│
1198 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1202 AT_SETUP([CTABLES SMISSING=LISTWISE])
1203 AT_KEYWORDS([SMISSING LISTWISE])
1204 AT_DATA([ctables.sps],
1205 [[DATA LIST LIST NOTABLE/x y z.
1213 VARIABLE LEVEL x (NOMINAL).
1215 CTABLES /TABLE (y + z) > x.
1216 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1218 * The following doesn't come out as listwise because the tables are
1219 separate, not linked by an > operator.
1220 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1222 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl