3 dnl Features not yet tested:
4 dnl - Preprocessing to distinguish categorical from scale.
5 dnl - Parsing (positive and negative)
6 dnl - String variables and values
7 dnl - Testing details of missing value handling in summaries.
8 dnl - test CLABELS ROWLABELS=LAYER.
10 dnl - Test WEIGHT and adjustment weights.
11 dnl - EMPTY=INCLUDE For string ranges.
12 dnl - Summary functions:
13 dnl * Separate summary functions for totals and subtotals.
14 dnl * )CILEVEL in summary label specification
18 dnl * ascending/descending
22 dnl * THRU (numeric ranges)
23 dnl * THRU (string ranges)
26 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
29 dnl - HIDESMALLCOUNTS.
30 dnl - Date/time variables and values
31 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
32 dnl - TITLES: )DATE, )TIME, )TABLE.
34 dnl * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
35 dnl * MISSING, OTHERNM
36 dnl * strings and string ranges
37 dnl * multi-dimensional (multiple CCT_POSTCOMPUTE in one cell)
41 dnl - Summary functions:
42 dnl * U-prefix for unweighted summaries.
43 dnl * areaPCT.SUM and UareaPCT.SUM functions.
44 dnl - SPLIT FILE with SEPARATE splits
45 dnl - Definition of columns/rows when labels are rotated from one axis to another.
48 dnl - Multiple response sets
49 dnl - MRSETS subcommand.
50 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
53 dnl - Summary functions:
54 dnl * .LCL and .UCL suffixes.
57 dnl * Data-dependent sorting.
61 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
62 dnl produces a bad median:
64 dnl +--------------------------+-----------------------+
65 dnl | | S3a. GENDER: |
66 dnl | +-----------+-----------+
67 dnl | | Male | Female |
68 dnl | +----+------+----+------+
69 dnl | |Mean|Median|Mean|Median|
70 dnl +--------------------------+----+------+----+------+
71 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
72 dnl +--------------------------+----+------+----+------+
76 # AT_SETUP([CTABLES parsing])
77 # AT_DATA([ctables.sps],
78 # [[DATA LIST LIST NOTABLE /x y z.
79 # CTABLES /TABLE=(x + y) > z.
80 # CTABLES /TABLE=(x[c] + y[c]) > z.
81 # CTABLES /TABLE=(x + y) > z[c].
82 # CTABLES /TABLE=x BY y BY z.
83 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
84 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
86 # AT_CHECK([pspp ctables.sps])
89 AT_SETUP([CTABLES one categorical variable])
90 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
91 AT_DATA([ctables.sps],
94 CTABLES /TABLE BY qn1.
95 CTABLES /TABLE BY BY qn1.
97 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
99 ╭────────────────────────────────────────────────────────────────────────┬─────╮
101 ├────────────────────────────────────────────────────────────────────────┼─────┤
102 │ 1. How often do you usually drive a car or other Every day │ 4667│
103 │motor vehicle? Several days a week │ 1274│
104 │ Once a week or less │ 361│
105 │ Only certain times a │ 130│
108 ╰────────────────────────────────────────────────────────────────────────┴─────╯
111 ╭──────────────────────────────────────────────────────────────────────────────╮
112 │ 1. How often do you usually drive a car or other motor vehicle? │
113 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
114 │ │ Several days a │ Once a week or │ Only certain times a │ │
115 │Every day│ week │ less │ year │Never│
116 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
117 │ Count │ Count │ Count │ Count │Count│
118 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
119 │ 4667│ 1274│ 361│ 130│ 540│
120 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
132 AT_SETUP([CTABLES one scale variable])
133 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
134 AT_DATA([ctables.sps],
136 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
137 CTABLES /TABLE BY qnd1.
138 CTABLES /TABLE BY BY qnd1.
140 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
142 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
143 │ │ │ │ │ │ Std │ │ │
144 │ │Count│Valid N│Total N│Mean│ Deviation │Minimum│Maximum│
145 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
146 │D1. AGE: What is your │ 6999│ 6930│ 6999│ 48│ 19│ 16│ 86│
147 │age? │ │ │ │ │ │ │ │
148 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
151 ╭──────────────────────────╮
152 │D1. AGE: What is your age?│
153 ├──────────────────────────┤
155 ├──────────────────────────┤
157 ╰──────────────────────────╯
160 D1. AGE: What is your age?
169 AT_SETUP([CTABLES simple stacking])
170 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
171 AT_DATA([ctables.sps],
173 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
175 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
177 ╭───────────────────────────────────────────────────────────────┬──────────────╮
184 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
185 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
186 │too much to drink to drive safely will A. Get certain │ │ │
187 │stopped by the police? Very likely │ 21%│ 22%│
188 │ Somewhat │ 38%│ 42%│
190 │ Somewhat │ 21%│ 18%│
194 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
195 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
196 │too much to drink to drive safely will B. Have an certain │ │ │
197 │accident? Very likely │ 36%│ 45%│
198 │ Somewhat │ 39%│ 32%│
204 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
205 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
206 │too much to drink to drive safely will C. Be certain │ │ │
207 │convicted for drunk driving? Very likely │ 32%│ 28%│
208 │ Somewhat │ 27%│ 32%│
210 │ Somewhat │ 15%│ 15%│
214 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
215 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
216 │too much to drink to drive safely will D. Be certain │ │ │
217 │arrested for drunk driving? Very likely │ 26%│ 27%│
218 │ Somewhat │ 32%│ 35%│
220 │ Somewhat │ 17%│ 15%│
224 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
228 AT_SETUP([CTABLES show or hide empty categories])
229 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
230 AT_DATA([ctables.sps],
232 IF (qn105ba = 2) qn105ba = 1.
233 IF (qns3a = 1) qns3a = 2.
234 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
235 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
236 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
237 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
238 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
239 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
240 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
242 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
244 ╭──────────────────────────────────────────────────────────────┬───────────────╮
251 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
252 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
253 │too much to drink to drive safely will A. Get certain │ │ │
254 │stopped by the police? Very likely│ .│ 0%│
261 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
264 ╭──────────────────────────────────────────────────────────────┬───────────────╮
271 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
272 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
273 │too much to drink to drive safely will A. Get certain │ │ │
274 │stopped by the police? Somewhat │ .│ 40%│
280 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
283 ╭────────────────────────────────────────────────────────────────────┬─────────╮
290 ├────────────────────────────────────────────────────────────────────┼─────────┤
291 │105b. How likely is it that drivers who have had too Almost │ 32%│
292 │much to drink to drive safely will A. Get stopped by certain │ │
293 │the police? Very likely │ 0%│
300 ╰────────────────────────────────────────────────────────────────────┴─────────╯
303 ╭────────────────────────────────────────────────────────────────────┬─────────╮
310 ├────────────────────────────────────────────────────────────────────┼─────────┤
311 │105b. How likely is it that drivers who have had too Almost │ 32%│
312 │much to drink to drive safely will A. Get stopped by certain │ │
313 │the police? Somewhat │ 40%│
319 ╰────────────────────────────────────────────────────────────────────┴─────────╯
323 AT_SETUP([CTABLES simple nesting])
324 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
325 AT_DATA([ctables.sps],
327 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
328 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
329 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
330 /CATEGORIES VARIABLES=qns3a TOTAL=YES
331 /CLABELS ROW=OPPOSITE.
333 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
335 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
338 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
339 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
340 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
341 │drive safely will A. Get stopped by Total │ 700│ 10%│
342 │the police? ╶──────────────────────────┼─────┼──────┤
343 │ Very S3a. Male │ 660│ 10%│
344 │ likely GENDER: Female│ 842│ 12%│
346 │ ╶──────────────────────────┼─────┼──────┤
347 │ Somewhat S3a. Male │ 1174│ 17%│
348 │ likely GENDER: Female│ 1589│ 23%│
350 │ ╶──────────────────────────┼─────┼──────┤
351 │ Somewhat S3a. Male │ 640│ 9%│
352 │ unlikely GENDER: Female│ 667│ 10%│
354 │ ╶──────────────────────────┼─────┼──────┤
355 │ Very S3a. Male │ 311│ 5%│
356 │ unlikely GENDER: Female│ 298│ 4%│
358 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
359 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
360 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
361 │drive safely will B. Have an accident? Total │ 1100│ 16%│
362 │ ╶──────────────────────────┼─────┼──────┤
363 │ Very S3a. Male │ 1104│ 16%│
364 │ likely GENDER: Female│ 1715│ 25%│
366 │ ╶──────────────────────────┼─────┼──────┤
367 │ Somewhat S3a. Male │ 1203│ 17%│
368 │ likely GENDER: Female│ 1214│ 18%│
370 │ ╶──────────────────────────┼─────┼──────┤
371 │ Somewhat S3a. Male │ 262│ 4%│
372 │ unlikely GENDER: Female│ 168│ 2%│
374 │ ╶──────────────────────────┼─────┼──────┤
375 │ Very S3a. Male │ 81│ 1%│
376 │ unlikely GENDER: Female│ 59│ 1%│
378 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
379 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
380 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
381 │drive safely will C. Be convicted for Total │ 1149│ 17%│
382 │drunk driving? ╶──────────────────────────┼─────┼──────┤
383 │ Very S3a. Male │ 988│ 14%│
384 │ likely GENDER: Female│ 1049│ 15%│
386 │ ╶──────────────────────────┼─────┼──────┤
387 │ Somewhat S3a. Male │ 822│ 12%│
388 │ likely GENDER: Female│ 1210│ 18%│
390 │ ╶──────────────────────────┼─────┼──────┤
391 │ Somewhat S3a. Male │ 446│ 7%│
392 │ unlikely GENDER: Female│ 548│ 8%│
394 │ ╶──────────────────────────┼─────┼──────┤
395 │ Very S3a. Male │ 268│ 4%│
396 │ unlikely GENDER: Female│ 354│ 5%│
398 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
399 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
400 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
401 │drive safely will D. Be arrested for Total │ 1101│ 16%│
402 │drunk driving? ╶──────────────────────────┼─────┼──────┤
403 │ Very S3a. Male │ 805│ 12%│
404 │ likely GENDER: Female│ 1029│ 15%│
406 │ ╶──────────────────────────┼─────┼──────┤
407 │ Somewhat S3a. Male │ 975│ 14%│
408 │ likely GENDER: Female│ 1332│ 19%│
410 │ ╶──────────────────────────┼─────┼──────┤
411 │ Somewhat S3a. Male │ 535│ 8%│
412 │ unlikely GENDER: Female│ 560│ 8%│
414 │ ╶──────────────────────────┼─────┼──────┤
415 │ Very S3a. Male │ 270│ 4%│
416 │ unlikely GENDER: Female│ 279│ 4%│
418 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
421 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
422 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
423 │ │ certain│likely│ likely │ unlikely│unlikely│
424 │ ├────────┼──────┼─────────┼─────────┼────────┤
426 │ │ Table %│ % │ Table % │ Table % │ Table %│
427 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
428 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
429 │GENDER: is it that drivers│ │ │ │ │ │
430 │ who have had too │ │ │ │ │ │
431 │ much to drink to │ │ │ │ │ │
432 │ drive safely will │ │ │ │ │ │
433 │ A. Get stopped by │ │ │ │ │ │
434 │ the police? │ │ │ │ │ │
435 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
436 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
437 │ is it that drivers│ │ │ │ │ │
438 │ who have had too │ │ │ │ │ │
439 │ much to drink to │ │ │ │ │ │
440 │ drive safely will │ │ │ │ │ │
441 │ A. Get stopped by │ │ │ │ │ │
442 │ the police? │ │ │ │ │ │
443 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
444 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
445 │ is it that drivers│ │ │ │ │ │
446 │ who have had too │ │ │ │ │ │
447 │ much to drink to │ │ │ │ │ │
448 │ drive safely will │ │ │ │ │ │
449 │ A. Get stopped by │ │ │ │ │ │
450 │ the police? │ │ │ │ │ │
451 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
452 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
453 │GENDER: is it that drivers│ │ │ │ │ │
454 │ who have had too │ │ │ │ │ │
455 │ much to drink to │ │ │ │ │ │
456 │ drive safely will │ │ │ │ │ │
457 │ B. Have an │ │ │ │ │ │
458 │ accident? │ │ │ │ │ │
459 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
460 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
461 │ is it that drivers│ │ │ │ │ │
462 │ who have had too │ │ │ │ │ │
463 │ much to drink to │ │ │ │ │ │
464 │ drive safely will │ │ │ │ │ │
465 │ B. Have an │ │ │ │ │ │
466 │ accident? │ │ │ │ │ │
467 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
468 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
469 │ is it that drivers│ │ │ │ │ │
470 │ who have had too │ │ │ │ │ │
471 │ much to drink to │ │ │ │ │ │
472 │ drive safely will │ │ │ │ │ │
473 │ B. Have an │ │ │ │ │ │
474 │ accident? │ │ │ │ │ │
475 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
476 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
477 │GENDER: is it that drivers│ │ │ │ │ │
478 │ who have had too │ │ │ │ │ │
479 │ much to drink to │ │ │ │ │ │
480 │ drive safely will │ │ │ │ │ │
481 │ C. Be convicted │ │ │ │ │ │
482 │ for drunk driving?│ │ │ │ │ │
483 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
484 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
485 │ is it that drivers│ │ │ │ │ │
486 │ who have had too │ │ │ │ │ │
487 │ much to drink to │ │ │ │ │ │
488 │ drive safely will │ │ │ │ │ │
489 │ C. Be convicted │ │ │ │ │ │
490 │ for drunk driving?│ │ │ │ │ │
491 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
492 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
493 │ is it that drivers│ │ │ │ │ │
494 │ who have had too │ │ │ │ │ │
495 │ much to drink to │ │ │ │ │ │
496 │ drive safely will │ │ │ │ │ │
497 │ C. Be convicted │ │ │ │ │ │
498 │ for drunk driving?│ │ │ │ │ │
499 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
500 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
501 │GENDER: is it that drivers│ │ │ │ │ │
502 │ who have had too │ │ │ │ │ │
503 │ much to drink to │ │ │ │ │ │
504 │ drive safely will │ │ │ │ │ │
505 │ D. Be arrested for│ │ │ │ │ │
506 │ drunk driving? │ │ │ │ │ │
507 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
508 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
509 │ is it that drivers│ │ │ │ │ │
510 │ who have had too │ │ │ │ │ │
511 │ much to drink to │ │ │ │ │ │
512 │ drive safely will │ │ │ │ │ │
513 │ D. Be arrested for│ │ │ │ │ │
514 │ drunk driving? │ │ │ │ │ │
515 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
516 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
517 │ is it that drivers│ │ │ │ │ │
518 │ who have had too │ │ │ │ │ │
519 │ much to drink to │ │ │ │ │ │
520 │ drive safely will │ │ │ │ │ │
521 │ D. Be arrested for│ │ │ │ │ │
522 │ drunk driving? │ │ │ │ │ │
523 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
527 AT_SETUP([CTABLES nesting and scale variables])
528 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
529 AT_DATA([ctables.sps],
531 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
532 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
533 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
534 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
535 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
537 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
539 ╭─────────────────────────────────────────────────────────────────┬────────────╮
545 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
546 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
547 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
549 │ Once a week or │ 44│ 54│
551 │ Only certain │ 34│ 41│
554 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
557 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
558 │ │Minimum│Maximum│Mean│
559 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
560 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
561 │What is GENDER: months, has there been a │ │ │ │
562 │your time when you felt you │ │ │ │
563 │age? should cut down on your No │ 16│ 86│ 46│
565 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
566 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
567 │ months, has there been a │ │ │ │
568 │ time when you felt you │ │ │ │
569 │ should cut down on your No │ 16│ 86│ 48│
571 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
572 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
573 │What is GENDER: months, has there been a │ │ │ │
574 │your time when people criticized No │ 16│ 86│ 46│
575 │age? your drinking? │ │ │ │
576 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
577 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
578 │ months, has there been a │ │ │ │
579 │ time when people criticized No │ 16│ 86│ 48│
580 │ your drinking? │ │ │ │
581 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
584 ╭─────────────────────────────┬────────────────────────────────────────────────╮
585 │ │S1. Including yourself, how many members of this│
586 │ │ household are age 16 or older? │
587 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
588 │ │ │ │ │ │ │ │ 6 or │
589 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
590 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
591 │ │Column│Column│Column│Column│Column│Column│Column│
592 │ │ % │ % │ % │ % │ % │ % │ % │
593 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
594 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
595 │SAMPLE How certain │ │ │ │ │ │ │ │
596 │SOURCE: likely │ │ │ │ │ │ │ │
597 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
598 │ that likely │ │ │ │ │ │ │ │
599 │ drivers │ │ │ │ │ │ │ │
600 │ who have │ │ │ │ │ │ │ │
601 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
602 │ much to likely │ │ │ │ │ │ │ │
603 │ drink to │ │ │ │ │ │ │ │
604 │ drive │ │ │ │ │ │ │ │
605 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
606 │ will A. unlikely│ │ │ │ │ │ │ │
607 │ Get │ │ │ │ │ │ │ │
608 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
609 │ by the unlikely│ │ │ │ │ │ │ │
610 │ police? │ │ │ │ │ │ │ │
611 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
614 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
617 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
618 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
619 │group typical month did you have one or more │ │ │
620 │ alcoholic beverages to drink? │ │ │
621 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
622 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
623 │ typical month did you have one or more │ │ │
624 │ alcoholic beverages to drink? │ │ │
625 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
626 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
627 │ typical month did you have one or more │ │ │
628 │ alcoholic beverages to drink? │ │ │
629 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
630 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
631 │ typical month did you have one or more │ │ │
632 │ alcoholic beverages to drink? │ │ │
633 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
634 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
635 │ typical month did you have one or more │ │ │
636 │ alcoholic beverages to drink? │ │ │
637 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
638 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
639 │ older typical month did you have one or more │ │ │
640 │ alcoholic beverages to drink? │ │ │
641 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
646 AT_SETUP([CTABLES SLABELS])
647 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
648 AT_DATA([ctables.sps],
650 CTABLES /TABLE qn1 [COUNT COLPCT].
651 CTABLES /TABLE qn1 [COUNT COLPCT]
652 /SLABELS POSITION=ROW.
653 CTABLES /TABLE qn1 [COUNT COLPCT]
654 /SLABELS POSITION=ROW VISIBLE=NO.
656 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
658 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
661 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
662 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
663 │other motor vehicle? Several days a week│ 1274│ 18.3%│
664 │ Once a week or less│ 361│ 5.2%│
665 │ Only certain times │ 130│ 1.9%│
668 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
671 ╭────────────────────────────────────────────────────────────────────────┬─────╮
672 │ 1. How often do you usually drive a car or Every day Count │ 4667│
673 │other motor vehicle? Column │66.9%│
675 │ ╶───────────────────────────┼─────┤
676 │ Several days a week Count │ 1274│
679 │ ╶───────────────────────────┼─────┤
680 │ Once a week or less Count │ 361│
683 │ ╶───────────────────────────┼─────┤
684 │ Only certain times Count │ 130│
685 │ a year Column │ 1.9%│
687 │ ╶───────────────────────────┼─────┤
691 ╰────────────────────────────────────────────────────────────────────────┴─────╯
694 ╭────────────────────────────────────────────────────────────────────────┬─────╮
695 │ 1. How often do you usually drive a car or other Every day │ 4667│
696 │motor vehicle? │66.9%│
697 │ Several days a week │ 1274│
699 │ Once a week or less │ 361│
701 │ Only certain times a │ 130│
705 ╰────────────────────────────────────────────────────────────────────────┴─────╯
709 AT_SETUP([CTABLES simple totals])
710 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
711 AT_DATA([ctables.sps],
714 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
715 DESCRIPTIVES qn18/STATISTICS=MEAN.
716 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
717 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
719 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
721 ╭────────────────────────────────────────────────────────────────────────┬─────╮
723 ├────────────────────────────────────────────────────────────────────────┼─────┤
724 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
725 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
728 │ Wine coolers │ 137│
729 │ Hard liquor or │ 888│
731 │ Flavored malt │ 83│
733 │ Number responding │ 4221│
734 ╰────────────────────────────────────────────────────────────────────────┴─────╯
736 Descriptive Statistics
737 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
739 ├────────────────────────────────────────────────────────────────────┼────┼────┤
740 │18. When you drink ANSWERFROM(QN17R1), about how many │4218│4.62│
741 │ANSWERFROM(QN17R2) do you usually drink per sitting? │ │ │
742 │Valid N (listwise) │6999│ │
743 │Missing N (listwise) │2781│ │
744 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
747 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
749 │ │Mean│Count│ N │ N │
750 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
751 │Region NE 18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│ 949│ 1409│
752 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
753 │ you usually drink per sitting? │ │ │ │ │
754 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
755 │ MW 18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│ 1027│ 1654│
756 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
757 │ you usually drink per sitting? │ │ │ │ │
758 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
759 │ S 18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│ 1287│ 2390│
760 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
761 │ you usually drink per sitting? │ │ │ │ │
762 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
763 │ W 18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│ 955│ 1546│
764 │ about how many ANSWERFROM(QN17R2) do │ │ │ │ │
765 │ you usually drink per sitting? │ │ │ │ │
766 │ ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
767 │ All 18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│ 4218│ 6999│
768 │ regions about how many ANSWERFROM(QN17R2) do │ │ │ │ │
769 │ you usually drink per sitting? │ │ │ │ │
770 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
774 AT_SETUP([CTABLES subtotals])
775 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
776 AT_DATA([ctables.sps],
778 CTABLES /TABLE=qn105ba BY qns1
779 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
780 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
781 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
782 CTABLES /TABLE=qn105ba BY qns1
783 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
784 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
786 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
788 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
789 │ │ S1. Including yourself, how many members of this household │
790 │ │ are age 16 or older? │
791 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
792 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
793 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
794 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
795 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
796 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
797 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
798 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
799 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
800 │ likely │ │ │ │ │ │ │ │
801 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
802 │ unlikely │ │ │ │ │ │ │ │
803 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
804 │ unlikely │ │ │ │ │ │ │ │
805 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
808 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
809 │ │ S1. Including yourself, how many members of this household │
810 │ │ are age 16 or older? │
811 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
812 │ │ │ │ │ │ │ │ 6 or │
813 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
814 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
815 │ │ │ │ │ │ Column│ │ │
816 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
817 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
818 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
819 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
820 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
821 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
822 │ likely │ │ │ │ │ │ │ │
823 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
824 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
825 │ unlikely │ │ │ │ │ │ │ │
826 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
827 │ unlikely │ │ │ │ │ │ │ │
828 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
829 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
832 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
833 │ │ S1. Including yourself, how many members of this household │
834 │ │ are age 16 or older? │
835 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
836 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
837 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
838 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
839 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
840 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
841 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
842 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
843 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
844 │ likely │ │ │ │ │ │ │ │
845 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
846 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
847 │ unlikely │ │ │ │ │ │ │ │
848 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
849 │ unlikely │ │ │ │ │ │ │ │
850 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
851 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
855 AT_SETUP([CTABLES PCOMPUTE])
856 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
857 AT_DATA([ctables.sps],
860 /PCOMPUTE &x=EXPR([3] + [4])
861 /PCOMPUTE &y=EXPR([4] + [5])
862 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES FORMAT=COUNT F8.2
863 /PPROPERTIES &y LABEL='4+5'
864 /TABLE=qn105ba BY qns1
865 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
867 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
869 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
870 │ │ S1. Including yourself, how many members of this household │
871 │ │ are age 16 or older? │
872 │ ├───────┬───────┬──────────┬───────┬────────┬──────┬──────────┤
873 │ │ 1 │ 2 │ Subtotal │ 5 │ 3+4 │ 4+5 │ Subtotal │
874 │ ├───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
875 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
876 ├────────────────────────────────────────────────────────┼───────┼───────┼──────────┼───────┼────────┼──────┼──────────┤
877 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81.00│ 30│ 92│
878 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
879 │A. Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171.00│ 65│ 185│
880 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265.00│ 92│ 285│
881 │ likely │ │ │ │ │ │ │ │
882 │ Somewhat │ 278│ 647│ 925│ 6│ 116.00│ 38│ 122│
883 │ unlikely │ │ │ │ │ │ │ │
884 │ Very │ 141│ 290│ 431│ 4│ 59.00│ 22│ 63│
885 │ unlikely │ │ │ │ │ │ │ │
886 ╰────────────────────────────────────────────────────────┴───────┴───────┴──────────┴───────┴────────┴──────┴──────────╯
890 AT_SETUP([CTABLES CLABELS])
891 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
892 AT_DATA([ctables.sps],
894 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
895 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
897 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
899 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
901 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
903 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
904 │ │ 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 │
905 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
906 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
907 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
908 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
909 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
910 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
911 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
914 ╭──────────────────────────────┬────────────╮
918 ├──────────────────────────────┼────────────┤
919 │Age group 15 or younger Male │ 0│
921 │ ╶────────────────────┼────────────┤
922 │ 16 to 25 Male │ 594│
924 │ ╶────────────────────┼────────────┤
925 │ 26 to 35 Male │ 476│
927 │ ╶────────────────────┼────────────┤
928 │ 36 to 45 Male │ 489│
930 │ ╶────────────────────┼────────────┤
931 │ 46 to 55 Male │ 526│
933 │ ╶────────────────────┼────────────┤
934 │ 56 to 65 Male │ 516│
936 │ ╶────────────────────┼────────────┤
937 │ 66 or older Male │ 531│
939 ╰──────────────────────────────┴────────────╯
943 AT_SETUP([CTABLES missing values])
944 AT_DATA([ctables.sps],
945 [[DATA LIST LIST NOTABLE/x y.
984 MISSING VALUES x (1, 2) y (2, 3).
985 VARIABLE LEVEL ALL (NOMINAL).
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.
989 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
990 /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
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
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=ALL TOTAL=YES MISSING=INCLUDE
996 /SLABELS POSITION=ROW.
997 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]]
998 /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES
999 /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES
1000 /SLABELS POSITION=ROW.
1002 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1004 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1005 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1006 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1007 │x 3.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1008 │ 4.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1009 │ 5.00 │ 6│ 33.3%│ 33.3%│ 16.7%│ │ │
1010 │ Total│ 18│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1011 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1012 dnl Note that Column Total N % doesn't add up to 100 because missing
1013 dnl values are included in the total but not shown as a category and this
1014 dnl is expected behavior.
1017 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
1018 │ │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
1019 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
1020 │x 1.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1021 │ 2.00 │ 6│ 20.0%│ .0%│ 16.7%│ │ │
1022 │ 3.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1023 │ 4.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1024 │ 5.00 │ 6│ 20.0%│ 33.3%│ 16.7%│ │ │
1025 │ Total│ 30│ 100.0%│ 100.0%│ 100.0%│ 18│ 36│
1026 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
1027 dnl Note that Column Total N % doesn't add up to 100 because system-missing
1028 dnl values are included in the total but not shown as a category and this
1029 dnl is expected behavior.
1032 ╭────────────────────────┬───────────────────────────╮
1034 │ ├──────┬──────┬──────┬──────┤
1035 │ │ 1.00 │ 4.00 │ 5.00 │ Total│
1036 ├────────────────────────┼──────┼──────┼──────┼──────┤
1037 │x 3.00 Count │ 1│ 1│ 1│ 3│
1038 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1039 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1040 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1041 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1042 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1043 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1044 │ Valid N │ │ │ │ 3│
1045 │ Total N │ │ │ │ 6│
1046 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1047 │ 4.00 Count │ 1│ 1│ 1│ 3│
1048 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1049 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1050 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1051 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1052 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1053 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1054 │ Valid N │ │ │ │ 3│
1055 │ Total N │ │ │ │ 6│
1056 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1057 │ 5.00 Count │ 1│ 1│ 1│ 3│
1058 │ Column % │ 33.3%│ 33.3%│ 33.3%│ .│
1059 │ Column Valid N %│ 33.3%│ 33.3%│ 33.3%│ .│
1060 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ .│
1061 │ Row % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1062 │ Row Valid N % │ 33.3%│ 33.3%│ 33.3%│100.0%│
1063 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│100.0%│
1064 │ Valid N │ │ │ │ 3│
1065 │ Total N │ │ │ │ 6│
1066 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
1067 │ Total Count │ 3│ 3│ 3│ 9│
1068 │ Column % │100.0%│100.0%│100.0%│ .│
1069 │ Column Valid N %│100.0%│100.0%│100.0%│ .│
1070 │ Column Total N %│100.0%│100.0%│100.0%│ .│
1071 │ Row % │ .│ .│ .│ .│
1072 │ Row Valid N % │ .│ .│ .│ .│
1073 │ Row Total N % │ .│ .│ .│ .│
1074 │ Valid N │ 3│ 3│ 3│ 9│
1075 │ Total N │ 6│ 6│ 6│ 36│
1076 ╰────────────────────────┴──────┴──────┴──────┴──────╯
1079 ╭────────────────────────┬─────────────────────────────────────────╮
1081 │ ├──────┬──────┬──────┬──────┬──────┬──────┤
1082 │ │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1083 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1084 │x 1.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1085 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1086 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1087 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1088 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1089 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1090 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1091 │ Valid N │ │ │ │ │ │ 0│
1092 │ Total N │ │ │ │ │ │ 6│
1093 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1094 │ 2.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1095 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1096 │ Column Valid N %│ .0%│ .│ .│ .0%│ .0%│ .│
1097 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1098 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1099 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1100 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1101 │ Valid N │ │ │ │ │ │ 0│
1102 │ Total N │ │ │ │ │ │ 6│
1103 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1104 │ 3.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1105 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1106 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1107 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1108 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1109 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1110 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1111 │ Valid N │ │ │ │ │ │ 3│
1112 │ Total N │ │ │ │ │ │ 6│
1113 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1114 │ 4.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1115 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1116 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1117 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1118 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1119 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1120 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1121 │ Valid N │ │ │ │ │ │ 3│
1122 │ Total N │ │ │ │ │ │ 6│
1123 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1124 │ 5.00 Count │ 1│ 1│ 1│ 1│ 1│ 5│
1125 │ Column % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1126 │ Column Valid N %│ 33.3%│ .│ .│ 33.3%│ 33.3%│ .│
1127 │ Column Total N %│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│ .│
1128 │ Row % │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
1129 │ Row Valid N % │ 33.3%│ .0%│ .0%│ 33.3%│ 33.3%│100.0%│
1130 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1131 │ Valid N │ │ │ │ │ │ 3│
1132 │ Total N │ │ │ │ │ │ 6│
1133 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
1134 │ Total Count │ 5│ 5│ 5│ 5│ 5│ 25│
1135 │ Column % │100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1136 │ Column Valid N %│100.0%│ .│ .│100.0%│100.0%│ .│
1137 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│ .│
1138 │ Row % │ .│ .│ .│ .│ .│ .│
1139 │ Row Valid N % │ .│ .│ .│ .│ .│ .│
1140 │ Row Total N % │ .│ .│ .│ .│ .│ .│
1141 │ Valid N │ 3│ 0│ 0│ 3│ 3│ 9│
1142 │ Total N │ 6│ 6│ 6│ 6│ 6│ 36│
1143 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
1146 ╭────────────────────────┬──────────────────────────────────╮
1148 │ ├──────┬──────┬──────┬──────┬──────┤
1149 │ │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
1150 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
1151 │x 1.00 Count │ 1│ 1│ 1│ 1│ 4│
1152 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1153 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1154 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1155 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1156 │ Row Valid N % │ .│ .│ .│ .│ .│
1157 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1158 │ Valid N │ │ │ │ │ 0│
1159 │ Total N │ │ │ │ │ 6│
1160 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1161 │ 2.00 Count │ 1│ 1│ 1│ 1│ 4│
1162 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1163 │ Column Valid N %│ .0%│ .│ .0%│ .0%│ .│
1164 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1165 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1166 │ Row Valid N % │ .│ .│ .│ .│ .│
1167 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1168 │ Valid N │ │ │ │ │ 0│
1169 │ Total N │ │ │ │ │ 6│
1170 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1171 │ 3.00 Count │ 1│ 1│ 1│ 1│ 4│
1172 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1173 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1174 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1175 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1176 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1177 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1178 │ Valid N │ │ │ │ │ 3│
1179 │ Total N │ │ │ │ │ 6│
1180 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1181 │ 4.00 Count │ 1│ 1│ 1│ 1│ 4│
1182 │ Column % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│ .│
1183 │ Column Valid N %│ 50.0%│ .│ 50.0%│ 50.0%│ .│
1184 │ Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ .│
1185 │ Row % │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
1186 │ Row Valid N % │ 33.3%│ .0%│ 33.3%│ 33.3%│100.0%│
1187 │ Row Total N % │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
1188 │ Valid N │ │ │ │ │ 3│
1189 │ Total N │ │ │ │ │ 6│
1190 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
1191 │ Total Count │ 4│ 4│ 4│ 4│ 16│
1192 │ Column % │100.0%│100.0%│100.0%│100.0%│ .│
1193 │ Column Valid N %│100.0%│ .│100.0%│100.0%│ .│
1194 │ Column Total N %│100.0%│100.0%│100.0%│100.0%│ .│
1195 │ Row % │ .│ .│ .│ .│ .│
1196 │ Row Valid N % │ .│ .│ .│ .│ .│
1197 │ Row Total N % │ .│ .│ .│ .│ .│
1198 │ Valid N │ 2│ 0│ 2│ 2│ 6│
1199 │ Total N │ 5│ 5│ 5│ 5│ 30│
1200 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
1204 AT_SETUP([CTABLES SMISSING=LISTWISE])
1205 AT_KEYWORDS([SMISSING LISTWISE])
1206 AT_DATA([ctables.sps],
1207 [[DATA LIST LIST NOTABLE/x y z.
1215 VARIABLE LEVEL x (NOMINAL).
1217 CTABLES /TABLE (y + z) > x.
1218 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
1220 * The following doesn't come out as listwise because the tables are
1221 separate, not linked by an > operator.
1222 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
1224 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl