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.
16 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
22 dnl * Data-dependent sorting.
23 dnl - TITLES: )DATE, )TIME, )TABLE.
25 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
28 dnl - SMISSING (see documentation).
30 dnl * multi-dimensional
31 dnl * MISSING, OTHERNM
35 dnl * summary statistics and formats?
36 dnl - HIDESMALLCOUNTS.
37 dnl - Are string ranges a thing?
39 dnl Features not yet tested:
40 dnl - Parsing (positive and negative)
41 dnl - String variables and values
42 dnl - Testing details of missing value handling in summaries.
43 dnl - test CLABELS ROWLABELS=LAYER.
45 dnl - Test WEIGHT and adjustment weights.
46 dnl - Test PCOMPUTE and PPROPERTIES.
49 dnl - Multiple response sets
50 dnl - MRSETS subcommand.
51 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
57 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
58 dnl produces a bad median:
60 dnl +--------------------------+-----------------------+
61 dnl | | S3a. GENDER: |
62 dnl | +-----------+-----------+
63 dnl | | Male | Female |
64 dnl | +----+------+----+------+
65 dnl | |Mean|Median|Mean|Median|
66 dnl +--------------------------+----+------+----+------+
67 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
68 dnl +--------------------------+----+------+----+------+
72 # AT_SETUP([CTABLES parsing])
73 # AT_DATA([ctables.sps],
74 # [[DATA LIST LIST NOTABLE /x y z.
75 # CTABLES /TABLE=(x + y) > z.
76 # CTABLES /TABLE=(x[c] + y[c]) > z.
77 # CTABLES /TABLE=(x + y) > z[c].
78 # CTABLES /TABLE=x BY y BY z.
79 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
80 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
82 # AT_CHECK([pspp ctables.sps])
85 AT_SETUP([CTABLES one categorical variable])
86 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
87 AT_DATA([ctables.sps],
90 CTABLES /TABLE BY qn1.
91 CTABLES /TABLE BY BY qn1.
93 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
95 ╭────────────────────────────────────────────────────────────────────────┬─────╮
97 ├────────────────────────────────────────────────────────────────────────┼─────┤
98 │ 1. How often do you usually drive a car or other Every day │ 4667│
99 │motor vehicle? Several days a week │ 1274│
100 │ Once a week or less │ 361│
101 │ Only certain times a │ 130│
104 ╰────────────────────────────────────────────────────────────────────────┴─────╯
107 ╭──────────────────────────────────────────────────────────────────────────────╮
108 │ 1. How often do you usually drive a car or other motor vehicle? │
109 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
110 │ │ Several days a │ Once a week or │ Only certain times a │ │
111 │Every day│ week │ less │ year │Never│
112 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
113 │ Count │ Count │ Count │ Count │Count│
114 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
115 │ 4667│ 1274│ 361│ 130│ 540│
116 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
128 AT_SETUP([CTABLES one scale variable])
129 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
130 AT_DATA([ctables.sps],
132 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
133 CTABLES /TABLE BY qnd1.
134 CTABLES /TABLE BY BY qnd1.
136 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
138 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
139 │ │Count│Mean│Std Deviation│Minimum│Maximum│
140 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
141 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
142 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
145 ╭──────────────────────────╮
146 │D1. AGE: What is your age?│
147 ├──────────────────────────┤
149 ├──────────────────────────┤
151 ╰──────────────────────────╯
154 D1. AGE: What is your age?
163 AT_SETUP([CTABLES simple stacking])
164 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
165 AT_DATA([ctables.sps],
167 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
169 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
171 ╭───────────────────────────────────────────────────────────────┬──────────────╮
178 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
179 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
180 │too much to drink to drive safely will A. Get certain │ │ │
181 │stopped by the police? Very likely │ 21%│ 22%│
182 │ Somewhat │ 38%│ 42%│
184 │ Somewhat │ 21%│ 18%│
188 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
189 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
190 │too much to drink to drive safely will B. Have an certain │ │ │
191 │accident? Very likely │ 36%│ 45%│
192 │ Somewhat │ 39%│ 32%│
198 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
199 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
200 │too much to drink to drive safely will C. Be certain │ │ │
201 │convicted for drunk driving? Very likely │ 32%│ 28%│
202 │ Somewhat │ 27%│ 32%│
204 │ Somewhat │ 15%│ 15%│
208 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
209 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
210 │too much to drink to drive safely will D. Be certain │ │ │
211 │arrested for drunk driving? Very likely │ 26%│ 27%│
212 │ Somewhat │ 32%│ 35%│
214 │ Somewhat │ 17%│ 15%│
218 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
222 AT_SETUP([CTABLES show or hide empty categories])
223 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
224 AT_DATA([ctables.sps],
226 IF (qn105ba = 2) qn105ba = 1.
227 IF (qns3a = 1) qns3a = 2.
228 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
229 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
230 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
231 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
232 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
233 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
234 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
236 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
238 ╭──────────────────────────────────────────────────────────────┬───────────────╮
245 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
246 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
247 │too much to drink to drive safely will A. Get certain │ │ │
248 │stopped by the police? Very likely│ .│ 0%│
255 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
258 ╭──────────────────────────────────────────────────────────────┬───────────────╮
265 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
266 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
267 │too much to drink to drive safely will A. Get certain │ │ │
268 │stopped by the police? Somewhat │ .│ 40%│
274 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
277 ╭────────────────────────────────────────────────────────────────────┬─────────╮
284 ├────────────────────────────────────────────────────────────────────┼─────────┤
285 │105b. How likely is it that drivers who have had too Almost │ 32%│
286 │much to drink to drive safely will A. Get stopped by certain │ │
287 │the police? Very likely │ 0%│
294 ╰────────────────────────────────────────────────────────────────────┴─────────╯
297 ╭────────────────────────────────────────────────────────────────────┬─────────╮
304 ├────────────────────────────────────────────────────────────────────┼─────────┤
305 │105b. How likely is it that drivers who have had too Almost │ 32%│
306 │much to drink to drive safely will A. Get stopped by certain │ │
307 │the police? Somewhat │ 40%│
313 ╰────────────────────────────────────────────────────────────────────┴─────────╯
317 AT_SETUP([CTABLES simple nesting])
318 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
319 AT_DATA([ctables.sps],
321 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
322 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
323 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
324 /CATEGORIES VARIABLES=qns3a TOTAL=YES
325 /CLABELS ROW=OPPOSITE.
327 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
329 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
332 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
333 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
334 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
335 │drive safely will A. Get stopped by Total │ 700│ 10%│
336 │the police? ╶──────────────────────────┼─────┼──────┤
337 │ Very S3a. Male │ 660│ 10%│
338 │ likely GENDER: Female│ 842│ 12%│
340 │ ╶──────────────────────────┼─────┼──────┤
341 │ Somewhat S3a. Male │ 1174│ 17%│
342 │ likely GENDER: Female│ 1589│ 23%│
344 │ ╶──────────────────────────┼─────┼──────┤
345 │ Somewhat S3a. Male │ 640│ 9%│
346 │ unlikely GENDER: Female│ 667│ 10%│
348 │ ╶──────────────────────────┼─────┼──────┤
349 │ Very S3a. Male │ 311│ 5%│
350 │ unlikely GENDER: Female│ 298│ 4%│
352 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
353 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
354 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
355 │drive safely will B. Have an accident? Total │ 1100│ 16%│
356 │ ╶──────────────────────────┼─────┼──────┤
357 │ Very S3a. Male │ 1104│ 16%│
358 │ likely GENDER: Female│ 1715│ 25%│
360 │ ╶──────────────────────────┼─────┼──────┤
361 │ Somewhat S3a. Male │ 1203│ 17%│
362 │ likely GENDER: Female│ 1214│ 18%│
364 │ ╶──────────────────────────┼─────┼──────┤
365 │ Somewhat S3a. Male │ 262│ 4%│
366 │ unlikely GENDER: Female│ 168│ 2%│
368 │ ╶──────────────────────────┼─────┼──────┤
369 │ Very S3a. Male │ 81│ 1%│
370 │ unlikely GENDER: Female│ 59│ 1%│
372 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
373 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
374 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
375 │drive safely will C. Be convicted for Total │ 1149│ 17%│
376 │drunk driving? ╶──────────────────────────┼─────┼──────┤
377 │ Very S3a. Male │ 988│ 14%│
378 │ likely GENDER: Female│ 1049│ 15%│
380 │ ╶──────────────────────────┼─────┼──────┤
381 │ Somewhat S3a. Male │ 822│ 12%│
382 │ likely GENDER: Female│ 1210│ 18%│
384 │ ╶──────────────────────────┼─────┼──────┤
385 │ Somewhat S3a. Male │ 446│ 7%│
386 │ unlikely GENDER: Female│ 548│ 8%│
388 │ ╶──────────────────────────┼─────┼──────┤
389 │ Very S3a. Male │ 268│ 4%│
390 │ unlikely GENDER: Female│ 354│ 5%│
392 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
393 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
394 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
395 │drive safely will D. Be arrested for Total │ 1101│ 16%│
396 │drunk driving? ╶──────────────────────────┼─────┼──────┤
397 │ Very S3a. Male │ 805│ 12%│
398 │ likely GENDER: Female│ 1029│ 15%│
400 │ ╶──────────────────────────┼─────┼──────┤
401 │ Somewhat S3a. Male │ 975│ 14%│
402 │ likely GENDER: Female│ 1332│ 19%│
404 │ ╶──────────────────────────┼─────┼──────┤
405 │ Somewhat S3a. Male │ 535│ 8%│
406 │ unlikely GENDER: Female│ 560│ 8%│
408 │ ╶──────────────────────────┼─────┼──────┤
409 │ Very S3a. Male │ 270│ 4%│
410 │ unlikely GENDER: Female│ 279│ 4%│
412 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
415 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
416 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
417 │ │ certain│likely│ likely │ unlikely│unlikely│
418 │ ├────────┼──────┼─────────┼─────────┼────────┤
420 │ │ Table %│ % │ Table % │ Table % │ Table %│
421 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
422 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
423 │GENDER: is it that drivers│ │ │ │ │ │
424 │ who have had too │ │ │ │ │ │
425 │ much to drink to │ │ │ │ │ │
426 │ drive safely will │ │ │ │ │ │
427 │ A. Get stopped by │ │ │ │ │ │
428 │ the police? │ │ │ │ │ │
429 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
430 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
431 │ is it that drivers│ │ │ │ │ │
432 │ who have had too │ │ │ │ │ │
433 │ much to drink to │ │ │ │ │ │
434 │ drive safely will │ │ │ │ │ │
435 │ A. Get stopped by │ │ │ │ │ │
436 │ the police? │ │ │ │ │ │
437 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
438 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
439 │ is it that drivers│ │ │ │ │ │
440 │ who have had too │ │ │ │ │ │
441 │ much to drink to │ │ │ │ │ │
442 │ drive safely will │ │ │ │ │ │
443 │ A. Get stopped by │ │ │ │ │ │
444 │ the police? │ │ │ │ │ │
445 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
446 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
447 │GENDER: is it that drivers│ │ │ │ │ │
448 │ who have had too │ │ │ │ │ │
449 │ much to drink to │ │ │ │ │ │
450 │ drive safely will │ │ │ │ │ │
451 │ B. Have an │ │ │ │ │ │
452 │ accident? │ │ │ │ │ │
453 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
454 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
455 │ is it that drivers│ │ │ │ │ │
456 │ who have had too │ │ │ │ │ │
457 │ much to drink to │ │ │ │ │ │
458 │ drive safely will │ │ │ │ │ │
459 │ B. Have an │ │ │ │ │ │
460 │ accident? │ │ │ │ │ │
461 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
462 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
463 │ is it that drivers│ │ │ │ │ │
464 │ who have had too │ │ │ │ │ │
465 │ much to drink to │ │ │ │ │ │
466 │ drive safely will │ │ │ │ │ │
467 │ B. Have an │ │ │ │ │ │
468 │ accident? │ │ │ │ │ │
469 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
470 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
471 │GENDER: is it that drivers│ │ │ │ │ │
472 │ who have had too │ │ │ │ │ │
473 │ much to drink to │ │ │ │ │ │
474 │ drive safely will │ │ │ │ │ │
475 │ C. Be convicted │ │ │ │ │ │
476 │ for drunk driving?│ │ │ │ │ │
477 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
478 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
479 │ is it that drivers│ │ │ │ │ │
480 │ who have had too │ │ │ │ │ │
481 │ much to drink to │ │ │ │ │ │
482 │ drive safely will │ │ │ │ │ │
483 │ C. Be convicted │ │ │ │ │ │
484 │ for drunk driving?│ │ │ │ │ │
485 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
486 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
487 │ is it that drivers│ │ │ │ │ │
488 │ who have had too │ │ │ │ │ │
489 │ much to drink to │ │ │ │ │ │
490 │ drive safely will │ │ │ │ │ │
491 │ C. Be convicted │ │ │ │ │ │
492 │ for drunk driving?│ │ │ │ │ │
493 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
494 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
495 │GENDER: is it that drivers│ │ │ │ │ │
496 │ who have had too │ │ │ │ │ │
497 │ much to drink to │ │ │ │ │ │
498 │ drive safely will │ │ │ │ │ │
499 │ D. Be arrested for│ │ │ │ │ │
500 │ drunk driving? │ │ │ │ │ │
501 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
502 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
503 │ is it that drivers│ │ │ │ │ │
504 │ who have had too │ │ │ │ │ │
505 │ much to drink to │ │ │ │ │ │
506 │ drive safely will │ │ │ │ │ │
507 │ D. Be arrested for│ │ │ │ │ │
508 │ drunk driving? │ │ │ │ │ │
509 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
510 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
511 │ is it that drivers│ │ │ │ │ │
512 │ who have had too │ │ │ │ │ │
513 │ much to drink to │ │ │ │ │ │
514 │ drive safely will │ │ │ │ │ │
515 │ D. Be arrested for│ │ │ │ │ │
516 │ drunk driving? │ │ │ │ │ │
517 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
521 AT_SETUP([CTABLES nesting and scale variables])
522 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
523 AT_DATA([ctables.sps],
525 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
526 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
527 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
528 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
529 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
531 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
533 ╭─────────────────────────────────────────────────────────────────┬────────────╮
539 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
540 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
541 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
543 │ Once a week or │ 44│ 54│
545 │ Only certain │ 34│ 41│
548 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
551 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
552 │ │Minimum│Maximum│Mean│
553 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
554 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
555 │What is GENDER: months, has there been a │ │ │ │
556 │your time when you felt you │ │ │ │
557 │age? should cut down on your No │ 16│ 86│ 46│
559 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
560 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
561 │ months, has there been a │ │ │ │
562 │ time when you felt you │ │ │ │
563 │ should cut down on your No │ 16│ 86│ 48│
565 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
566 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
567 │What is GENDER: months, has there been a │ │ │ │
568 │your time when people criticized No │ 16│ 86│ 46│
569 │age? your drinking? │ │ │ │
570 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
571 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
572 │ months, has there been a │ │ │ │
573 │ time when people criticized No │ 16│ 86│ 48│
574 │ your drinking? │ │ │ │
575 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
578 ╭─────────────────────────────┬────────────────────────────────────────────────╮
579 │ │S1. Including yourself, how many members of this│
580 │ │ household are age 16 or older? │
581 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
582 │ │ │ │ │ │ │ │ 6 or │
583 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
584 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
585 │ │Column│Column│Column│Column│Column│Column│Column│
586 │ │ % │ % │ % │ % │ % │ % │ % │
587 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
588 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
589 │SAMPLE How certain │ │ │ │ │ │ │ │
590 │SOURCE: likely │ │ │ │ │ │ │ │
591 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
592 │ that likely │ │ │ │ │ │ │ │
593 │ drivers │ │ │ │ │ │ │ │
594 │ who have │ │ │ │ │ │ │ │
595 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
596 │ much to likely │ │ │ │ │ │ │ │
597 │ drink to │ │ │ │ │ │ │ │
598 │ drive │ │ │ │ │ │ │ │
599 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
600 │ will A. unlikely│ │ │ │ │ │ │ │
601 │ Get │ │ │ │ │ │ │ │
602 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
603 │ by the unlikely│ │ │ │ │ │ │ │
604 │ police? │ │ │ │ │ │ │ │
605 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
608 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
611 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
612 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
613 │group typical month did you have one or more │ │ │
614 │ alcoholic beverages to drink? │ │ │
615 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
616 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
617 │ typical month did you have one or more │ │ │
618 │ alcoholic beverages to drink? │ │ │
619 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
620 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
621 │ typical month did you have one or more │ │ │
622 │ alcoholic beverages to drink? │ │ │
623 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
624 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
625 │ typical month did you have one or more │ │ │
626 │ alcoholic beverages to drink? │ │ │
627 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
628 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
629 │ typical month did you have one or more │ │ │
630 │ alcoholic beverages to drink? │ │ │
631 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
632 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
633 │ older typical month did you have one or more │ │ │
634 │ alcoholic beverages to drink? │ │ │
635 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
640 AT_SETUP([CTABLES SLABELS])
641 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
642 AT_DATA([ctables.sps],
644 CTABLES /TABLE qn1 [COUNT COLPCT].
645 CTABLES /TABLE qn1 [COUNT COLPCT]
646 /SLABELS POSITION=ROW.
647 CTABLES /TABLE qn1 [COUNT COLPCT]
648 /SLABELS POSITION=ROW VISIBLE=NO.
650 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
652 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
655 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
656 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
657 │other motor vehicle? Several days a week│ 1274│ 18.3%│
658 │ Once a week or less│ 361│ 5.2%│
659 │ Only certain times │ 130│ 1.9%│
662 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
665 ╭────────────────────────────────────────────────────────────────────────┬─────╮
666 │ 1. How often do you usually drive a car or Every day Count │ 4667│
667 │other motor vehicle? Column │66.9%│
669 │ ╶───────────────────────────┼─────┤
670 │ Several days a week Count │ 1274│
673 │ ╶───────────────────────────┼─────┤
674 │ Once a week or less Count │ 361│
677 │ ╶───────────────────────────┼─────┤
678 │ Only certain times Count │ 130│
679 │ a year Column │ 1.9%│
681 │ ╶───────────────────────────┼─────┤
685 ╰────────────────────────────────────────────────────────────────────────┴─────╯
688 ╭────────────────────────────────────────────────────────────────────────┬─────╮
689 │ 1. How often do you usually drive a car or other Every day │ 4667│
690 │motor vehicle? │66.9%│
691 │ Several days a week │ 1274│
693 │ Once a week or less │ 361│
695 │ Only certain times a │ 130│
699 ╰────────────────────────────────────────────────────────────────────────┴─────╯
703 AT_SETUP([CTABLES simple totals])
704 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
705 AT_DATA([ctables.sps],
708 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
709 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
710 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
712 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
714 ╭────────────────────────────────────────────────────────────────────────┬─────╮
716 ├────────────────────────────────────────────────────────────────────────┼─────┤
717 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
718 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
721 │ Wine coolers │ 137│
722 │ Hard liquor or │ 888│
724 │ Flavored malt │ 83│
726 │ Number responding │ 4221│
727 ╰────────────────────────────────────────────────────────────────────────┴─────╯
730 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
732 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
733 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
734 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
736 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
737 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
738 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
740 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
741 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
742 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
744 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
745 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
746 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
748 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
749 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
750 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
752 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
756 AT_SETUP([CTABLES subtotals])
757 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
758 AT_DATA([ctables.sps],
760 CTABLES /TABLE=qn105ba BY qns1
761 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
762 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
763 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
764 CTABLES /TABLE=qn105ba BY qns1
765 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
766 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
768 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
770 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
771 │ │ S1. Including yourself, how many members of this household │
772 │ │ are age 16 or older? │
773 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
774 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
775 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
776 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
777 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
778 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
779 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
780 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
781 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
782 │ likely │ │ │ │ │ │ │ │
783 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
784 │ unlikely │ │ │ │ │ │ │ │
785 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
786 │ unlikely │ │ │ │ │ │ │ │
787 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
790 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
791 │ │ S1. Including yourself, how many members of this household │
792 │ │ are age 16 or older? │
793 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
794 │ │ │ │ │ │ │ │ 6 or │
795 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
796 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
797 │ │ │ │ │ │ Column│ │ │
798 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
799 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
800 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
801 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
802 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
803 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
804 │ likely │ │ │ │ │ │ │ │
805 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
806 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
807 │ unlikely │ │ │ │ │ │ │ │
808 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
809 │ unlikely │ │ │ │ │ │ │ │
810 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
811 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
814 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
815 │ │ S1. Including yourself, how many members of this household │
816 │ │ are age 16 or older? │
817 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
818 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
819 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
820 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
821 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
822 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
823 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
824 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
825 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
826 │ likely │ │ │ │ │ │ │ │
827 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
828 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
829 │ unlikely │ │ │ │ │ │ │ │
830 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
831 │ unlikely │ │ │ │ │ │ │ │
832 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
833 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
837 AT_SETUP([CTABLES PCOMPUTE])
838 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
839 AT_DATA([ctables.sps],
842 /PCOMPUTE &x=EXPR([3] + [4])
843 /PCOMPUTE &y=EXPR([4] + [5])
844 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
845 /PPROPERTIES &y LABEL='4+5'
846 /TABLE=qn105ba BY qns1
847 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
849 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
851 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
852 │ │ S1. Including yourself, how many members of this household │
853 │ │ are age 16 or older? │
854 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
855 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
856 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
857 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
858 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
859 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
860 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
861 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
862 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
863 │ likely │ │ │ │ │ │ │ │
864 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
865 │ unlikely │ │ │ │ │ │ │ │
866 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
867 │ unlikely │ │ │ │ │ │ │ │
868 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
872 AT_SETUP([CTABLES CLABELS])
873 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
874 AT_DATA([ctables.sps],
876 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
877 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
879 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
881 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
883 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
885 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
886 │ │ 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 │
887 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
888 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
889 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
890 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
891 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
892 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
893 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
896 ╭──────────────────────────────┬────────────╮
900 ├──────────────────────────────┼────────────┤
901 │Age group 15 or younger Male │ 0│
903 │ ╶────────────────────┼────────────┤
904 │ 16 to 25 Male │ 594│
906 │ ╶────────────────────┼────────────┤
907 │ 26 to 35 Male │ 476│
909 │ ╶────────────────────┼────────────┤
910 │ 36 to 45 Male │ 489│
912 │ ╶────────────────────┼────────────┤
913 │ 46 to 55 Male │ 526│
915 │ ╶────────────────────┼────────────┤
916 │ 56 to 65 Male │ 516│
918 │ ╶────────────────────┼────────────┤
919 │ 66 or older Male │ 531│
921 ╰──────────────────────────────┴────────────╯