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 - PCOMPUTE and PPROPERTIES.
41 dnl - HIDESMALLCOUNTS.
42 dnl - Are string ranges a thing?
44 # AT_SETUP([CTABLES parsing])
45 # AT_DATA([ctables.sps],
46 # [[DATA LIST LIST NOTABLE /x y z.
47 # CTABLES /TABLE=(x + y) > z.
48 # CTABLES /TABLE=(x[c] + y[c]) > z.
49 # CTABLES /TABLE=(x + y) > z[c].
50 # CTABLES /TABLE=x BY y BY z.
51 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
52 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
54 # AT_CHECK([pspp ctables.sps])
57 AT_SETUP([CTABLES one categorical variable])
58 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
59 AT_DATA([ctables.sps],
62 CTABLES /TABLE BY qn1.
63 CTABLES /TABLE BY BY qn1.
65 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
67 ╭────────────────────────────────────────────────────────────────────────┬─────╮
69 ├────────────────────────────────────────────────────────────────────────┼─────┤
70 │ 1. How often do you usually drive a car or other Every day │ 4667│
71 │motor vehicle? Several days a week │ 1274│
72 │ Once a week or less │ 361│
73 │ Only certain times a │ 130│
76 ╰────────────────────────────────────────────────────────────────────────┴─────╯
79 ╭──────────────────────────────────────────────────────────────────────────────╮
80 │ 1. How often do you usually drive a car or other motor vehicle? │
81 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
82 │ │ Several days a │ Once a week or │ Only certain times a │ │
83 │Every day│ week │ less │ year │Never│
84 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
85 │ Count │ Count │ Count │ Count │Count│
86 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
87 │ 4667│ 1274│ 361│ 130│ 540│
88 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
100 AT_SETUP([CTABLES one scale variable])
101 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
102 AT_DATA([ctables.sps],
104 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
105 CTABLES /TABLE BY qnd1.
106 CTABLES /TABLE BY BY qnd1.
108 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
110 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
111 │ │Count│Mean│Std Deviation│Minimum│Maximum│
112 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
113 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
114 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
117 ╭──────────────────────────╮
118 │D1. AGE: What is your age?│
119 ├──────────────────────────┤
121 ├──────────────────────────┤
123 ╰──────────────────────────╯
126 D1. AGE: What is your age?
135 AT_SETUP([CTABLES simple stacking])
136 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
137 AT_DATA([ctables.sps],
139 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
141 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
143 ╭───────────────────────────────────────────────────────────────┬──────────────╮
150 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
151 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
152 │too much to drink to drive safely will A. Get certain │ │ │
153 │stopped by the police? Very likely │ 21%│ 22%│
154 │ Somewhat │ 38%│ 42%│
156 │ Somewhat │ 21%│ 18%│
160 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
161 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
162 │too much to drink to drive safely will B. Have an certain │ │ │
163 │accident? Very likely │ 36%│ 45%│
164 │ Somewhat │ 39%│ 32%│
170 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
171 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
172 │too much to drink to drive safely will C. Be certain │ │ │
173 │convicted for drunk driving? Very likely │ 32%│ 28%│
174 │ Somewhat │ 27%│ 32%│
176 │ Somewhat │ 15%│ 15%│
180 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
181 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
182 │too much to drink to drive safely will D. Be certain │ │ │
183 │arrested for drunk driving? Very likely │ 26%│ 27%│
184 │ Somewhat │ 32%│ 35%│
186 │ Somewhat │ 17%│ 15%│
190 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
194 AT_SETUP([CTABLES show or hide empty categories])
195 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
196 AT_DATA([ctables.sps],
198 IF (qn105ba = 2) qn105ba = 1.
199 IF (qns3a = 1) qns3a = 2.
200 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
201 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
202 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
203 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
204 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
205 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
206 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
208 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
210 ╭──────────────────────────────────────────────────────────────┬───────────────╮
217 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
218 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
219 │too much to drink to drive safely will A. Get certain │ │ │
220 │stopped by the police? Very likely│ .│ 0%│
227 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
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? Somewhat │ .│ 40%│
246 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
249 ╭────────────────────────────────────────────────────────────────────┬─────────╮
256 ├────────────────────────────────────────────────────────────────────┼─────────┤
257 │105b. How likely is it that drivers who have had too Almost │ 32%│
258 │much to drink to drive safely will A. Get stopped by certain │ │
259 │the police? Very likely │ 0%│
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? Somewhat │ 40%│
285 ╰────────────────────────────────────────────────────────────────────┴─────────╯
289 AT_SETUP([CTABLES simple nesting])
290 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
291 AT_DATA([ctables.sps],
293 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
294 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
295 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
296 /CATEGORIES VARIABLES=qns3a TOTAL=YES
297 /CLABELS ROW=OPPOSITE.
299 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
301 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
304 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
305 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
306 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
307 │drive safely will A. Get stopped by Total │ 700│ 10%│
308 │the police? ╶──────────────────────────┼─────┼──────┤
309 │ Very S3a. Male │ 660│ 10%│
310 │ likely GENDER: Female│ 842│ 12%│
312 │ ╶──────────────────────────┼─────┼──────┤
313 │ Somewhat S3a. Male │ 1174│ 17%│
314 │ likely GENDER: Female│ 1589│ 23%│
316 │ ╶──────────────────────────┼─────┼──────┤
317 │ Somewhat S3a. Male │ 640│ 9%│
318 │ unlikely GENDER: Female│ 667│ 10%│
320 │ ╶──────────────────────────┼─────┼──────┤
321 │ Very S3a. Male │ 311│ 5%│
322 │ unlikely GENDER: Female│ 298│ 4%│
324 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
325 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
326 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
327 │drive safely will B. Have an accident? Total │ 1100│ 16%│
328 │ ╶──────────────────────────┼─────┼──────┤
329 │ Very S3a. Male │ 1104│ 16%│
330 │ likely GENDER: Female│ 1715│ 25%│
332 │ ╶──────────────────────────┼─────┼──────┤
333 │ Somewhat S3a. Male │ 1203│ 17%│
334 │ likely GENDER: Female│ 1214│ 18%│
336 │ ╶──────────────────────────┼─────┼──────┤
337 │ Somewhat S3a. Male │ 262│ 4%│
338 │ unlikely GENDER: Female│ 168│ 2%│
340 │ ╶──────────────────────────┼─────┼──────┤
341 │ Very S3a. Male │ 81│ 1%│
342 │ unlikely GENDER: Female│ 59│ 1%│
344 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
345 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
346 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
347 │drive safely will C. Be convicted for Total │ 1149│ 17%│
348 │drunk driving? ╶──────────────────────────┼─────┼──────┤
349 │ Very S3a. Male │ 988│ 14%│
350 │ likely GENDER: Female│ 1049│ 15%│
352 │ ╶──────────────────────────┼─────┼──────┤
353 │ Somewhat S3a. Male │ 822│ 12%│
354 │ likely GENDER: Female│ 1210│ 18%│
356 │ ╶──────────────────────────┼─────┼──────┤
357 │ Somewhat S3a. Male │ 446│ 7%│
358 │ unlikely GENDER: Female│ 548│ 8%│
360 │ ╶──────────────────────────┼─────┼──────┤
361 │ Very S3a. Male │ 268│ 4%│
362 │ unlikely GENDER: Female│ 354│ 5%│
364 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
365 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
366 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
367 │drive safely will D. Be arrested for Total │ 1101│ 16%│
368 │drunk driving? ╶──────────────────────────┼─────┼──────┤
369 │ Very S3a. Male │ 805│ 12%│
370 │ likely GENDER: Female│ 1029│ 15%│
372 │ ╶──────────────────────────┼─────┼──────┤
373 │ Somewhat S3a. Male │ 975│ 14%│
374 │ likely GENDER: Female│ 1332│ 19%│
376 │ ╶──────────────────────────┼─────┼──────┤
377 │ Somewhat S3a. Male │ 535│ 8%│
378 │ unlikely GENDER: Female│ 560│ 8%│
380 │ ╶──────────────────────────┼─────┼──────┤
381 │ Very S3a. Male │ 270│ 4%│
382 │ unlikely GENDER: Female│ 279│ 4%│
384 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
387 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
388 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
389 │ │ certain│likely│ likely │ unlikely│unlikely│
390 │ ├────────┼──────┼─────────┼─────────┼────────┤
392 │ │ Table %│ % │ Table % │ Table % │ Table %│
393 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
394 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
395 │GENDER: is it that drivers│ │ │ │ │ │
396 │ who have had too │ │ │ │ │ │
397 │ much to drink to │ │ │ │ │ │
398 │ drive safely will │ │ │ │ │ │
399 │ A. Get stopped by │ │ │ │ │ │
400 │ the police? │ │ │ │ │ │
401 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
402 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
403 │ is it that drivers│ │ │ │ │ │
404 │ who have had too │ │ │ │ │ │
405 │ much to drink to │ │ │ │ │ │
406 │ drive safely will │ │ │ │ │ │
407 │ A. Get stopped by │ │ │ │ │ │
408 │ the police? │ │ │ │ │ │
409 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
410 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
411 │ is it that drivers│ │ │ │ │ │
412 │ who have had too │ │ │ │ │ │
413 │ much to drink to │ │ │ │ │ │
414 │ drive safely will │ │ │ │ │ │
415 │ A. Get stopped by │ │ │ │ │ │
416 │ the police? │ │ │ │ │ │
417 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
418 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
419 │GENDER: is it that drivers│ │ │ │ │ │
420 │ who have had too │ │ │ │ │ │
421 │ much to drink to │ │ │ │ │ │
422 │ drive safely will │ │ │ │ │ │
423 │ B. Have an │ │ │ │ │ │
424 │ accident? │ │ │ │ │ │
425 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
426 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
427 │ is it that drivers│ │ │ │ │ │
428 │ who have had too │ │ │ │ │ │
429 │ much to drink to │ │ │ │ │ │
430 │ drive safely will │ │ │ │ │ │
431 │ B. Have an │ │ │ │ │ │
432 │ accident? │ │ │ │ │ │
433 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
434 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
435 │ is it that drivers│ │ │ │ │ │
436 │ who have had too │ │ │ │ │ │
437 │ much to drink to │ │ │ │ │ │
438 │ drive safely will │ │ │ │ │ │
439 │ B. Have an │ │ │ │ │ │
440 │ accident? │ │ │ │ │ │
441 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
442 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
443 │GENDER: is it that drivers│ │ │ │ │ │
444 │ who have had too │ │ │ │ │ │
445 │ much to drink to │ │ │ │ │ │
446 │ drive safely will │ │ │ │ │ │
447 │ C. Be convicted │ │ │ │ │ │
448 │ for drunk driving?│ │ │ │ │ │
449 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
450 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
451 │ is it that drivers│ │ │ │ │ │
452 │ who have had too │ │ │ │ │ │
453 │ much to drink to │ │ │ │ │ │
454 │ drive safely will │ │ │ │ │ │
455 │ C. Be convicted │ │ │ │ │ │
456 │ for drunk driving?│ │ │ │ │ │
457 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
458 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
459 │ is it that drivers│ │ │ │ │ │
460 │ who have had too │ │ │ │ │ │
461 │ much to drink to │ │ │ │ │ │
462 │ drive safely will │ │ │ │ │ │
463 │ C. Be convicted │ │ │ │ │ │
464 │ for drunk driving?│ │ │ │ │ │
465 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
466 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
467 │GENDER: is it that drivers│ │ │ │ │ │
468 │ who have had too │ │ │ │ │ │
469 │ much to drink to │ │ │ │ │ │
470 │ drive safely will │ │ │ │ │ │
471 │ D. Be arrested for│ │ │ │ │ │
472 │ drunk driving? │ │ │ │ │ │
473 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
474 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
475 │ is it that drivers│ │ │ │ │ │
476 │ who have had too │ │ │ │ │ │
477 │ much to drink to │ │ │ │ │ │
478 │ drive safely will │ │ │ │ │ │
479 │ D. Be arrested for│ │ │ │ │ │
480 │ drunk driving? │ │ │ │ │ │
481 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
482 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
483 │ is it that drivers│ │ │ │ │ │
484 │ who have had too │ │ │ │ │ │
485 │ much to drink to │ │ │ │ │ │
486 │ drive safely will │ │ │ │ │ │
487 │ D. Be arrested for│ │ │ │ │ │
488 │ drunk driving? │ │ │ │ │ │
489 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
493 AT_SETUP([CTABLES nesting and scale variables])
494 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
495 AT_DATA([ctables.sps],
497 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
498 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
499 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
500 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
501 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
503 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
505 ╭─────────────────────────────────────────────────────────────────┬────────────╮
511 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
512 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
513 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
515 │ Once a week or │ 44│ 54│
517 │ Only certain │ 34│ 41│
520 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
523 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
524 │ │Minimum│Maximum│Mean│
525 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
526 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
527 │What is GENDER: months, has there been a │ │ │ │
528 │your time when you felt you │ │ │ │
529 │age? should cut down on your No │ 16│ 86│ 46│
531 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
532 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
533 │ months, has there been a │ │ │ │
534 │ time when you felt you │ │ │ │
535 │ should cut down on your No │ 16│ 86│ 48│
537 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
538 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
539 │What is GENDER: months, has there been a │ │ │ │
540 │your time when people criticized No │ 16│ 86│ 46│
541 │age? your drinking? │ │ │ │
542 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
543 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
544 │ months, has there been a │ │ │ │
545 │ time when people criticized No │ 16│ 86│ 48│
546 │ your drinking? │ │ │ │
547 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
550 ╭─────────────────────────────┬────────────────────────────────────────────────╮
551 │ │S1. Including yourself, how many members of this│
552 │ │ household are age 16 or older? │
553 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
554 │ │ │ │ │ │ │ │ 6 or │
555 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
556 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
557 │ │Column│Column│Column│Column│Column│Column│Column│
558 │ │ % │ % │ % │ % │ % │ % │ % │
559 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
560 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
561 │SAMPLE How certain │ │ │ │ │ │ │ │
562 │SOURCE: likely │ │ │ │ │ │ │ │
563 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
564 │ that likely │ │ │ │ │ │ │ │
565 │ drivers │ │ │ │ │ │ │ │
566 │ who have │ │ │ │ │ │ │ │
567 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
568 │ much to likely │ │ │ │ │ │ │ │
569 │ drink to │ │ │ │ │ │ │ │
570 │ drive │ │ │ │ │ │ │ │
571 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
572 │ will A. unlikely│ │ │ │ │ │ │ │
573 │ Get │ │ │ │ │ │ │ │
574 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
575 │ by the unlikely│ │ │ │ │ │ │ │
576 │ police? │ │ │ │ │ │ │ │
577 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
580 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
583 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
584 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
585 │group typical month did you have one or more │ │ │
586 │ alcoholic beverages to drink? │ │ │
587 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
588 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
589 │ typical month did you have one or more │ │ │
590 │ alcoholic beverages to drink? │ │ │
591 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
592 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
593 │ typical month did you have one or more │ │ │
594 │ alcoholic beverages to drink? │ │ │
595 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
596 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
597 │ typical month did you have one or more │ │ │
598 │ alcoholic beverages to drink? │ │ │
599 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
600 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
601 │ typical month did you have one or more │ │ │
602 │ alcoholic beverages to drink? │ │ │
603 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
604 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
605 │ older typical month did you have one or more │ │ │
606 │ alcoholic beverages to drink? │ │ │
607 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
612 AT_SETUP([CTABLES SLABELS])
613 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
614 AT_DATA([ctables.sps],
616 CTABLES /TABLE qn1 [COUNT COLPCT].
617 CTABLES /TABLE qn1 [COUNT COLPCT]
618 /SLABELS POSITION=ROW.
619 CTABLES /TABLE qn1 [COUNT COLPCT]
620 /SLABELS POSITION=ROW VISIBLE=NO.
622 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
624 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
627 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
628 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
629 │other motor vehicle? Several days a week│ 1274│ 18.3%│
630 │ Once a week or less│ 361│ 5.2%│
631 │ Only certain times │ 130│ 1.9%│
634 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
637 ╭────────────────────────────────────────────────────────────────────────┬─────╮
638 │ 1. How often do you usually drive a car or Every day Count │ 4667│
639 │other motor vehicle? Column │66.9%│
641 │ ╶───────────────────────────┼─────┤
642 │ Several days a week Count │ 1274│
645 │ ╶───────────────────────────┼─────┤
646 │ Once a week or less Count │ 361│
649 │ ╶───────────────────────────┼─────┤
650 │ Only certain times Count │ 130│
651 │ a year Column │ 1.9%│
653 │ ╶───────────────────────────┼─────┤
657 ╰────────────────────────────────────────────────────────────────────────┴─────╯
660 ╭────────────────────────────────────────────────────────────────────────┬─────╮
661 │ 1. How often do you usually drive a car or other Every day │ 4667│
662 │motor vehicle? │66.9%│
663 │ Several days a week │ 1274│
665 │ Once a week or less │ 361│
667 │ Only certain times a │ 130│
671 ╰────────────────────────────────────────────────────────────────────────┴─────╯
675 AT_SETUP([CTABLES simple totals])
676 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
677 AT_DATA([ctables.sps],
680 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
681 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
682 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
684 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
686 ╭────────────────────────────────────────────────────────────────────────┬─────╮
688 ├────────────────────────────────────────────────────────────────────────┼─────┤
689 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
690 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
693 │ Wine coolers │ 137│
694 │ Hard liquor or │ 888│
696 │ Flavored malt │ 83│
698 │ Number responding │ 4221│
699 ╰────────────────────────────────────────────────────────────────────────┴─────╯
702 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
704 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
705 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
706 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
708 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
709 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
710 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
712 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
713 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
714 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
716 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
717 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
718 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
720 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
721 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
722 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
724 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
728 AT_SETUP([CTABLES subtotals])
729 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
730 AT_DATA([ctables.sps],
732 CTABLES /TABLE=qn105ba BY qns1
733 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
734 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
735 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
736 CTABLES /TABLE=qn105ba BY qns1
737 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
738 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
740 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
742 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
743 │ │ S1. Including yourself, how many members of this household │
744 │ │ are age 16 or older? │
745 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
746 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
747 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
748 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
749 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
750 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
751 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
752 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
753 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
754 │ likely │ │ │ │ │ │ │ │
755 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
756 │ unlikely │ │ │ │ │ │ │ │
757 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
758 │ unlikely │ │ │ │ │ │ │ │
759 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
762 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
763 │ │ S1. Including yourself, how many members of this household │
764 │ │ are age 16 or older? │
765 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
766 │ │ │ │ │ │ │ │ 6 or │
767 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
768 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
769 │ │ │ │ │ │ Column│ │ │
770 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
771 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
772 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
773 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
774 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
775 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
776 │ likely │ │ │ │ │ │ │ │
777 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
778 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
779 │ unlikely │ │ │ │ │ │ │ │
780 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
781 │ unlikely │ │ │ │ │ │ │ │
782 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
783 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
786 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
787 │ │ S1. Including yourself, how many members of this household │
788 │ │ are age 16 or older? │
789 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
790 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
791 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
792 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
793 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
794 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
795 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
796 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
797 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
798 │ likely │ │ │ │ │ │ │ │
799 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
800 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
801 │ unlikely │ │ │ │ │ │ │ │
802 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
803 │ unlikely │ │ │ │ │ │ │ │
804 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
805 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯