5 dnl - Parsing (positive and negative)
6 dnl - String variables and values
7 dnl - Date/time variables and values
8 dnl - Multiple-response sets.
9 dnl * MRSETS subcommand.
10 dnl - SPLIT FILE with SEPARATE splits
11 dnl - Definition of columns/rows when labels are rotated from one axis to another.
12 dnl - Preprocessing to distinguish categorical from scale.
13 dnl - )CILEVEL in summary specifications
14 dnl - Summary functions:
15 dnl * Unimplemented ones.
16 dnl * U-prefix for unweighted summaries.
17 dnl * .LCL and .UCL suffixes.
19 dnl * Separate summary functions for totals and subtotals.
20 dnl - Special formats for summary functions: NEGPAREN, NEQUAL, PAREN, PCTPAREN.
21 dnl - Testing details of missing value handling in summaries.
22 dnl - test CLABELS ROWLABELS=LAYER.
24 dnl * Special case for explicit category specifications and multiple dichotomy sets
29 dnl * Data-dependent sorting.
30 dnl - TITLES: )DATE, )TIME, )TABLE.
34 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
39 dnl - Test WEIGHT and adjustment weights.
40 dnl - Test PCOMPUTE and PPROPERTIES.
42 dnl * multi-dimensional
43 dnl * MISSING, OTHERNM
45 dnl - HIDESMALLCOUNTS.
46 dnl - Are string ranges a thing?
49 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
50 dnl produces a bad median:
52 dnl +--------------------------+-----------------------+
53 dnl | | S3a. GENDER: |
54 dnl | +-----------+-----------+
55 dnl | | Male | Female |
56 dnl | +----+------+----+------+
57 dnl | |Mean|Median|Mean|Median|
58 dnl +--------------------------+----+------+----+------+
59 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
60 dnl +--------------------------+----+------+----+------+
64 # AT_SETUP([CTABLES parsing])
65 # AT_DATA([ctables.sps],
66 # [[DATA LIST LIST NOTABLE /x y z.
67 # CTABLES /TABLE=(x + y) > z.
68 # CTABLES /TABLE=(x[c] + y[c]) > z.
69 # CTABLES /TABLE=(x + y) > z[c].
70 # CTABLES /TABLE=x BY y BY z.
71 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
72 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
74 # AT_CHECK([pspp ctables.sps])
77 AT_SETUP([CTABLES one categorical variable])
78 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
79 AT_DATA([ctables.sps],
82 CTABLES /TABLE BY qn1.
83 CTABLES /TABLE BY BY qn1.
85 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
87 ╭────────────────────────────────────────────────────────────────────────┬─────╮
89 ├────────────────────────────────────────────────────────────────────────┼─────┤
90 │ 1. How often do you usually drive a car or other Every day │ 4667│
91 │motor vehicle? Several days a week │ 1274│
92 │ Once a week or less │ 361│
93 │ Only certain times a │ 130│
96 ╰────────────────────────────────────────────────────────────────────────┴─────╯
99 ╭──────────────────────────────────────────────────────────────────────────────╮
100 │ 1. How often do you usually drive a car or other motor vehicle? │
101 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
102 │ │ Several days a │ Once a week or │ Only certain times a │ │
103 │Every day│ week │ less │ year │Never│
104 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
105 │ Count │ Count │ Count │ Count │Count│
106 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
107 │ 4667│ 1274│ 361│ 130│ 540│
108 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
120 AT_SETUP([CTABLES one scale variable])
121 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
122 AT_DATA([ctables.sps],
124 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
125 CTABLES /TABLE BY qnd1.
126 CTABLES /TABLE BY BY qnd1.
128 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
130 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
131 │ │Count│Mean│Std Deviation│Minimum│Maximum│
132 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
133 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
134 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
137 ╭──────────────────────────╮
138 │D1. AGE: What is your age?│
139 ├──────────────────────────┤
141 ├──────────────────────────┤
143 ╰──────────────────────────╯
146 D1. AGE: What is your age?
155 AT_SETUP([CTABLES simple stacking])
156 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
157 AT_DATA([ctables.sps],
159 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
161 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
163 ╭───────────────────────────────────────────────────────────────┬──────────────╮
170 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
171 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
172 │too much to drink to drive safely will A. Get certain │ │ │
173 │stopped by the police? Very likely │ 21%│ 22%│
174 │ Somewhat │ 38%│ 42%│
176 │ Somewhat │ 21%│ 18%│
180 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
181 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
182 │too much to drink to drive safely will B. Have an certain │ │ │
183 │accident? Very likely │ 36%│ 45%│
184 │ Somewhat │ 39%│ 32%│
190 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
191 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
192 │too much to drink to drive safely will C. Be certain │ │ │
193 │convicted for drunk driving? Very likely │ 32%│ 28%│
194 │ Somewhat │ 27%│ 32%│
196 │ Somewhat │ 15%│ 15%│
200 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
201 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
202 │too much to drink to drive safely will D. Be certain │ │ │
203 │arrested for drunk driving? Very likely │ 26%│ 27%│
204 │ Somewhat │ 32%│ 35%│
206 │ Somewhat │ 17%│ 15%│
210 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
214 AT_SETUP([CTABLES show or hide empty categories])
215 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
216 AT_DATA([ctables.sps],
218 IF (qn105ba = 2) qn105ba = 1.
219 IF (qns3a = 1) qns3a = 2.
220 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
221 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
222 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
223 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
224 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
225 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
226 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
228 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
230 ╭──────────────────────────────────────────────────────────────┬───────────────╮
237 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
238 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
239 │too much to drink to drive safely will A. Get certain │ │ │
240 │stopped by the police? Very likely│ .│ 0%│
247 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
250 ╭──────────────────────────────────────────────────────────────┬───────────────╮
257 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
258 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
259 │too much to drink to drive safely will A. Get certain │ │ │
260 │stopped by the police? Somewhat │ .│ 40%│
266 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
269 ╭────────────────────────────────────────────────────────────────────┬─────────╮
276 ├────────────────────────────────────────────────────────────────────┼─────────┤
277 │105b. How likely is it that drivers who have had too Almost │ 32%│
278 │much to drink to drive safely will A. Get stopped by certain │ │
279 │the police? Very likely │ 0%│
286 ╰────────────────────────────────────────────────────────────────────┴─────────╯
289 ╭────────────────────────────────────────────────────────────────────┬─────────╮
296 ├────────────────────────────────────────────────────────────────────┼─────────┤
297 │105b. How likely is it that drivers who have had too Almost │ 32%│
298 │much to drink to drive safely will A. Get stopped by certain │ │
299 │the police? Somewhat │ 40%│
305 ╰────────────────────────────────────────────────────────────────────┴─────────╯
309 AT_SETUP([CTABLES simple nesting])
310 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
311 AT_DATA([ctables.sps],
313 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
314 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
315 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
316 /CATEGORIES VARIABLES=qns3a TOTAL=YES
317 /CLABELS ROW=OPPOSITE.
319 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
321 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
324 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
325 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
326 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
327 │drive safely will A. Get stopped by Total │ 700│ 10%│
328 │the police? ╶──────────────────────────┼─────┼──────┤
329 │ Very S3a. Male │ 660│ 10%│
330 │ likely GENDER: Female│ 842│ 12%│
332 │ ╶──────────────────────────┼─────┼──────┤
333 │ Somewhat S3a. Male │ 1174│ 17%│
334 │ likely GENDER: Female│ 1589│ 23%│
336 │ ╶──────────────────────────┼─────┼──────┤
337 │ Somewhat S3a. Male │ 640│ 9%│
338 │ unlikely GENDER: Female│ 667│ 10%│
340 │ ╶──────────────────────────┼─────┼──────┤
341 │ Very S3a. Male │ 311│ 5%│
342 │ unlikely GENDER: Female│ 298│ 4%│
344 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
345 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
346 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
347 │drive safely will B. Have an accident? Total │ 1100│ 16%│
348 │ ╶──────────────────────────┼─────┼──────┤
349 │ Very S3a. Male │ 1104│ 16%│
350 │ likely GENDER: Female│ 1715│ 25%│
352 │ ╶──────────────────────────┼─────┼──────┤
353 │ Somewhat S3a. Male │ 1203│ 17%│
354 │ likely GENDER: Female│ 1214│ 18%│
356 │ ╶──────────────────────────┼─────┼──────┤
357 │ Somewhat S3a. Male │ 262│ 4%│
358 │ unlikely GENDER: Female│ 168│ 2%│
360 │ ╶──────────────────────────┼─────┼──────┤
361 │ Very S3a. Male │ 81│ 1%│
362 │ unlikely GENDER: Female│ 59│ 1%│
364 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
365 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
366 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
367 │drive safely will C. Be convicted for Total │ 1149│ 17%│
368 │drunk driving? ╶──────────────────────────┼─────┼──────┤
369 │ Very S3a. Male │ 988│ 14%│
370 │ likely GENDER: Female│ 1049│ 15%│
372 │ ╶──────────────────────────┼─────┼──────┤
373 │ Somewhat S3a. Male │ 822│ 12%│
374 │ likely GENDER: Female│ 1210│ 18%│
376 │ ╶──────────────────────────┼─────┼──────┤
377 │ Somewhat S3a. Male │ 446│ 7%│
378 │ unlikely GENDER: Female│ 548│ 8%│
380 │ ╶──────────────────────────┼─────┼──────┤
381 │ Very S3a. Male │ 268│ 4%│
382 │ unlikely GENDER: Female│ 354│ 5%│
384 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
385 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
386 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
387 │drive safely will D. Be arrested for Total │ 1101│ 16%│
388 │drunk driving? ╶──────────────────────────┼─────┼──────┤
389 │ Very S3a. Male │ 805│ 12%│
390 │ likely GENDER: Female│ 1029│ 15%│
392 │ ╶──────────────────────────┼─────┼──────┤
393 │ Somewhat S3a. Male │ 975│ 14%│
394 │ likely GENDER: Female│ 1332│ 19%│
396 │ ╶──────────────────────────┼─────┼──────┤
397 │ Somewhat S3a. Male │ 535│ 8%│
398 │ unlikely GENDER: Female│ 560│ 8%│
400 │ ╶──────────────────────────┼─────┼──────┤
401 │ Very S3a. Male │ 270│ 4%│
402 │ unlikely GENDER: Female│ 279│ 4%│
404 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
407 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
408 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
409 │ │ certain│likely│ likely │ unlikely│unlikely│
410 │ ├────────┼──────┼─────────┼─────────┼────────┤
412 │ │ Table %│ % │ Table % │ Table % │ Table %│
413 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
414 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
415 │GENDER: is it that drivers│ │ │ │ │ │
416 │ who have had too │ │ │ │ │ │
417 │ much to drink to │ │ │ │ │ │
418 │ drive safely will │ │ │ │ │ │
419 │ A. Get stopped by │ │ │ │ │ │
420 │ the police? │ │ │ │ │ │
421 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
422 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
423 │ 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 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
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 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
439 │GENDER: is it that drivers│ │ │ │ │ │
440 │ who have had too │ │ │ │ │ │
441 │ much to drink to │ │ │ │ │ │
442 │ drive safely will │ │ │ │ │ │
443 │ B. Have an │ │ │ │ │ │
444 │ accident? │ │ │ │ │ │
445 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
446 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
447 │ 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 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
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 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
463 │GENDER: is it that drivers│ │ │ │ │ │
464 │ who have had too │ │ │ │ │ │
465 │ much to drink to │ │ │ │ │ │
466 │ drive safely will │ │ │ │ │ │
467 │ C. Be convicted │ │ │ │ │ │
468 │ for drunk driving?│ │ │ │ │ │
469 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
470 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
471 │ 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 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
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 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
487 │GENDER: is it that drivers│ │ │ │ │ │
488 │ who have had too │ │ │ │ │ │
489 │ much to drink to │ │ │ │ │ │
490 │ drive safely will │ │ │ │ │ │
491 │ D. Be arrested for│ │ │ │ │ │
492 │ drunk driving? │ │ │ │ │ │
493 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
494 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
495 │ 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 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
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 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
513 AT_SETUP([CTABLES nesting and scale variables])
514 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
515 AT_DATA([ctables.sps],
517 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
518 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
519 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
520 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
521 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
523 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
525 ╭─────────────────────────────────────────────────────────────────┬────────────╮
531 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
532 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
533 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
535 │ Once a week or │ 44│ 54│
537 │ Only certain │ 34│ 41│
540 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
543 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
544 │ │Minimum│Maximum│Mean│
545 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
546 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
547 │What is GENDER: months, has there been a │ │ │ │
548 │your time when you felt you │ │ │ │
549 │age? should cut down on your No │ 16│ 86│ 46│
551 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
552 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
553 │ months, has there been a │ │ │ │
554 │ time when you felt you │ │ │ │
555 │ should cut down on your No │ 16│ 86│ 48│
557 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
558 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
559 │What is GENDER: months, has there been a │ │ │ │
560 │your time when people criticized No │ 16│ 86│ 46│
561 │age? your drinking? │ │ │ │
562 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
563 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
564 │ months, has there been a │ │ │ │
565 │ time when people criticized No │ 16│ 86│ 48│
566 │ your drinking? │ │ │ │
567 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
570 ╭─────────────────────────────┬────────────────────────────────────────────────╮
571 │ │S1. Including yourself, how many members of this│
572 │ │ household are age 16 or older? │
573 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
574 │ │ │ │ │ │ │ │ 6 or │
575 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
576 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
577 │ │Column│Column│Column│Column│Column│Column│Column│
578 │ │ % │ % │ % │ % │ % │ % │ % │
579 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
580 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
581 │SAMPLE How certain │ │ │ │ │ │ │ │
582 │SOURCE: likely │ │ │ │ │ │ │ │
583 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
584 │ that likely │ │ │ │ │ │ │ │
585 │ drivers │ │ │ │ │ │ │ │
586 │ who have │ │ │ │ │ │ │ │
587 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
588 │ much to likely │ │ │ │ │ │ │ │
589 │ drink to │ │ │ │ │ │ │ │
590 │ drive │ │ │ │ │ │ │ │
591 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
592 │ will A. unlikely│ │ │ │ │ │ │ │
593 │ Get │ │ │ │ │ │ │ │
594 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
595 │ by the unlikely│ │ │ │ │ │ │ │
596 │ police? │ │ │ │ │ │ │ │
597 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
600 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
603 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
604 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
605 │group typical month did you have one or more │ │ │
606 │ alcoholic beverages to drink? │ │ │
607 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
608 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
609 │ typical month did you have one or more │ │ │
610 │ alcoholic beverages to drink? │ │ │
611 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
612 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
613 │ typical month did you have one or more │ │ │
614 │ alcoholic beverages to drink? │ │ │
615 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
616 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
617 │ typical month did you have one or more │ │ │
618 │ alcoholic beverages to drink? │ │ │
619 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
620 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
621 │ typical month did you have one or more │ │ │
622 │ alcoholic beverages to drink? │ │ │
623 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
624 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
625 │ older typical month did you have one or more │ │ │
626 │ alcoholic beverages to drink? │ │ │
627 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
632 AT_SETUP([CTABLES SLABELS])
633 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
634 AT_DATA([ctables.sps],
636 CTABLES /TABLE qn1 [COUNT COLPCT].
637 CTABLES /TABLE qn1 [COUNT COLPCT]
638 /SLABELS POSITION=ROW.
639 CTABLES /TABLE qn1 [COUNT COLPCT]
640 /SLABELS POSITION=ROW VISIBLE=NO.
642 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
644 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
647 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
648 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
649 │other motor vehicle? Several days a week│ 1274│ 18.3%│
650 │ Once a week or less│ 361│ 5.2%│
651 │ Only certain times │ 130│ 1.9%│
654 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
657 ╭────────────────────────────────────────────────────────────────────────┬─────╮
658 │ 1. How often do you usually drive a car or Every day Count │ 4667│
659 │other motor vehicle? Column │66.9%│
661 │ ╶───────────────────────────┼─────┤
662 │ Several days a week Count │ 1274│
665 │ ╶───────────────────────────┼─────┤
666 │ Once a week or less Count │ 361│
669 │ ╶───────────────────────────┼─────┤
670 │ Only certain times Count │ 130│
671 │ a year Column │ 1.9%│
673 │ ╶───────────────────────────┼─────┤
677 ╰────────────────────────────────────────────────────────────────────────┴─────╯
680 ╭────────────────────────────────────────────────────────────────────────┬─────╮
681 │ 1. How often do you usually drive a car or other Every day │ 4667│
682 │motor vehicle? │66.9%│
683 │ Several days a week │ 1274│
685 │ Once a week or less │ 361│
687 │ Only certain times a │ 130│
691 ╰────────────────────────────────────────────────────────────────────────┴─────╯
695 AT_SETUP([CTABLES simple totals])
696 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
697 AT_DATA([ctables.sps],
700 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
701 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
702 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
704 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
706 ╭────────────────────────────────────────────────────────────────────────┬─────╮
708 ├────────────────────────────────────────────────────────────────────────┼─────┤
709 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
710 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
713 │ Wine coolers │ 137│
714 │ Hard liquor or │ 888│
716 │ Flavored malt │ 83│
718 │ Number responding │ 4221│
719 ╰────────────────────────────────────────────────────────────────────────┴─────╯
722 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
724 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
725 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
726 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
728 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
729 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
730 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
732 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
733 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
734 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
736 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
737 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
738 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
740 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
741 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
742 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
744 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
748 AT_SETUP([CTABLES subtotals])
749 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
750 AT_DATA([ctables.sps],
752 CTABLES /TABLE=qn105ba BY qns1
753 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
754 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
755 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
756 CTABLES /TABLE=qn105ba BY qns1
757 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
758 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
760 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
762 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
763 │ │ S1. Including yourself, how many members of this household │
764 │ │ are age 16 or older? │
765 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
766 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
767 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
768 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
769 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
770 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
771 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
772 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
773 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
774 │ likely │ │ │ │ │ │ │ │
775 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
776 │ unlikely │ │ │ │ │ │ │ │
777 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
778 │ unlikely │ │ │ │ │ │ │ │
779 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
782 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
783 │ │ S1. Including yourself, how many members of this household │
784 │ │ are age 16 or older? │
785 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
786 │ │ │ │ │ │ │ │ 6 or │
787 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
788 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
789 │ │ │ │ │ │ Column│ │ │
790 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
791 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
792 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
793 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
794 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
795 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
796 │ likely │ │ │ │ │ │ │ │
797 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
798 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
799 │ unlikely │ │ │ │ │ │ │ │
800 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
801 │ unlikely │ │ │ │ │ │ │ │
802 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
803 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
806 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
807 │ │ S1. Including yourself, how many members of this household │
808 │ │ are age 16 or older? │
809 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
810 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
811 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
812 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
813 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
814 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
815 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
816 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
817 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
818 │ likely │ │ │ │ │ │ │ │
819 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
820 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
821 │ unlikely │ │ │ │ │ │ │ │
822 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
823 │ unlikely │ │ │ │ │ │ │ │
824 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
825 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
829 AT_SETUP([CTABLES PCOMPUTE])
830 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
831 AT_DATA([ctables.sps],
834 /PCOMPUTE &x=EXPR([3] + [4])
835 /PCOMPUTE &y=EXPR([4] + [5])
836 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
837 /PPROPERTIES &y LABEL='4+5'
838 /TABLE=qn105ba BY qns1
839 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
841 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
843 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
844 │ │ S1. Including yourself, how many members of this household │
845 │ │ are age 16 or older? │
846 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
847 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
848 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
849 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
850 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
851 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
852 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
853 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
854 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
855 │ likely │ │ │ │ │ │ │ │
856 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
857 │ unlikely │ │ │ │ │ │ │ │
858 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
859 │ unlikely │ │ │ │ │ │ │ │
860 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
864 AT_SETUP([CTABLES CLABELS])
865 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
866 AT_DATA([ctables.sps],
868 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
869 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
871 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
873 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
875 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
877 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
878 │ │ 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 │
879 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
880 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
881 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
882 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
883 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
884 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
885 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
888 ╭──────────────────────────────┬────────────╮
892 ├──────────────────────────────┼────────────┤
893 │Age group 15 or younger Male │ 0│
895 │ ╶────────────────────┼────────────┤
896 │ 16 to 25 Male │ 594│
898 │ ╶────────────────────┼────────────┤
899 │ 26 to 35 Male │ 476│
901 │ ╶────────────────────┼────────────┤
902 │ 36 to 45 Male │ 489│
904 │ ╶────────────────────┼────────────┤
905 │ 46 to 55 Male │ 526│
907 │ ╶────────────────────┼────────────┤
908 │ 56 to 65 Male │ 516│
910 │ ╶────────────────────┼────────────┤
911 │ 66 or older Male │ 531│
913 ╰──────────────────────────────┴────────────╯