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.
20 dnl - SMISSING (see documentation).
22 dnl * multi-dimensional
23 dnl * MISSING, OTHERNM
27 dnl * summary statistics and formats?
28 dnl - Are string ranges a thing?
30 dnl Features not yet tested:
31 dnl - Parsing (positive and negative)
32 dnl - String variables and values
33 dnl - Testing details of missing value handling in summaries.
34 dnl - test CLABELS ROWLABELS=LAYER.
36 dnl - Test WEIGHT and adjustment weights.
37 dnl - Test PCOMPUTE and PPROPERTIES.
38 dnl - Summary functions:
39 dnl * Separate summary functions for totals and subtotals.
44 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
47 dnl - HIDESMALLCOUNTS.
48 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
51 dnl - Multiple response sets
52 dnl - MRSETS subcommand.
53 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
59 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
60 dnl produces a bad median:
62 dnl +--------------------------+-----------------------+
63 dnl | | S3a. GENDER: |
64 dnl | +-----------+-----------+
65 dnl | | Male | Female |
66 dnl | +----+------+----+------+
67 dnl | |Mean|Median|Mean|Median|
68 dnl +--------------------------+----+------+----+------+
69 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
70 dnl +--------------------------+----+------+----+------+
74 # AT_SETUP([CTABLES parsing])
75 # AT_DATA([ctables.sps],
76 # [[DATA LIST LIST NOTABLE /x y z.
77 # CTABLES /TABLE=(x + y) > z.
78 # CTABLES /TABLE=(x[c] + y[c]) > z.
79 # CTABLES /TABLE=(x + y) > z[c].
80 # CTABLES /TABLE=x BY y BY z.
81 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
82 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
84 # AT_CHECK([pspp ctables.sps])
87 AT_SETUP([CTABLES one categorical variable])
88 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
89 AT_DATA([ctables.sps],
92 CTABLES /TABLE BY qn1.
93 CTABLES /TABLE BY BY qn1.
95 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
97 ╭────────────────────────────────────────────────────────────────────────┬─────╮
99 ├────────────────────────────────────────────────────────────────────────┼─────┤
100 │ 1. How often do you usually drive a car or other Every day │ 4667│
101 │motor vehicle? Several days a week │ 1274│
102 │ Once a week or less │ 361│
103 │ Only certain times a │ 130│
106 ╰────────────────────────────────────────────────────────────────────────┴─────╯
109 ╭──────────────────────────────────────────────────────────────────────────────╮
110 │ 1. How often do you usually drive a car or other motor vehicle? │
111 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
112 │ │ Several days a │ Once a week or │ Only certain times a │ │
113 │Every day│ week │ less │ year │Never│
114 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
115 │ Count │ Count │ Count │ Count │Count│
116 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
117 │ 4667│ 1274│ 361│ 130│ 540│
118 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
130 AT_SETUP([CTABLES one scale variable])
131 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
132 AT_DATA([ctables.sps],
134 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
135 CTABLES /TABLE BY qnd1.
136 CTABLES /TABLE BY BY qnd1.
138 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
140 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
141 │ │Count│Mean│Std Deviation│Minimum│Maximum│
142 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
143 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
144 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
147 ╭──────────────────────────╮
148 │D1. AGE: What is your age?│
149 ├──────────────────────────┤
151 ├──────────────────────────┤
153 ╰──────────────────────────╯
156 D1. AGE: What is your age?
165 AT_SETUP([CTABLES simple stacking])
166 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
167 AT_DATA([ctables.sps],
169 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
171 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
173 ╭───────────────────────────────────────────────────────────────┬──────────────╮
180 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
181 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
182 │too much to drink to drive safely will A. Get certain │ │ │
183 │stopped by the police? Very likely │ 21%│ 22%│
184 │ Somewhat │ 38%│ 42%│
186 │ Somewhat │ 21%│ 18%│
190 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
191 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
192 │too much to drink to drive safely will B. Have an certain │ │ │
193 │accident? Very likely │ 36%│ 45%│
194 │ Somewhat │ 39%│ 32%│
200 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
201 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
202 │too much to drink to drive safely will C. Be certain │ │ │
203 │convicted for drunk driving? Very likely │ 32%│ 28%│
204 │ Somewhat │ 27%│ 32%│
206 │ Somewhat │ 15%│ 15%│
210 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
211 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
212 │too much to drink to drive safely will D. Be certain │ │ │
213 │arrested for drunk driving? Very likely │ 26%│ 27%│
214 │ Somewhat │ 32%│ 35%│
216 │ Somewhat │ 17%│ 15%│
220 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
224 AT_SETUP([CTABLES show or hide empty categories])
225 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
226 AT_DATA([ctables.sps],
228 IF (qn105ba = 2) qn105ba = 1.
229 IF (qns3a = 1) qns3a = 2.
230 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
231 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
232 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
233 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
234 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
235 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
236 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
238 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
240 ╭──────────────────────────────────────────────────────────────┬───────────────╮
247 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
248 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
249 │too much to drink to drive safely will A. Get certain │ │ │
250 │stopped by the police? Very likely│ .│ 0%│
257 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
260 ╭──────────────────────────────────────────────────────────────┬───────────────╮
267 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
268 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
269 │too much to drink to drive safely will A. Get certain │ │ │
270 │stopped by the police? Somewhat │ .│ 40%│
276 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
279 ╭────────────────────────────────────────────────────────────────────┬─────────╮
286 ├────────────────────────────────────────────────────────────────────┼─────────┤
287 │105b. How likely is it that drivers who have had too Almost │ 32%│
288 │much to drink to drive safely will A. Get stopped by certain │ │
289 │the police? Very likely │ 0%│
296 ╰────────────────────────────────────────────────────────────────────┴─────────╯
299 ╭────────────────────────────────────────────────────────────────────┬─────────╮
306 ├────────────────────────────────────────────────────────────────────┼─────────┤
307 │105b. How likely is it that drivers who have had too Almost │ 32%│
308 │much to drink to drive safely will A. Get stopped by certain │ │
309 │the police? Somewhat │ 40%│
315 ╰────────────────────────────────────────────────────────────────────┴─────────╯
319 AT_SETUP([CTABLES simple nesting])
320 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
321 AT_DATA([ctables.sps],
323 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
324 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
325 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
326 /CATEGORIES VARIABLES=qns3a TOTAL=YES
327 /CLABELS ROW=OPPOSITE.
329 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
331 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
334 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
335 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
336 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
337 │drive safely will A. Get stopped by Total │ 700│ 10%│
338 │the police? ╶──────────────────────────┼─────┼──────┤
339 │ Very S3a. Male │ 660│ 10%│
340 │ likely GENDER: Female│ 842│ 12%│
342 │ ╶──────────────────────────┼─────┼──────┤
343 │ Somewhat S3a. Male │ 1174│ 17%│
344 │ likely GENDER: Female│ 1589│ 23%│
346 │ ╶──────────────────────────┼─────┼──────┤
347 │ Somewhat S3a. Male │ 640│ 9%│
348 │ unlikely GENDER: Female│ 667│ 10%│
350 │ ╶──────────────────────────┼─────┼──────┤
351 │ Very S3a. Male │ 311│ 5%│
352 │ unlikely GENDER: Female│ 298│ 4%│
354 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
355 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
356 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
357 │drive safely will B. Have an accident? Total │ 1100│ 16%│
358 │ ╶──────────────────────────┼─────┼──────┤
359 │ Very S3a. Male │ 1104│ 16%│
360 │ likely GENDER: Female│ 1715│ 25%│
362 │ ╶──────────────────────────┼─────┼──────┤
363 │ Somewhat S3a. Male │ 1203│ 17%│
364 │ likely GENDER: Female│ 1214│ 18%│
366 │ ╶──────────────────────────┼─────┼──────┤
367 │ Somewhat S3a. Male │ 262│ 4%│
368 │ unlikely GENDER: Female│ 168│ 2%│
370 │ ╶──────────────────────────┼─────┼──────┤
371 │ Very S3a. Male │ 81│ 1%│
372 │ unlikely GENDER: Female│ 59│ 1%│
374 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
375 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
376 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
377 │drive safely will C. Be convicted for Total │ 1149│ 17%│
378 │drunk driving? ╶──────────────────────────┼─────┼──────┤
379 │ Very S3a. Male │ 988│ 14%│
380 │ likely GENDER: Female│ 1049│ 15%│
382 │ ╶──────────────────────────┼─────┼──────┤
383 │ Somewhat S3a. Male │ 822│ 12%│
384 │ likely GENDER: Female│ 1210│ 18%│
386 │ ╶──────────────────────────┼─────┼──────┤
387 │ Somewhat S3a. Male │ 446│ 7%│
388 │ unlikely GENDER: Female│ 548│ 8%│
390 │ ╶──────────────────────────┼─────┼──────┤
391 │ Very S3a. Male │ 268│ 4%│
392 │ unlikely GENDER: Female│ 354│ 5%│
394 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
395 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
396 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
397 │drive safely will D. Be arrested for Total │ 1101│ 16%│
398 │drunk driving? ╶──────────────────────────┼─────┼──────┤
399 │ Very S3a. Male │ 805│ 12%│
400 │ likely GENDER: Female│ 1029│ 15%│
402 │ ╶──────────────────────────┼─────┼──────┤
403 │ Somewhat S3a. Male │ 975│ 14%│
404 │ likely GENDER: Female│ 1332│ 19%│
406 │ ╶──────────────────────────┼─────┼──────┤
407 │ Somewhat S3a. Male │ 535│ 8%│
408 │ unlikely GENDER: Female│ 560│ 8%│
410 │ ╶──────────────────────────┼─────┼──────┤
411 │ Very S3a. Male │ 270│ 4%│
412 │ unlikely GENDER: Female│ 279│ 4%│
414 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
417 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
418 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
419 │ │ certain│likely│ likely │ unlikely│unlikely│
420 │ ├────────┼──────┼─────────┼─────────┼────────┤
422 │ │ Table %│ % │ Table % │ Table % │ Table %│
423 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
424 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
425 │GENDER: is it that drivers│ │ │ │ │ │
426 │ who have had too │ │ │ │ │ │
427 │ much to drink to │ │ │ │ │ │
428 │ drive safely will │ │ │ │ │ │
429 │ A. Get stopped by │ │ │ │ │ │
430 │ the police? │ │ │ │ │ │
431 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
432 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
433 │ is it that drivers│ │ │ │ │ │
434 │ who have had too │ │ │ │ │ │
435 │ much to drink to │ │ │ │ │ │
436 │ drive safely will │ │ │ │ │ │
437 │ A. Get stopped by │ │ │ │ │ │
438 │ the police? │ │ │ │ │ │
439 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
440 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
441 │ is it that drivers│ │ │ │ │ │
442 │ who have had too │ │ │ │ │ │
443 │ much to drink to │ │ │ │ │ │
444 │ drive safely will │ │ │ │ │ │
445 │ A. Get stopped by │ │ │ │ │ │
446 │ the police? │ │ │ │ │ │
447 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
448 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
449 │GENDER: is it that drivers│ │ │ │ │ │
450 │ who have had too │ │ │ │ │ │
451 │ much to drink to │ │ │ │ │ │
452 │ drive safely will │ │ │ │ │ │
453 │ B. Have an │ │ │ │ │ │
454 │ accident? │ │ │ │ │ │
455 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
456 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
457 │ is it that drivers│ │ │ │ │ │
458 │ who have had too │ │ │ │ │ │
459 │ much to drink to │ │ │ │ │ │
460 │ drive safely will │ │ │ │ │ │
461 │ B. Have an │ │ │ │ │ │
462 │ accident? │ │ │ │ │ │
463 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
464 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
465 │ is it that drivers│ │ │ │ │ │
466 │ who have had too │ │ │ │ │ │
467 │ much to drink to │ │ │ │ │ │
468 │ drive safely will │ │ │ │ │ │
469 │ B. Have an │ │ │ │ │ │
470 │ accident? │ │ │ │ │ │
471 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
472 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
473 │GENDER: is it that drivers│ │ │ │ │ │
474 │ who have had too │ │ │ │ │ │
475 │ much to drink to │ │ │ │ │ │
476 │ drive safely will │ │ │ │ │ │
477 │ C. Be convicted │ │ │ │ │ │
478 │ for drunk driving?│ │ │ │ │ │
479 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
480 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
481 │ is it that drivers│ │ │ │ │ │
482 │ who have had too │ │ │ │ │ │
483 │ much to drink to │ │ │ │ │ │
484 │ drive safely will │ │ │ │ │ │
485 │ C. Be convicted │ │ │ │ │ │
486 │ for drunk driving?│ │ │ │ │ │
487 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
488 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
489 │ is it that drivers│ │ │ │ │ │
490 │ who have had too │ │ │ │ │ │
491 │ much to drink to │ │ │ │ │ │
492 │ drive safely will │ │ │ │ │ │
493 │ C. Be convicted │ │ │ │ │ │
494 │ for drunk driving?│ │ │ │ │ │
495 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
496 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
497 │GENDER: is it that drivers│ │ │ │ │ │
498 │ who have had too │ │ │ │ │ │
499 │ much to drink to │ │ │ │ │ │
500 │ drive safely will │ │ │ │ │ │
501 │ D. Be arrested for│ │ │ │ │ │
502 │ drunk driving? │ │ │ │ │ │
503 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
504 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
505 │ is it that drivers│ │ │ │ │ │
506 │ who have had too │ │ │ │ │ │
507 │ much to drink to │ │ │ │ │ │
508 │ drive safely will │ │ │ │ │ │
509 │ D. Be arrested for│ │ │ │ │ │
510 │ drunk driving? │ │ │ │ │ │
511 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
512 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
513 │ is it that drivers│ │ │ │ │ │
514 │ who have had too │ │ │ │ │ │
515 │ much to drink to │ │ │ │ │ │
516 │ drive safely will │ │ │ │ │ │
517 │ D. Be arrested for│ │ │ │ │ │
518 │ drunk driving? │ │ │ │ │ │
519 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
523 AT_SETUP([CTABLES nesting and scale variables])
524 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
525 AT_DATA([ctables.sps],
527 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
528 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
529 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
530 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
531 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
533 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
535 ╭─────────────────────────────────────────────────────────────────┬────────────╮
541 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
542 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
543 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
545 │ Once a week or │ 44│ 54│
547 │ Only certain │ 34│ 41│
550 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
553 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
554 │ │Minimum│Maximum│Mean│
555 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
556 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
557 │What is GENDER: months, has there been a │ │ │ │
558 │your time when you felt you │ │ │ │
559 │age? should cut down on your No │ 16│ 86│ 46│
561 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
562 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
563 │ months, has there been a │ │ │ │
564 │ time when you felt you │ │ │ │
565 │ should cut down on your No │ 16│ 86│ 48│
567 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
568 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
569 │What is GENDER: months, has there been a │ │ │ │
570 │your time when people criticized No │ 16│ 86│ 46│
571 │age? your drinking? │ │ │ │
572 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
573 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
574 │ months, has there been a │ │ │ │
575 │ time when people criticized No │ 16│ 86│ 48│
576 │ your drinking? │ │ │ │
577 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
580 ╭─────────────────────────────┬────────────────────────────────────────────────╮
581 │ │S1. Including yourself, how many members of this│
582 │ │ household are age 16 or older? │
583 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
584 │ │ │ │ │ │ │ │ 6 or │
585 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
586 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
587 │ │Column│Column│Column│Column│Column│Column│Column│
588 │ │ % │ % │ % │ % │ % │ % │ % │
589 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
590 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
591 │SAMPLE How certain │ │ │ │ │ │ │ │
592 │SOURCE: likely │ │ │ │ │ │ │ │
593 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
594 │ that likely │ │ │ │ │ │ │ │
595 │ drivers │ │ │ │ │ │ │ │
596 │ who have │ │ │ │ │ │ │ │
597 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
598 │ much to likely │ │ │ │ │ │ │ │
599 │ drink to │ │ │ │ │ │ │ │
600 │ drive │ │ │ │ │ │ │ │
601 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
602 │ will A. unlikely│ │ │ │ │ │ │ │
603 │ Get │ │ │ │ │ │ │ │
604 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
605 │ by the unlikely│ │ │ │ │ │ │ │
606 │ police? │ │ │ │ │ │ │ │
607 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
610 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
613 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
614 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
615 │group typical month did you have one or more │ │ │
616 │ alcoholic beverages to drink? │ │ │
617 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
618 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
619 │ typical month did you have one or more │ │ │
620 │ alcoholic beverages to drink? │ │ │
621 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
622 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
623 │ typical month did you have one or more │ │ │
624 │ alcoholic beverages to drink? │ │ │
625 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
626 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
627 │ typical month did you have one or more │ │ │
628 │ alcoholic beverages to drink? │ │ │
629 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
630 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
631 │ typical month did you have one or more │ │ │
632 │ alcoholic beverages to drink? │ │ │
633 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
634 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
635 │ older typical month did you have one or more │ │ │
636 │ alcoholic beverages to drink? │ │ │
637 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
642 AT_SETUP([CTABLES SLABELS])
643 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
644 AT_DATA([ctables.sps],
646 CTABLES /TABLE qn1 [COUNT COLPCT].
647 CTABLES /TABLE qn1 [COUNT COLPCT]
648 /SLABELS POSITION=ROW.
649 CTABLES /TABLE qn1 [COUNT COLPCT]
650 /SLABELS POSITION=ROW VISIBLE=NO.
652 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
654 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
657 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
658 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
659 │other motor vehicle? Several days a week│ 1274│ 18.3%│
660 │ Once a week or less│ 361│ 5.2%│
661 │ Only certain times │ 130│ 1.9%│
664 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
667 ╭────────────────────────────────────────────────────────────────────────┬─────╮
668 │ 1. How often do you usually drive a car or Every day Count │ 4667│
669 │other motor vehicle? Column │66.9%│
671 │ ╶───────────────────────────┼─────┤
672 │ Several days a week Count │ 1274│
675 │ ╶───────────────────────────┼─────┤
676 │ Once a week or less Count │ 361│
679 │ ╶───────────────────────────┼─────┤
680 │ Only certain times Count │ 130│
681 │ a year Column │ 1.9%│
683 │ ╶───────────────────────────┼─────┤
687 ╰────────────────────────────────────────────────────────────────────────┴─────╯
690 ╭────────────────────────────────────────────────────────────────────────┬─────╮
691 │ 1. How often do you usually drive a car or other Every day │ 4667│
692 │motor vehicle? │66.9%│
693 │ Several days a week │ 1274│
695 │ Once a week or less │ 361│
697 │ Only certain times a │ 130│
701 ╰────────────────────────────────────────────────────────────────────────┴─────╯
705 AT_SETUP([CTABLES simple totals])
706 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
707 AT_DATA([ctables.sps],
710 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
711 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
712 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
714 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
716 ╭────────────────────────────────────────────────────────────────────────┬─────╮
718 ├────────────────────────────────────────────────────────────────────────┼─────┤
719 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
720 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
723 │ Wine coolers │ 137│
724 │ Hard liquor or │ 888│
726 │ Flavored malt │ 83│
728 │ Number responding │ 4221│
729 ╰────────────────────────────────────────────────────────────────────────┴─────╯
732 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
734 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
735 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
736 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
738 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
739 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
740 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
742 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
743 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
744 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
746 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
747 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
748 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
750 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
751 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
752 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
754 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
758 AT_SETUP([CTABLES subtotals])
759 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
760 AT_DATA([ctables.sps],
762 CTABLES /TABLE=qn105ba BY qns1
763 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
764 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
765 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
766 CTABLES /TABLE=qn105ba BY qns1
767 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
768 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
770 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
772 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
773 │ │ S1. Including yourself, how many members of this household │
774 │ │ are age 16 or older? │
775 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
776 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
777 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
778 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
779 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
780 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
781 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
782 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
783 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
784 │ likely │ │ │ │ │ │ │ │
785 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
786 │ unlikely │ │ │ │ │ │ │ │
787 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
788 │ unlikely │ │ │ │ │ │ │ │
789 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
792 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
793 │ │ S1. Including yourself, how many members of this household │
794 │ │ are age 16 or older? │
795 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
796 │ │ │ │ │ │ │ │ 6 or │
797 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
798 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
799 │ │ │ │ │ │ Column│ │ │
800 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
801 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
802 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
803 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
804 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
805 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
806 │ likely │ │ │ │ │ │ │ │
807 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
808 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
809 │ unlikely │ │ │ │ │ │ │ │
810 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
811 │ unlikely │ │ │ │ │ │ │ │
812 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
813 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
816 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
817 │ │ S1. Including yourself, how many members of this household │
818 │ │ are age 16 or older? │
819 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
820 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
821 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
822 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
823 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
824 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
825 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
826 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
827 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
828 │ likely │ │ │ │ │ │ │ │
829 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
830 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
831 │ unlikely │ │ │ │ │ │ │ │
832 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
833 │ unlikely │ │ │ │ │ │ │ │
834 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
835 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
839 AT_SETUP([CTABLES PCOMPUTE])
840 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
841 AT_DATA([ctables.sps],
844 /PCOMPUTE &x=EXPR([3] + [4])
845 /PCOMPUTE &y=EXPR([4] + [5])
846 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
847 /PPROPERTIES &y LABEL='4+5'
848 /TABLE=qn105ba BY qns1
849 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
851 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
853 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
854 │ │ S1. Including yourself, how many members of this household │
855 │ │ are age 16 or older? │
856 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
857 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
858 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
859 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
860 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
861 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
862 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
863 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
864 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
865 │ likely │ │ │ │ │ │ │ │
866 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
867 │ unlikely │ │ │ │ │ │ │ │
868 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
869 │ unlikely │ │ │ │ │ │ │ │
870 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
874 AT_SETUP([CTABLES CLABELS])
875 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
876 AT_DATA([ctables.sps],
878 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
879 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
881 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
883 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
885 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
887 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
888 │ │ 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 │
889 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
890 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
891 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
892 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
893 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
894 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
895 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
898 ╭──────────────────────────────┬────────────╮
902 ├──────────────────────────────┼────────────┤
903 │Age group 15 or younger Male │ 0│
905 │ ╶────────────────────┼────────────┤
906 │ 16 to 25 Male │ 594│
908 │ ╶────────────────────┼────────────┤
909 │ 26 to 35 Male │ 476│
911 │ ╶────────────────────┼────────────┤
912 │ 36 to 45 Male │ 489│
914 │ ╶────────────────────┼────────────┤
915 │ 46 to 55 Male │ 526│
917 │ ╶────────────────────┼────────────┤
918 │ 56 to 65 Male │ 516│
920 │ ╶────────────────────┼────────────┤
921 │ 66 or older Male │ 531│
923 ╰──────────────────────────────┴────────────╯