3 dnl Features not yet implemented:
5 dnl - Date/time variables and values
6 dnl - SPLIT FILE with SEPARATE splits
7 dnl - Definition of columns/rows when labels are rotated from one axis to another.
8 dnl - Preprocessing to distinguish categorical from scale.
9 dnl - )CILEVEL in summary specifications
10 dnl - Summary functions:
11 dnl * Unimplemented ones.
12 dnl * U-prefix for unweighted summaries.
13 dnl * .LCL and .UCL suffixes.
18 dnl * Data-dependent sorting.
19 dnl - TITLES: )DATE, )TIME, )TABLE.
21 dnl * multi-dimensional
22 dnl * MISSING, OTHERNM
26 dnl * summary statistics and formats?
27 dnl - Are string ranges a thing?
29 dnl Features not yet tested:
30 dnl - Parsing (positive and negative)
31 dnl - String variables and values
32 dnl - Testing details of missing value handling in summaries.
33 dnl - test CLABELS ROWLABELS=LAYER.
35 dnl - Test WEIGHT and adjustment weights.
36 dnl - Test PCOMPUTE and PPROPERTIES.
37 dnl - Summary functions:
38 dnl * Separate summary functions for totals and subtotals.
43 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
46 dnl - HIDESMALLCOUNTS.
47 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
50 dnl - Multiple response sets
51 dnl - MRSETS subcommand.
52 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
58 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
59 dnl produces a bad median:
61 dnl +--------------------------+-----------------------+
62 dnl | | S3a. GENDER: |
63 dnl | +-----------+-----------+
64 dnl | | Male | Female |
65 dnl | +----+------+----+------+
66 dnl | |Mean|Median|Mean|Median|
67 dnl +--------------------------+----+------+----+------+
68 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
69 dnl +--------------------------+----+------+----+------+
73 # AT_SETUP([CTABLES parsing])
74 # AT_DATA([ctables.sps],
75 # [[DATA LIST LIST NOTABLE /x y z.
76 # CTABLES /TABLE=(x + y) > z.
77 # CTABLES /TABLE=(x[c] + y[c]) > z.
78 # CTABLES /TABLE=(x + y) > z[c].
79 # CTABLES /TABLE=x BY y BY z.
80 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
81 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
83 # AT_CHECK([pspp ctables.sps])
86 AT_SETUP([CTABLES one categorical variable])
87 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
88 AT_DATA([ctables.sps],
91 CTABLES /TABLE BY qn1.
92 CTABLES /TABLE BY BY qn1.
94 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
96 ╭────────────────────────────────────────────────────────────────────────┬─────╮
98 ├────────────────────────────────────────────────────────────────────────┼─────┤
99 │ 1. How often do you usually drive a car or other Every day │ 4667│
100 │motor vehicle? Several days a week │ 1274│
101 │ Once a week or less │ 361│
102 │ Only certain times a │ 130│
105 ╰────────────────────────────────────────────────────────────────────────┴─────╯
108 ╭──────────────────────────────────────────────────────────────────────────────╮
109 │ 1. How often do you usually drive a car or other motor vehicle? │
110 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
111 │ │ Several days a │ Once a week or │ Only certain times a │ │
112 │Every day│ week │ less │ year │Never│
113 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
114 │ Count │ Count │ Count │ Count │Count│
115 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
116 │ 4667│ 1274│ 361│ 130│ 540│
117 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
129 AT_SETUP([CTABLES one scale variable])
130 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
131 AT_DATA([ctables.sps],
133 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
134 CTABLES /TABLE BY qnd1.
135 CTABLES /TABLE BY BY qnd1.
137 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
139 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
140 │ │ │ │ │ │ Std │ │ │
141 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
142 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
143 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
144 │age? │ │ │ │ │ │ │ │
145 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
148 ╭──────────────────────────╮
149 │D1. AGE: What is your age?│
150 ├──────────────────────────┤
152 ├──────────────────────────┤
154 ╰──────────────────────────╯
157 D1. AGE: What is your age?
166 AT_SETUP([CTABLES simple stacking])
167 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
168 AT_DATA([ctables.sps],
170 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
172 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
174 ╭───────────────────────────────────────────────────────────────┬──────────────╮
181 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
182 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
183 │too much to drink to drive safely will A. Get certain │ │ │
184 │stopped by the police? Very likely │ 21%│ 22%│
185 │ Somewhat │ 38%│ 42%│
187 │ Somewhat │ 21%│ 18%│
191 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
192 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
193 │too much to drink to drive safely will B. Have an certain │ │ │
194 │accident? Very likely │ 36%│ 45%│
195 │ Somewhat │ 39%│ 32%│
201 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
202 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
203 │too much to drink to drive safely will C. Be certain │ │ │
204 │convicted for drunk driving? Very likely │ 32%│ 28%│
205 │ Somewhat │ 27%│ 32%│
207 │ Somewhat │ 15%│ 15%│
211 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
212 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
213 │too much to drink to drive safely will D. Be certain │ │ │
214 │arrested for drunk driving? Very likely │ 26%│ 27%│
215 │ Somewhat │ 32%│ 35%│
217 │ Somewhat │ 17%│ 15%│
221 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
225 AT_SETUP([CTABLES show or hide empty categories])
226 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
227 AT_DATA([ctables.sps],
229 IF (qn105ba = 2) qn105ba = 1.
230 IF (qns3a = 1) qns3a = 2.
231 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
232 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
233 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
234 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
235 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
236 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
237 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
239 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
241 ╭──────────────────────────────────────────────────────────────┬───────────────╮
248 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
249 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
250 │too much to drink to drive safely will A. Get certain │ │ │
251 │stopped by the police? Very likely│ .│ 0%│
258 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
261 ╭──────────────────────────────────────────────────────────────┬───────────────╮
268 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
269 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
270 │too much to drink to drive safely will A. Get certain │ │ │
271 │stopped by the police? Somewhat │ .│ 40%│
277 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
280 ╭────────────────────────────────────────────────────────────────────┬─────────╮
287 ├────────────────────────────────────────────────────────────────────┼─────────┤
288 │105b. How likely is it that drivers who have had too Almost │ 32%│
289 │much to drink to drive safely will A. Get stopped by certain │ │
290 │the police? Very likely │ 0%│
297 ╰────────────────────────────────────────────────────────────────────┴─────────╯
300 ╭────────────────────────────────────────────────────────────────────┬─────────╮
307 ├────────────────────────────────────────────────────────────────────┼─────────┤
308 │105b. How likely is it that drivers who have had too Almost │ 32%│
309 │much to drink to drive safely will A. Get stopped by certain │ │
310 │the police? Somewhat │ 40%│
316 ╰────────────────────────────────────────────────────────────────────┴─────────╯
320 AT_SETUP([CTABLES simple nesting])
321 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
322 AT_DATA([ctables.sps],
324 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
325 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
326 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
327 /CATEGORIES VARIABLES=qns3a TOTAL=YES
328 /CLABELS ROW=OPPOSITE.
330 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
332 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
335 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
336 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
337 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
338 │drive safely will A. Get stopped by Total │ 700│ 10%│
339 │the police? ╶──────────────────────────┼─────┼──────┤
340 │ Very S3a. Male │ 660│ 10%│
341 │ likely GENDER: Female│ 842│ 12%│
343 │ ╶──────────────────────────┼─────┼──────┤
344 │ Somewhat S3a. Male │ 1174│ 17%│
345 │ likely GENDER: Female│ 1589│ 23%│
347 │ ╶──────────────────────────┼─────┼──────┤
348 │ Somewhat S3a. Male │ 640│ 9%│
349 │ unlikely GENDER: Female│ 667│ 10%│
351 │ ╶──────────────────────────┼─────┼──────┤
352 │ Very S3a. Male │ 311│ 5%│
353 │ unlikely GENDER: Female│ 298│ 4%│
355 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
356 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
357 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
358 │drive safely will B. Have an accident? Total │ 1100│ 16%│
359 │ ╶──────────────────────────┼─────┼──────┤
360 │ Very S3a. Male │ 1104│ 16%│
361 │ likely GENDER: Female│ 1715│ 25%│
363 │ ╶──────────────────────────┼─────┼──────┤
364 │ Somewhat S3a. Male │ 1203│ 17%│
365 │ likely GENDER: Female│ 1214│ 18%│
367 │ ╶──────────────────────────┼─────┼──────┤
368 │ Somewhat S3a. Male │ 262│ 4%│
369 │ unlikely GENDER: Female│ 168│ 2%│
371 │ ╶──────────────────────────┼─────┼──────┤
372 │ Very S3a. Male │ 81│ 1%│
373 │ unlikely GENDER: Female│ 59│ 1%│
375 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
376 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
377 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
378 │drive safely will C. Be convicted for Total │ 1149│ 17%│
379 │drunk driving? ╶──────────────────────────┼─────┼──────┤
380 │ Very S3a. Male │ 988│ 14%│
381 │ likely GENDER: Female│ 1049│ 15%│
383 │ ╶──────────────────────────┼─────┼──────┤
384 │ Somewhat S3a. Male │ 822│ 12%│
385 │ likely GENDER: Female│ 1210│ 18%│
387 │ ╶──────────────────────────┼─────┼──────┤
388 │ Somewhat S3a. Male │ 446│ 7%│
389 │ unlikely GENDER: Female│ 548│ 8%│
391 │ ╶──────────────────────────┼─────┼──────┤
392 │ Very S3a. Male │ 268│ 4%│
393 │ unlikely GENDER: Female│ 354│ 5%│
395 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
396 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
397 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
398 │drive safely will D. Be arrested for Total │ 1101│ 16%│
399 │drunk driving? ╶──────────────────────────┼─────┼──────┤
400 │ Very S3a. Male │ 805│ 12%│
401 │ likely GENDER: Female│ 1029│ 15%│
403 │ ╶──────────────────────────┼─────┼──────┤
404 │ Somewhat S3a. Male │ 975│ 14%│
405 │ likely GENDER: Female│ 1332│ 19%│
407 │ ╶──────────────────────────┼─────┼──────┤
408 │ Somewhat S3a. Male │ 535│ 8%│
409 │ unlikely GENDER: Female│ 560│ 8%│
411 │ ╶──────────────────────────┼─────┼──────┤
412 │ Very S3a. Male │ 270│ 4%│
413 │ unlikely GENDER: Female│ 279│ 4%│
415 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
418 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
419 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
420 │ │ certain│likely│ likely │ unlikely│unlikely│
421 │ ├────────┼──────┼─────────┼─────────┼────────┤
423 │ │ Table %│ % │ Table % │ Table % │ Table %│
424 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
425 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
426 │GENDER: is it that drivers│ │ │ │ │ │
427 │ who have had too │ │ │ │ │ │
428 │ much to drink to │ │ │ │ │ │
429 │ drive safely will │ │ │ │ │ │
430 │ A. Get stopped by │ │ │ │ │ │
431 │ the police? │ │ │ │ │ │
432 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
433 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
434 │ is it that drivers│ │ │ │ │ │
435 │ who have had too │ │ │ │ │ │
436 │ much to drink to │ │ │ │ │ │
437 │ drive safely will │ │ │ │ │ │
438 │ A. Get stopped by │ │ │ │ │ │
439 │ the police? │ │ │ │ │ │
440 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
441 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
442 │ is it that drivers│ │ │ │ │ │
443 │ who have had too │ │ │ │ │ │
444 │ much to drink to │ │ │ │ │ │
445 │ drive safely will │ │ │ │ │ │
446 │ A. Get stopped by │ │ │ │ │ │
447 │ the police? │ │ │ │ │ │
448 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
449 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
450 │GENDER: is it that drivers│ │ │ │ │ │
451 │ who have had too │ │ │ │ │ │
452 │ much to drink to │ │ │ │ │ │
453 │ drive safely will │ │ │ │ │ │
454 │ B. Have an │ │ │ │ │ │
455 │ accident? │ │ │ │ │ │
456 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
457 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
458 │ is it that drivers│ │ │ │ │ │
459 │ who have had too │ │ │ │ │ │
460 │ much to drink to │ │ │ │ │ │
461 │ drive safely will │ │ │ │ │ │
462 │ B. Have an │ │ │ │ │ │
463 │ accident? │ │ │ │ │ │
464 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
465 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
466 │ is it that drivers│ │ │ │ │ │
467 │ who have had too │ │ │ │ │ │
468 │ much to drink to │ │ │ │ │ │
469 │ drive safely will │ │ │ │ │ │
470 │ B. Have an │ │ │ │ │ │
471 │ accident? │ │ │ │ │ │
472 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
473 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
474 │GENDER: is it that drivers│ │ │ │ │ │
475 │ who have had too │ │ │ │ │ │
476 │ much to drink to │ │ │ │ │ │
477 │ drive safely will │ │ │ │ │ │
478 │ C. Be convicted │ │ │ │ │ │
479 │ for drunk driving?│ │ │ │ │ │
480 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
481 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
482 │ is it that drivers│ │ │ │ │ │
483 │ who have had too │ │ │ │ │ │
484 │ much to drink to │ │ │ │ │ │
485 │ drive safely will │ │ │ │ │ │
486 │ C. Be convicted │ │ │ │ │ │
487 │ for drunk driving?│ │ │ │ │ │
488 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
489 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
490 │ is it that drivers│ │ │ │ │ │
491 │ who have had too │ │ │ │ │ │
492 │ much to drink to │ │ │ │ │ │
493 │ drive safely will │ │ │ │ │ │
494 │ C. Be convicted │ │ │ │ │ │
495 │ for drunk driving?│ │ │ │ │ │
496 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
497 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
498 │GENDER: is it that drivers│ │ │ │ │ │
499 │ who have had too │ │ │ │ │ │
500 │ much to drink to │ │ │ │ │ │
501 │ drive safely will │ │ │ │ │ │
502 │ D. Be arrested for│ │ │ │ │ │
503 │ drunk driving? │ │ │ │ │ │
504 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
505 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
506 │ is it that drivers│ │ │ │ │ │
507 │ who have had too │ │ │ │ │ │
508 │ much to drink to │ │ │ │ │ │
509 │ drive safely will │ │ │ │ │ │
510 │ D. Be arrested for│ │ │ │ │ │
511 │ drunk driving? │ │ │ │ │ │
512 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
513 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
514 │ is it that drivers│ │ │ │ │ │
515 │ who have had too │ │ │ │ │ │
516 │ much to drink to │ │ │ │ │ │
517 │ drive safely will │ │ │ │ │ │
518 │ D. Be arrested for│ │ │ │ │ │
519 │ drunk driving? │ │ │ │ │ │
520 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
524 AT_SETUP([CTABLES nesting and scale variables])
525 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
526 AT_DATA([ctables.sps],
528 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
529 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
530 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
531 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
532 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
534 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
536 ╭─────────────────────────────────────────────────────────────────┬────────────╮
542 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
543 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
544 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
546 │ Once a week or │ 44│ 54│
548 │ Only certain │ 34│ 41│
551 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
554 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
555 │ │Minimum│Maximum│Mean│
556 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
557 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
558 │What is GENDER: months, has there been a │ │ │ │
559 │your time when you felt you │ │ │ │
560 │age? should cut down on your No │ 16│ 86│ 46│
562 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
563 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
564 │ months, has there been a │ │ │ │
565 │ time when you felt you │ │ │ │
566 │ should cut down on your No │ 16│ 86│ 48│
568 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
569 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
570 │What is GENDER: months, has there been a │ │ │ │
571 │your time when people criticized No │ 16│ 86│ 46│
572 │age? your drinking? │ │ │ │
573 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
574 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
575 │ months, has there been a │ │ │ │
576 │ time when people criticized No │ 16│ 86│ 48│
577 │ your drinking? │ │ │ │
578 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
581 ╭─────────────────────────────┬────────────────────────────────────────────────╮
582 │ │S1. Including yourself, how many members of this│
583 │ │ household are age 16 or older? │
584 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
585 │ │ │ │ │ │ │ │ 6 or │
586 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
587 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
588 │ │Column│Column│Column│Column│Column│Column│Column│
589 │ │ % │ % │ % │ % │ % │ % │ % │
590 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
591 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
592 │SAMPLE How certain │ │ │ │ │ │ │ │
593 │SOURCE: likely │ │ │ │ │ │ │ │
594 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
595 │ that likely │ │ │ │ │ │ │ │
596 │ drivers │ │ │ │ │ │ │ │
597 │ who have │ │ │ │ │ │ │ │
598 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
599 │ much to likely │ │ │ │ │ │ │ │
600 │ drink to │ │ │ │ │ │ │ │
601 │ drive │ │ │ │ │ │ │ │
602 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
603 │ will A. unlikely│ │ │ │ │ │ │ │
604 │ Get │ │ │ │ │ │ │ │
605 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
606 │ by the unlikely│ │ │ │ │ │ │ │
607 │ police? │ │ │ │ │ │ │ │
608 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
611 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
614 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
615 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
616 │group typical month did you have one or more │ │ │
617 │ alcoholic beverages to drink? │ │ │
618 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
619 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
620 │ typical month did you have one or more │ │ │
621 │ alcoholic beverages to drink? │ │ │
622 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
623 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
624 │ typical month did you have one or more │ │ │
625 │ alcoholic beverages to drink? │ │ │
626 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
627 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
628 │ typical month did you have one or more │ │ │
629 │ alcoholic beverages to drink? │ │ │
630 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
631 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
632 │ typical month did you have one or more │ │ │
633 │ alcoholic beverages to drink? │ │ │
634 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
635 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
636 │ older typical month did you have one or more │ │ │
637 │ alcoholic beverages to drink? │ │ │
638 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
643 AT_SETUP([CTABLES SLABELS])
644 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
645 AT_DATA([ctables.sps],
647 CTABLES /TABLE qn1 [COUNT COLPCT].
648 CTABLES /TABLE qn1 [COUNT COLPCT]
649 /SLABELS POSITION=ROW.
650 CTABLES /TABLE qn1 [COUNT COLPCT]
651 /SLABELS POSITION=ROW VISIBLE=NO.
653 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
655 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
658 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
659 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
660 │other motor vehicle? Several days a week│ 1274│ 18.3%│
661 │ Once a week or less│ 361│ 5.2%│
662 │ Only certain times │ 130│ 1.9%│
665 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
668 ╭────────────────────────────────────────────────────────────────────────┬─────╮
669 │ 1. How often do you usually drive a car or Every day Count │ 4667│
670 │other motor vehicle? Column │66.9%│
672 │ ╶───────────────────────────┼─────┤
673 │ Several days a week Count │ 1274│
676 │ ╶───────────────────────────┼─────┤
677 │ Once a week or less Count │ 361│
680 │ ╶───────────────────────────┼─────┤
681 │ Only certain times Count │ 130│
682 │ a year Column │ 1.9%│
684 │ ╶───────────────────────────┼─────┤
688 ╰────────────────────────────────────────────────────────────────────────┴─────╯
691 ╭────────────────────────────────────────────────────────────────────────┬─────╮
692 │ 1. How often do you usually drive a car or other Every day │ 4667│
693 │motor vehicle? │66.9%│
694 │ Several days a week │ 1274│
696 │ Once a week or less │ 361│
698 │ Only certain times a │ 130│
702 ╰────────────────────────────────────────────────────────────────────────┴─────╯
706 AT_SETUP([CTABLES simple totals])
707 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
708 AT_DATA([ctables.sps],
711 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
712 DESCRIPTIVES qn18/STATISTICS=MEAN.
713 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
714 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
716 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
718 ╭────────────────────────────────────────────────────────────────────────┬─────╮
720 ├────────────────────────────────────────────────────────────────────────┼─────┤
721 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
722 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
725 │ Wine coolers │ 137│
726 │ Hard liquor or │ 888│
728 │ Flavored malt │ 83│
730 │ Number responding │ 4221│
731 ╰────────────────────────────────────────────────────────────────────────┴─────╯
733 Descriptive Statistics
734 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
736 ├────────────────────────────────────────────────────────────────────┼────┼────┤
737 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
738 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
739 │Valid N (listwise) │6999│ │
740 │Missing N (listwise) │2781│ │
741 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
744 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
746 │ │Mean│Count│ N │ N │
747 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
748 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
749 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
750 │ you usually drink per sitting? │ │ │ │ │
751 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
752 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
753 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
754 │ you usually drink per sitting? │ │ │ │ │
755 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
756 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
757 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
758 │ you usually drink per sitting? │ │ │ │ │
759 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
760 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
761 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
762 │ you usually drink per sitting? │ │ │ │ │
763 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
764 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
765 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
766 │ you usually drink per sitting? │ │ │ │ │
767 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
771 AT_SETUP([CTABLES subtotals])
772 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
773 AT_DATA([ctables.sps],
775 CTABLES /TABLE=qn105ba BY qns1
776 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
777 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
778 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
779 CTABLES /TABLE=qn105ba BY qns1
780 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
781 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
783 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
785 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
786 │ │ S1. Including yourself, how many members of this household │
787 │ │ are age 16 or older? │
788 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
789 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
790 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
791 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
792 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
793 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
794 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
795 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
796 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
797 │ likely │ │ │ │ │ │ │ │
798 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
799 │ unlikely │ │ │ │ │ │ │ │
800 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
801 │ unlikely │ │ │ │ │ │ │ │
802 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
805 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
806 │ │ S1. Including yourself, how many members of this household │
807 │ │ are age 16 or older? │
808 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
809 │ │ │ │ │ │ │ │ 6 or │
810 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
811 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
812 │ │ │ │ │ │ Column│ │ │
813 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
814 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
815 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
816 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
817 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
818 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
819 │ likely │ │ │ │ │ │ │ │
820 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
821 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
822 │ unlikely │ │ │ │ │ │ │ │
823 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
824 │ unlikely │ │ │ │ │ │ │ │
825 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
826 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
829 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
830 │ │ S1. Including yourself, how many members of this household │
831 │ │ are age 16 or older? │
832 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
833 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
834 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
835 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
836 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
837 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
838 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
839 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
840 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
841 │ likely │ │ │ │ │ │ │ │
842 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
843 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
844 │ unlikely │ │ │ │ │ │ │ │
845 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
846 │ unlikely │ │ │ │ │ │ │ │
847 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
848 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
852 AT_SETUP([CTABLES PCOMPUTE])
853 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
854 AT_DATA([ctables.sps],
857 /PCOMPUTE &x=EXPR([3] + [4])
858 /PCOMPUTE &y=EXPR([4] + [5])
859 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
860 /PPROPERTIES &y LABEL='4+5'
861 /TABLE=qn105ba BY qns1
862 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
864 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
866 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
867 │ │ S1. Including yourself, how many members of this household │
868 │ │ are age 16 or older? │
869 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
870 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
871 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
872 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
873 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
874 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
875 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
876 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
877 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
878 │ likely │ │ │ │ │ │ │ │
879 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
880 │ unlikely │ │ │ │ │ │ │ │
881 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
882 │ unlikely │ │ │ │ │ │ │ │
883 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
887 AT_SETUP([CTABLES CLABELS])
888 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
889 AT_DATA([ctables.sps],
891 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
892 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
894 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
896 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
898 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
900 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
901 │ │ 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 │
902 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
903 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
904 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
905 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
906 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
907 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
908 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
911 ╭──────────────────────────────┬────────────╮
915 ├──────────────────────────────┼────────────┤
916 │Age group 15 or younger Male │ 0│
918 │ ╶────────────────────┼────────────┤
919 │ 16 to 25 Male │ 594│
921 │ ╶────────────────────┼────────────┤
922 │ 26 to 35 Male │ 476│
924 │ ╶────────────────────┼────────────┤
925 │ 36 to 45 Male │ 489│
927 │ ╶────────────────────┼────────────┤
928 │ 46 to 55 Male │ 526│
930 │ ╶────────────────────┼────────────┤
931 │ 56 to 65 Male │ 516│
933 │ ╶────────────────────┼────────────┤
934 │ 66 or older Male │ 531│
936 ╰──────────────────────────────┴────────────╯
940 AT_SETUP([CTABLES missing values])
941 AT_DATA([ctables.sps],
942 [[DATA LIST LIST NOTABLE/x y.
981 MISSING VALUES x (1, 2) y (2, 3).
982 VARIABLE LEVEL ALL (NOMINAL).
984 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
985 /CATEGORIES VARIABLES=ALL TOTAL=YES.
986 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
987 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
988 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]]
989 /CATEGORIES VARIABLES=ALL TOTAL=YES
990 /SLABELS POSITION=ROW.
991 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]]
992 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
993 /SLABELS POSITION=ROW.
994 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
995 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
996 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
997 /SLABELS POSITION=ROW.
999 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1001 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1002 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1003 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1004 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1005 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1006 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1007 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1008 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1009 dnl Note that Column Total N % doesn't add up to 100 because missing
1010 dnl values are included in the total but not shown as a category and this
1011 dnl is expected behavior.
1014 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1015 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1016 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1017 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1018 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1019 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1020 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1021 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1022 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1023 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1024 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1025 dnl values are included in the total but not shown as a category and this
1026 dnl is expected behavior.
1029 ╭────────────────────────┬───────────────────────────╮
1031 │ ├──────┬──────┬──────┬──────┤
1032 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1033 ├────────────────────────┼──────┼──────┼──────┼──────┤
1034 │x 3.00 Count │ 1│ 1│ 1│ 3│
1035 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1036 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1037 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1038 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1039 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1040 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1041 │ Valid N │ │ │ │ 3│
1042 │ Total N │ │ │ │ 6│
1043 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1044 │ 4.00 Count │ 1│ 1│ 1│ 3│
1045 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1046 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1047 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1048 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1049 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1050 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1051 │ Valid N │ │ │ │ 3│
1052 │ Total N │ │ │ │ 6│
1053 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1054 │ 5.00 Count │ 1│ 1│ 1│ 3│
1055 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1056 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1057 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1058 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1059 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1060 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1061 │ Valid N │ │ │ │ 3│
1062 │ Total N │ │ │ │ 6│
1063 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1064 │ Total Count │ 3│ 3│ 3│ 9│
1065 │ Column % │100.0%│100.0%│100.0%│ .│
1066 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1067 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1068 │ Row % │ .│ .│ .│ .│
1069 │ Row Valid N % │ .│ .│ .│ .│
1070 │ Row Total N % │ .│ .│ .│ .│
1071 │ Valid N │ 3│ 3│ 3│ 9│
1072 │ Total N │ 6│ 6│ 6│ 36│
1073 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1076 ╭────────────────────────┬─────────────────────────────────────────╮
1078 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1079 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1080 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1081 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1082 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1083 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1084 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1085 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1086 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1087 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1088 │ Valid N │ │ │ │ │ │ 0│
1089 │ Total N │ │ │ │ │ │ 6│
1090 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1091 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1092 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1093 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1094 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1095 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1096 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1097 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1098 │ Valid N │ │ │ │ │ │ 0│
1099 │ Total N │ │ │ │ │ │ 6│
1100 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1101 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1102 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1103 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1104 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1105 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1106 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1107 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1108 │ Valid N │ │ │ │ │ │ 3│
1109 │ Total N │ │ │ │ │ │ 6│
1110 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1111 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1112 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1113 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1114 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1115 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1116 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1117 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1118 │ Valid N │ │ │ │ │ │ 3│
1119 │ Total N │ │ │ │ │ │ 6│
1120 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1121 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1122 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1123 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1124 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1125 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1126 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1127 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1128 │ Valid N │ │ │ │ │ │ 3│
1129 │ Total N │ │ │ │ │ │ 6│
1130 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1131 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1132 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1133 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1134 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1135 │ Row % │ .│ .│ .│ .│ .│ .│
1136 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1137 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1138 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1139 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1140 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1143 ╭────────────────────────┬──────────────────────────────────╮
1145 │ ├──────┬──────┬──────┬──────┬──────┤
1146 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1147 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1148 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1149 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1150 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1151 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1152 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1153 │ Row Valid N % │ .│ .│ .│ .│ .│
1154 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1155 │ Valid N │ │ │ │ │ 0│
1156 │ Total N │ │ │ │ │ 6│
1157 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1158 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1159 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1160 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1161 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1162 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1163 │ Row Valid N % │ .│ .│ .│ .│ .│
1164 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1165 │ Valid N │ │ │ │ │ 0│
1166 │ Total N │ │ │ │ │ 6│
1167 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1168 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1169 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1170 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1171 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1172 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1173 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1174 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1175 │ Valid N │ │ │ │ │ 3│
1176 │ Total N │ │ │ │ │ 6│
1177 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1178 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1179 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1180 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1181 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1182 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1183 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1184 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1185 │ Valid N │ │ │ │ │ 3│
1186 │ Total N │ │ │ │ │ 6│
1187 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1188 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1189 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1190 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1191 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1192 │ Row % │ .│ .│ .│ .│ .│
1193 │ Row Valid N % │ .│ .│ .│ .│ .│
1194 │ Row Total N % │ .│ .│ .│ .│ .│
1195 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1196 │ Total N │ 5│ 5│ 5│ 5│ 30│
1197 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1201 AT_SETUP([CTABLES SMISSING=LISTWISE])
1202 AT_KEYWORDS([SMISSING LISTWISE])
1203 AT_DATA([ctables.sps],
1204 [[DATA LIST LIST NOTABLE/x y z.
1212 VARIABLE LEVEL x (NOMINAL).
1214 CTABLES /TABLE (y + z) > x.
1215 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1217 * The following doesn't come out as listwise because the tables are
1218 separate, not linked by an > operator.
1219 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1221 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl