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.
15 dnl * Separate summary functions for totals and subtotals.
19 dnl * Data-dependent sorting.
20 dnl - TITLES: )DATE, )TIME, )TABLE.
21 dnl - SMISSING (see documentation).
23 dnl * multi-dimensional
24 dnl * MISSING, OTHERNM
28 dnl * summary statistics and formats?
29 dnl - Are string ranges a thing?
31 dnl Features not yet tested:
32 dnl - Parsing (positive and negative)
33 dnl - String variables and values
34 dnl - Testing details of missing value handling in summaries.
35 dnl - test CLABELS ROWLABELS=LAYER.
37 dnl - Test WEIGHT and adjustment weights.
38 dnl - Test PCOMPUTE and PPROPERTIES.
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, 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 │ │Count│Mean│Std Deviation│Minimum│Maximum│
141 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
142 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
143 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
146 ╭──────────────────────────╮
147 │D1. AGE: What is your age?│
148 ├──────────────────────────┤
150 ├──────────────────────────┤
152 ╰──────────────────────────╯
155 D1. AGE: What is your age?
164 AT_SETUP([CTABLES simple stacking])
165 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
166 AT_DATA([ctables.sps],
168 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
170 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
172 ╭───────────────────────────────────────────────────────────────┬──────────────╮
179 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
180 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
181 │too much to drink to drive safely will A. Get certain │ │ │
182 │stopped by the police? Very likely │ 21%│ 22%│
183 │ Somewhat │ 38%│ 42%│
185 │ Somewhat │ 21%│ 18%│
189 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
190 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
191 │too much to drink to drive safely will B. Have an certain │ │ │
192 │accident? Very likely │ 36%│ 45%│
193 │ Somewhat │ 39%│ 32%│
199 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
200 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
201 │too much to drink to drive safely will C. Be certain │ │ │
202 │convicted for drunk driving? Very likely │ 32%│ 28%│
203 │ Somewhat │ 27%│ 32%│
205 │ Somewhat │ 15%│ 15%│
209 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
210 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
211 │too much to drink to drive safely will D. Be certain │ │ │
212 │arrested for drunk driving? Very likely │ 26%│ 27%│
213 │ Somewhat │ 32%│ 35%│
215 │ Somewhat │ 17%│ 15%│
219 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
223 AT_SETUP([CTABLES show or hide empty categories])
224 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
225 AT_DATA([ctables.sps],
227 IF (qn105ba = 2) qn105ba = 1.
228 IF (qns3a = 1) qns3a = 2.
229 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
230 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
231 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
232 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
233 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
234 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
235 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
237 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
239 ╭──────────────────────────────────────────────────────────────┬───────────────╮
246 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
247 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
248 │too much to drink to drive safely will A. Get certain │ │ │
249 │stopped by the police? Very likely│ .│ 0%│
256 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
259 ╭──────────────────────────────────────────────────────────────┬───────────────╮
266 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
267 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
268 │too much to drink to drive safely will A. Get certain │ │ │
269 │stopped by the police? Somewhat │ .│ 40%│
275 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
278 ╭────────────────────────────────────────────────────────────────────┬─────────╮
285 ├────────────────────────────────────────────────────────────────────┼─────────┤
286 │105b. How likely is it that drivers who have had too Almost │ 32%│
287 │much to drink to drive safely will A. Get stopped by certain │ │
288 │the police? Very likely │ 0%│
295 ╰────────────────────────────────────────────────────────────────────┴─────────╯
298 ╭────────────────────────────────────────────────────────────────────┬─────────╮
305 ├────────────────────────────────────────────────────────────────────┼─────────┤
306 │105b. How likely is it that drivers who have had too Almost │ 32%│
307 │much to drink to drive safely will A. Get stopped by certain │ │
308 │the police? Somewhat │ 40%│
314 ╰────────────────────────────────────────────────────────────────────┴─────────╯
318 AT_SETUP([CTABLES simple nesting])
319 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
320 AT_DATA([ctables.sps],
322 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
323 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
324 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
325 /CATEGORIES VARIABLES=qns3a TOTAL=YES
326 /CLABELS ROW=OPPOSITE.
328 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
330 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
333 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
334 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
335 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
336 │drive safely will A. Get stopped by Total │ 700│ 10%│
337 │the police? ╶──────────────────────────┼─────┼──────┤
338 │ Very S3a. Male │ 660│ 10%│
339 │ likely GENDER: Female│ 842│ 12%│
341 │ ╶──────────────────────────┼─────┼──────┤
342 │ Somewhat S3a. Male │ 1174│ 17%│
343 │ likely GENDER: Female│ 1589│ 23%│
345 │ ╶──────────────────────────┼─────┼──────┤
346 │ Somewhat S3a. Male │ 640│ 9%│
347 │ unlikely GENDER: Female│ 667│ 10%│
349 │ ╶──────────────────────────┼─────┼──────┤
350 │ Very S3a. Male │ 311│ 5%│
351 │ unlikely GENDER: Female│ 298│ 4%│
353 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
354 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
355 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
356 │drive safely will B. Have an accident? Total │ 1100│ 16%│
357 │ ╶──────────────────────────┼─────┼──────┤
358 │ Very S3a. Male │ 1104│ 16%│
359 │ likely GENDER: Female│ 1715│ 25%│
361 │ ╶──────────────────────────┼─────┼──────┤
362 │ Somewhat S3a. Male │ 1203│ 17%│
363 │ likely GENDER: Female│ 1214│ 18%│
365 │ ╶──────────────────────────┼─────┼──────┤
366 │ Somewhat S3a. Male │ 262│ 4%│
367 │ unlikely GENDER: Female│ 168│ 2%│
369 │ ╶──────────────────────────┼─────┼──────┤
370 │ Very S3a. Male │ 81│ 1%│
371 │ unlikely GENDER: Female│ 59│ 1%│
373 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
374 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
375 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
376 │drive safely will C. Be convicted for Total │ 1149│ 17%│
377 │drunk driving? ╶──────────────────────────┼─────┼──────┤
378 │ Very S3a. Male │ 988│ 14%│
379 │ likely GENDER: Female│ 1049│ 15%│
381 │ ╶──────────────────────────┼─────┼──────┤
382 │ Somewhat S3a. Male │ 822│ 12%│
383 │ likely GENDER: Female│ 1210│ 18%│
385 │ ╶──────────────────────────┼─────┼──────┤
386 │ Somewhat S3a. Male │ 446│ 7%│
387 │ unlikely GENDER: Female│ 548│ 8%│
389 │ ╶──────────────────────────┼─────┼──────┤
390 │ Very S3a. Male │ 268│ 4%│
391 │ unlikely GENDER: Female│ 354│ 5%│
393 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
394 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
395 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
396 │drive safely will D. Be arrested for Total │ 1101│ 16%│
397 │drunk driving? ╶──────────────────────────┼─────┼──────┤
398 │ Very S3a. Male │ 805│ 12%│
399 │ likely GENDER: Female│ 1029│ 15%│
401 │ ╶──────────────────────────┼─────┼──────┤
402 │ Somewhat S3a. Male │ 975│ 14%│
403 │ likely GENDER: Female│ 1332│ 19%│
405 │ ╶──────────────────────────┼─────┼──────┤
406 │ Somewhat S3a. Male │ 535│ 8%│
407 │ unlikely GENDER: Female│ 560│ 8%│
409 │ ╶──────────────────────────┼─────┼──────┤
410 │ Very S3a. Male │ 270│ 4%│
411 │ unlikely GENDER: Female│ 279│ 4%│
413 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
416 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
417 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
418 │ │ certain│likely│ likely │ unlikely│unlikely│
419 │ ├────────┼──────┼─────────┼─────────┼────────┤
421 │ │ Table %│ % │ Table % │ Table % │ Table %│
422 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
423 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
424 │GENDER: is it that drivers│ │ │ │ │ │
425 │ who have had too │ │ │ │ │ │
426 │ much to drink to │ │ │ │ │ │
427 │ drive safely will │ │ │ │ │ │
428 │ A. Get stopped by │ │ │ │ │ │
429 │ the police? │ │ │ │ │ │
430 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
431 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
432 │ is it that drivers│ │ │ │ │ │
433 │ who have had too │ │ │ │ │ │
434 │ much to drink to │ │ │ │ │ │
435 │ drive safely will │ │ │ │ │ │
436 │ A. Get stopped by │ │ │ │ │ │
437 │ the police? │ │ │ │ │ │
438 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
439 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
440 │ is it that drivers│ │ │ │ │ │
441 │ who have had too │ │ │ │ │ │
442 │ much to drink to │ │ │ │ │ │
443 │ drive safely will │ │ │ │ │ │
444 │ A. Get stopped by │ │ │ │ │ │
445 │ the police? │ │ │ │ │ │
446 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
447 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
448 │GENDER: is it that drivers│ │ │ │ │ │
449 │ who have had too │ │ │ │ │ │
450 │ much to drink to │ │ │ │ │ │
451 │ drive safely will │ │ │ │ │ │
452 │ B. Have an │ │ │ │ │ │
453 │ accident? │ │ │ │ │ │
454 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
455 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
456 │ is it that drivers│ │ │ │ │ │
457 │ who have had too │ │ │ │ │ │
458 │ much to drink to │ │ │ │ │ │
459 │ drive safely will │ │ │ │ │ │
460 │ B. Have an │ │ │ │ │ │
461 │ accident? │ │ │ │ │ │
462 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
463 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
464 │ is it that drivers│ │ │ │ │ │
465 │ who have had too │ │ │ │ │ │
466 │ much to drink to │ │ │ │ │ │
467 │ drive safely will │ │ │ │ │ │
468 │ B. Have an │ │ │ │ │ │
469 │ accident? │ │ │ │ │ │
470 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
471 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
472 │GENDER: is it that drivers│ │ │ │ │ │
473 │ who have had too │ │ │ │ │ │
474 │ much to drink to │ │ │ │ │ │
475 │ drive safely will │ │ │ │ │ │
476 │ C. Be convicted │ │ │ │ │ │
477 │ for drunk driving?│ │ │ │ │ │
478 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
479 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
480 │ is it that drivers│ │ │ │ │ │
481 │ who have had too │ │ │ │ │ │
482 │ much to drink to │ │ │ │ │ │
483 │ drive safely will │ │ │ │ │ │
484 │ C. Be convicted │ │ │ │ │ │
485 │ for drunk driving?│ │ │ │ │ │
486 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
487 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
488 │ is it that drivers│ │ │ │ │ │
489 │ who have had too │ │ │ │ │ │
490 │ much to drink to │ │ │ │ │ │
491 │ drive safely will │ │ │ │ │ │
492 │ C. Be convicted │ │ │ │ │ │
493 │ for drunk driving?│ │ │ │ │ │
494 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
495 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
496 │GENDER: is it that drivers│ │ │ │ │ │
497 │ who have had too │ │ │ │ │ │
498 │ much to drink to │ │ │ │ │ │
499 │ drive safely will │ │ │ │ │ │
500 │ D. Be arrested for│ │ │ │ │ │
501 │ drunk driving? │ │ │ │ │ │
502 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
503 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
504 │ is it that drivers│ │ │ │ │ │
505 │ who have had too │ │ │ │ │ │
506 │ much to drink to │ │ │ │ │ │
507 │ drive safely will │ │ │ │ │ │
508 │ D. Be arrested for│ │ │ │ │ │
509 │ drunk driving? │ │ │ │ │ │
510 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
511 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
512 │ is it that drivers│ │ │ │ │ │
513 │ who have had too │ │ │ │ │ │
514 │ much to drink to │ │ │ │ │ │
515 │ drive safely will │ │ │ │ │ │
516 │ D. Be arrested for│ │ │ │ │ │
517 │ drunk driving? │ │ │ │ │ │
518 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
522 AT_SETUP([CTABLES nesting and scale variables])
523 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
524 AT_DATA([ctables.sps],
526 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
527 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
528 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
529 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
530 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
532 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
534 ╭─────────────────────────────────────────────────────────────────┬────────────╮
540 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
541 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
542 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
544 │ Once a week or │ 44│ 54│
546 │ Only certain │ 34│ 41│
549 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
552 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
553 │ │Minimum│Maximum│Mean│
554 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
555 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
556 │What is GENDER: months, has there been a │ │ │ │
557 │your time when you felt you │ │ │ │
558 │age? should cut down on your No │ 16│ 86│ 46│
560 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
561 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
562 │ months, has there been a │ │ │ │
563 │ time when you felt you │ │ │ │
564 │ should cut down on your No │ 16│ 86│ 48│
566 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
567 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
568 │What is GENDER: months, has there been a │ │ │ │
569 │your time when people criticized No │ 16│ 86│ 46│
570 │age? your drinking? │ │ │ │
571 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
572 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
573 │ months, has there been a │ │ │ │
574 │ time when people criticized No │ 16│ 86│ 48│
575 │ your drinking? │ │ │ │
576 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
579 ╭─────────────────────────────┬────────────────────────────────────────────────╮
580 │ │S1. Including yourself, how many members of this│
581 │ │ household are age 16 or older? │
582 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
583 │ │ │ │ │ │ │ │ 6 or │
584 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
585 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
586 │ │Column│Column│Column│Column│Column│Column│Column│
587 │ │ % │ % │ % │ % │ % │ % │ % │
588 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
589 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
590 │SAMPLE How certain │ │ │ │ │ │ │ │
591 │SOURCE: likely │ │ │ │ │ │ │ │
592 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
593 │ that likely │ │ │ │ │ │ │ │
594 │ drivers │ │ │ │ │ │ │ │
595 │ who have │ │ │ │ │ │ │ │
596 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
597 │ much to likely │ │ │ │ │ │ │ │
598 │ drink to │ │ │ │ │ │ │ │
599 │ drive │ │ │ │ │ │ │ │
600 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
601 │ will A. unlikely│ │ │ │ │ │ │ │
602 │ Get │ │ │ │ │ │ │ │
603 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
604 │ by the unlikely│ │ │ │ │ │ │ │
605 │ police? │ │ │ │ │ │ │ │
606 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
609 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
612 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
613 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
614 │group typical month did you have one or more │ │ │
615 │ alcoholic beverages to drink? │ │ │
616 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
617 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
618 │ typical month did you have one or more │ │ │
619 │ alcoholic beverages to drink? │ │ │
620 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
621 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
622 │ typical month did you have one or more │ │ │
623 │ alcoholic beverages to drink? │ │ │
624 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
625 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
626 │ typical month did you have one or more │ │ │
627 │ alcoholic beverages to drink? │ │ │
628 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
629 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
630 │ typical month did you have one or more │ │ │
631 │ alcoholic beverages to drink? │ │ │
632 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
633 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
634 │ older typical month did you have one or more │ │ │
635 │ alcoholic beverages to drink? │ │ │
636 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
641 AT_SETUP([CTABLES SLABELS])
642 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
643 AT_DATA([ctables.sps],
645 CTABLES /TABLE qn1 [COUNT COLPCT].
646 CTABLES /TABLE qn1 [COUNT COLPCT]
647 /SLABELS POSITION=ROW.
648 CTABLES /TABLE qn1 [COUNT COLPCT]
649 /SLABELS POSITION=ROW VISIBLE=NO.
651 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
653 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
656 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
657 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
658 │other motor vehicle? Several days a week│ 1274│ 18.3%│
659 │ Once a week or less│ 361│ 5.2%│
660 │ Only certain times │ 130│ 1.9%│
663 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
666 ╭────────────────────────────────────────────────────────────────────────┬─────╮
667 │ 1. How often do you usually drive a car or Every day Count │ 4667│
668 │other motor vehicle? Column │66.9%│
670 │ ╶───────────────────────────┼─────┤
671 │ Several days a week Count │ 1274│
674 │ ╶───────────────────────────┼─────┤
675 │ Once a week or less Count │ 361│
678 │ ╶───────────────────────────┼─────┤
679 │ Only certain times Count │ 130│
680 │ a year Column │ 1.9%│
682 │ ╶───────────────────────────┼─────┤
686 ╰────────────────────────────────────────────────────────────────────────┴─────╯
689 ╭────────────────────────────────────────────────────────────────────────┬─────╮
690 │ 1. How often do you usually drive a car or other Every day │ 4667│
691 │motor vehicle? │66.9%│
692 │ Several days a week │ 1274│
694 │ Once a week or less │ 361│
696 │ Only certain times a │ 130│
700 ╰────────────────────────────────────────────────────────────────────────┴─────╯
704 AT_SETUP([CTABLES simple totals])
705 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
706 AT_DATA([ctables.sps],
709 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
710 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
711 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
713 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
715 ╭────────────────────────────────────────────────────────────────────────┬─────╮
717 ├────────────────────────────────────────────────────────────────────────┼─────┤
718 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
719 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
722 │ Wine coolers │ 137│
723 │ Hard liquor or │ 888│
725 │ Flavored malt │ 83│
727 │ Number responding │ 4221│
728 ╰────────────────────────────────────────────────────────────────────────┴─────╯
731 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
733 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
734 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
735 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
737 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
738 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
739 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
741 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
742 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
743 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
745 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
746 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
747 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
749 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
750 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
751 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
753 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
757 AT_SETUP([CTABLES subtotals])
758 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
759 AT_DATA([ctables.sps],
761 CTABLES /TABLE=qn105ba BY qns1
762 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
763 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
764 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
765 CTABLES /TABLE=qn105ba BY qns1
766 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
767 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
769 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
771 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
772 │ │ S1. Including yourself, how many members of this household │
773 │ │ are age 16 or older? │
774 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
775 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
776 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
777 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
778 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
779 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
780 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
781 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
782 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
783 │ likely │ │ │ │ │ │ │ │
784 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
785 │ unlikely │ │ │ │ │ │ │ │
786 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
787 │ unlikely │ │ │ │ │ │ │ │
788 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
791 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
792 │ │ S1. Including yourself, how many members of this household │
793 │ │ are age 16 or older? │
794 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
795 │ │ │ │ │ │ │ │ 6 or │
796 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
797 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
798 │ │ │ │ │ │ Column│ │ │
799 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
800 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
801 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
802 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
803 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
804 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
805 │ likely │ │ │ │ │ │ │ │
806 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
807 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
808 │ unlikely │ │ │ │ │ │ │ │
809 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
810 │ unlikely │ │ │ │ │ │ │ │
811 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
812 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
815 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
816 │ │ S1. Including yourself, how many members of this household │
817 │ │ are age 16 or older? │
818 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
819 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
820 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
821 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
822 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
823 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
824 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
825 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
826 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
827 │ likely │ │ │ │ │ │ │ │
828 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
829 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
830 │ unlikely │ │ │ │ │ │ │ │
831 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
832 │ unlikely │ │ │ │ │ │ │ │
833 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
834 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
838 AT_SETUP([CTABLES PCOMPUTE])
839 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
840 AT_DATA([ctables.sps],
843 /PCOMPUTE &x=EXPR([3] + [4])
844 /PCOMPUTE &y=EXPR([4] + [5])
845 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
846 /PPROPERTIES &y LABEL='4+5'
847 /TABLE=qn105ba BY qns1
848 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
850 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
852 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
853 │ │ S1. Including yourself, how many members of this household │
854 │ │ are age 16 or older? │
855 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
856 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
857 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
858 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
859 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
860 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
861 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
862 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
863 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
864 │ likely │ │ │ │ │ │ │ │
865 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
866 │ unlikely │ │ │ │ │ │ │ │
867 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
868 │ unlikely │ │ │ │ │ │ │ │
869 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
873 AT_SETUP([CTABLES CLABELS])
874 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
875 AT_DATA([ctables.sps],
877 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
878 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
880 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
882 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
884 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
886 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
887 │ │ 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 │
888 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
889 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
890 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
891 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
892 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
893 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
894 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
897 ╭──────────────────────────────┬────────────╮
901 ├──────────────────────────────┼────────────┤
902 │Age group 15 or younger Male │ 0│
904 │ ╶────────────────────┼────────────┤
905 │ 16 to 25 Male │ 594│
907 │ ╶────────────────────┼────────────┤
908 │ 26 to 35 Male │ 476│
910 │ ╶────────────────────┼────────────┤
911 │ 36 to 45 Male │ 489│
913 │ ╶────────────────────┼────────────┤
914 │ 46 to 55 Male │ 526│
916 │ ╶────────────────────┼────────────┤
917 │ 56 to 65 Male │ 516│
919 │ ╶────────────────────┼────────────┤
920 │ 66 or older Male │ 531│
922 ╰──────────────────────────────┴────────────╯