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.
43 # AT_SETUP([CTABLES parsing])
44 # AT_DATA([ctables.sps],
45 # [[DATA LIST LIST NOTABLE /x y z.
46 # CTABLES /TABLE=(x + y) > z.
47 # CTABLES /TABLE=(x[c] + y[c]) > z.
48 # CTABLES /TABLE=(x + y) > z[c].
49 # CTABLES /TABLE=x BY y BY z.
50 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
51 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
53 # AT_CHECK([pspp ctables.sps])
56 AT_SETUP([CTABLES one categorical variable])
57 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
58 AT_DATA([ctables.sps],
61 CTABLES /TABLE BY qn1.
62 CTABLES /TABLE BY BY qn1.
64 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
66 ╭────────────────────────────────────────────────────────────────────────┬─────╮
68 ├────────────────────────────────────────────────────────────────────────┼─────┤
69 │ 1. How often do you usually drive a car or other Every day │ 4667│
70 │motor vehicle? Several days a week │ 1274│
71 │ Once a week or less │ 361│
72 │ Only certain times a │ 130│
75 ╰────────────────────────────────────────────────────────────────────────┴─────╯
78 ╭──────────────────────────────────────────────────────────────────────────────╮
79 │ 1. How often do you usually drive a car or other motor vehicle? │
80 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
81 │ │ Several days a │ Once a week or │ Only certain times a │ │
82 │Every day│ week │ less │ year │Never│
83 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
84 │ Count │ Count │ Count │ Count │Count│
85 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
86 │ 4667│ 1274│ 361│ 130│ 540│
87 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
99 AT_SETUP([CTABLES one scale variable])
100 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
101 AT_DATA([ctables.sps],
103 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
104 CTABLES /TABLE BY qnd1.
105 CTABLES /TABLE BY BY qnd1.
107 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
109 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
110 │ │Count│Mean│Std Deviation│Minimum│Maximum│
111 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
112 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
113 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
116 ╭──────────────────────────╮
117 │D1. AGE: What is your age?│
118 ├──────────────────────────┤
120 ├──────────────────────────┤
122 ╰──────────────────────────╯
125 D1. AGE: What is your age?
134 AT_SETUP([CTABLES simple stacking])
135 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
136 AT_DATA([ctables.sps],
138 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
140 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
142 ╭───────────────────────────────────────────────────────────────┬──────────────╮
149 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
150 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
151 │too much to drink to drive safely will A. Get certain │ │ │
152 │stopped by the police? Very likely │ 21%│ 22%│
153 │ Somewhat │ 38%│ 42%│
155 │ Somewhat │ 21%│ 18%│
159 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
160 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
161 │too much to drink to drive safely will B. Have an certain │ │ │
162 │accident? Very likely │ 36%│ 45%│
163 │ Somewhat │ 39%│ 32%│
169 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
170 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
171 │too much to drink to drive safely will C. Be certain │ │ │
172 │convicted for drunk driving? Very likely │ 32%│ 28%│
173 │ Somewhat │ 27%│ 32%│
175 │ Somewhat │ 15%│ 15%│
179 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
180 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
181 │too much to drink to drive safely will D. Be certain │ │ │
182 │arrested for drunk driving? Very likely │ 26%│ 27%│
183 │ Somewhat │ 32%│ 35%│
185 │ Somewhat │ 17%│ 15%│
189 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
193 AT_SETUP([CTABLES show or hide empty categories])
194 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
195 AT_DATA([ctables.sps],
197 IF (qn105ba = 2) qn105ba = 1.
198 IF (qns3a = 1) qns3a = 2.
199 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
200 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
201 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
202 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
203 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
204 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
205 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
207 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
209 ╭──────────────────────────────────────────────────────────────┬───────────────╮
216 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
217 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
218 │too much to drink to drive safely will A. Get certain │ │ │
219 │stopped by the police? Very likely│ .│ 0%│
226 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
229 ╭──────────────────────────────────────────────────────────────┬───────────────╮
236 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
237 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
238 │too much to drink to drive safely will A. Get certain │ │ │
239 │stopped by the police? Somewhat │ .│ 40%│
245 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
248 ╭────────────────────────────────────────────────────────────────────┬─────────╮
255 ├────────────────────────────────────────────────────────────────────┼─────────┤
256 │105b. How likely is it that drivers who have had too Almost │ 32%│
257 │much to drink to drive safely will A. Get stopped by certain │ │
258 │the police? Very likely │ 0%│
265 ╰────────────────────────────────────────────────────────────────────┴─────────╯
268 ╭────────────────────────────────────────────────────────────────────┬─────────╮
275 ├────────────────────────────────────────────────────────────────────┼─────────┤
276 │105b. How likely is it that drivers who have had too Almost │ 32%│
277 │much to drink to drive safely will A. Get stopped by certain │ │
278 │the police? Somewhat │ 40%│
284 ╰────────────────────────────────────────────────────────────────────┴─────────╯
288 AT_SETUP([CTABLES simple nesting])
289 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
290 AT_DATA([ctables.sps],
292 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
293 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
294 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
295 /CATEGORIES VARIABLES=qns3a TOTAL=YES
296 /CLABELS ROW=OPPOSITE.
298 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
300 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
303 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
304 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
305 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
306 │drive safely will A. Get stopped by Total │ 700│ 10%│
307 │the police? ╶──────────────────────────┼─────┼──────┤
308 │ Very S3a. Male │ 660│ 10%│
309 │ likely GENDER: Female│ 842│ 12%│
311 │ ╶──────────────────────────┼─────┼──────┤
312 │ Somewhat S3a. Male │ 1174│ 17%│
313 │ likely GENDER: Female│ 1589│ 23%│
315 │ ╶──────────────────────────┼─────┼──────┤
316 │ Somewhat S3a. Male │ 640│ 9%│
317 │ unlikely GENDER: Female│ 667│ 10%│
319 │ ╶──────────────────────────┼─────┼──────┤
320 │ Very S3a. Male │ 311│ 5%│
321 │ unlikely GENDER: Female│ 298│ 4%│
323 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
324 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
325 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
326 │drive safely will B. Have an accident? Total │ 1100│ 16%│
327 │ ╶──────────────────────────┼─────┼──────┤
328 │ Very S3a. Male │ 1104│ 16%│
329 │ likely GENDER: Female│ 1715│ 25%│
331 │ ╶──────────────────────────┼─────┼──────┤
332 │ Somewhat S3a. Male │ 1203│ 17%│
333 │ likely GENDER: Female│ 1214│ 18%│
335 │ ╶──────────────────────────┼─────┼──────┤
336 │ Somewhat S3a. Male │ 262│ 4%│
337 │ unlikely GENDER: Female│ 168│ 2%│
339 │ ╶──────────────────────────┼─────┼──────┤
340 │ Very S3a. Male │ 81│ 1%│
341 │ unlikely GENDER: Female│ 59│ 1%│
343 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
344 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
345 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
346 │drive safely will C. Be convicted for Total │ 1149│ 17%│
347 │drunk driving? ╶──────────────────────────┼─────┼──────┤
348 │ Very S3a. Male │ 988│ 14%│
349 │ likely GENDER: Female│ 1049│ 15%│
351 │ ╶──────────────────────────┼─────┼──────┤
352 │ Somewhat S3a. Male │ 822│ 12%│
353 │ likely GENDER: Female│ 1210│ 18%│
355 │ ╶──────────────────────────┼─────┼──────┤
356 │ Somewhat S3a. Male │ 446│ 7%│
357 │ unlikely GENDER: Female│ 548│ 8%│
359 │ ╶──────────────────────────┼─────┼──────┤
360 │ Very S3a. Male │ 268│ 4%│
361 │ unlikely GENDER: Female│ 354│ 5%│
363 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
364 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
365 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
366 │drive safely will D. Be arrested for Total │ 1101│ 16%│
367 │drunk driving? ╶──────────────────────────┼─────┼──────┤
368 │ Very S3a. Male │ 805│ 12%│
369 │ likely GENDER: Female│ 1029│ 15%│
371 │ ╶──────────────────────────┼─────┼──────┤
372 │ Somewhat S3a. Male │ 975│ 14%│
373 │ likely GENDER: Female│ 1332│ 19%│
375 │ ╶──────────────────────────┼─────┼──────┤
376 │ Somewhat S3a. Male │ 535│ 8%│
377 │ unlikely GENDER: Female│ 560│ 8%│
379 │ ╶──────────────────────────┼─────┼──────┤
380 │ Very S3a. Male │ 270│ 4%│
381 │ unlikely GENDER: Female│ 279│ 4%│
383 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
386 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
387 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
388 │ │ certain│likely│ likely │ unlikely│unlikely│
389 │ ├────────┼──────┼─────────┼─────────┼────────┤
391 │ │ Table %│ % │ Table % │ Table % │ Table %│
392 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
393 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
394 │GENDER: is it that drivers│ │ │ │ │ │
395 │ who have had too │ │ │ │ │ │
396 │ much to drink to │ │ │ │ │ │
397 │ drive safely will │ │ │ │ │ │
398 │ A. Get stopped by │ │ │ │ │ │
399 │ the police? │ │ │ │ │ │
400 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
401 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
402 │ is it that drivers│ │ │ │ │ │
403 │ who have had too │ │ │ │ │ │
404 │ much to drink to │ │ │ │ │ │
405 │ drive safely will │ │ │ │ │ │
406 │ A. Get stopped by │ │ │ │ │ │
407 │ the police? │ │ │ │ │ │
408 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
409 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
410 │ is it that drivers│ │ │ │ │ │
411 │ who have had too │ │ │ │ │ │
412 │ much to drink to │ │ │ │ │ │
413 │ drive safely will │ │ │ │ │ │
414 │ A. Get stopped by │ │ │ │ │ │
415 │ the police? │ │ │ │ │ │
416 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
417 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
418 │GENDER: is it that drivers│ │ │ │ │ │
419 │ who have had too │ │ │ │ │ │
420 │ much to drink to │ │ │ │ │ │
421 │ drive safely will │ │ │ │ │ │
422 │ B. Have an │ │ │ │ │ │
423 │ accident? │ │ │ │ │ │
424 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
425 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
426 │ is it that drivers│ │ │ │ │ │
427 │ who have had too │ │ │ │ │ │
428 │ much to drink to │ │ │ │ │ │
429 │ drive safely will │ │ │ │ │ │
430 │ B. Have an │ │ │ │ │ │
431 │ accident? │ │ │ │ │ │
432 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
433 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
434 │ is it that drivers│ │ │ │ │ │
435 │ who have had too │ │ │ │ │ │
436 │ much to drink to │ │ │ │ │ │
437 │ drive safely will │ │ │ │ │ │
438 │ B. Have an │ │ │ │ │ │
439 │ accident? │ │ │ │ │ │
440 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
441 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
442 │GENDER: is it that drivers│ │ │ │ │ │
443 │ who have had too │ │ │ │ │ │
444 │ much to drink to │ │ │ │ │ │
445 │ drive safely will │ │ │ │ │ │
446 │ C. Be convicted │ │ │ │ │ │
447 │ for drunk driving?│ │ │ │ │ │
448 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
449 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
450 │ is it that drivers│ │ │ │ │ │
451 │ who have had too │ │ │ │ │ │
452 │ much to drink to │ │ │ │ │ │
453 │ drive safely will │ │ │ │ │ │
454 │ C. Be convicted │ │ │ │ │ │
455 │ for drunk driving?│ │ │ │ │ │
456 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
457 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
458 │ is it that drivers│ │ │ │ │ │
459 │ who have had too │ │ │ │ │ │
460 │ much to drink to │ │ │ │ │ │
461 │ drive safely will │ │ │ │ │ │
462 │ C. Be convicted │ │ │ │ │ │
463 │ for drunk driving?│ │ │ │ │ │
464 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
465 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
466 │GENDER: is it that drivers│ │ │ │ │ │
467 │ who have had too │ │ │ │ │ │
468 │ much to drink to │ │ │ │ │ │
469 │ drive safely will │ │ │ │ │ │
470 │ D. Be arrested for│ │ │ │ │ │
471 │ drunk driving? │ │ │ │ │ │
472 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
473 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
474 │ is it that drivers│ │ │ │ │ │
475 │ who have had too │ │ │ │ │ │
476 │ much to drink to │ │ │ │ │ │
477 │ drive safely will │ │ │ │ │ │
478 │ D. Be arrested for│ │ │ │ │ │
479 │ drunk driving? │ │ │ │ │ │
480 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
481 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
482 │ is it that drivers│ │ │ │ │ │
483 │ who have had too │ │ │ │ │ │
484 │ much to drink to │ │ │ │ │ │
485 │ drive safely will │ │ │ │ │ │
486 │ D. Be arrested for│ │ │ │ │ │
487 │ drunk driving? │ │ │ │ │ │
488 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
492 AT_SETUP([CTABLES nesting and scale variables])
493 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
494 AT_DATA([ctables.sps],
496 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
497 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
498 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
499 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
500 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
502 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
504 ╭─────────────────────────────────────────────────────────────────┬────────────╮
510 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
511 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
512 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
514 │ Once a week or │ 44│ 54│
516 │ Only certain │ 34│ 41│
519 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
522 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
523 │ │Minimum│Maximum│Mean│
524 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
525 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
526 │What is GENDER: months, has there been a │ │ │ │
527 │your time when you felt you │ │ │ │
528 │age? should cut down on your No │ 16│ 86│ 46│
530 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
531 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
532 │ months, has there been a │ │ │ │
533 │ time when you felt you │ │ │ │
534 │ should cut down on your No │ 16│ 86│ 48│
536 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
537 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
538 │What is GENDER: months, has there been a │ │ │ │
539 │your time when people criticized No │ 16│ 86│ 46│
540 │age? your drinking? │ │ │ │
541 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
542 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
543 │ months, has there been a │ │ │ │
544 │ time when people criticized No │ 16│ 86│ 48│
545 │ your drinking? │ │ │ │
546 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
549 ╭─────────────────────────────┬────────────────────────────────────────────────╮
550 │ │S1. Including yourself, how many members of this│
551 │ │ household are age 16 or older? │
552 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
553 │ │ │ │ │ │ │ │ 6 or │
554 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
555 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
556 │ │Column│Column│Column│Column│Column│Column│Column│
557 │ │ % │ % │ % │ % │ % │ % │ % │
558 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
559 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
560 │SAMPLE How certain │ │ │ │ │ │ │ │
561 │SOURCE: likely │ │ │ │ │ │ │ │
562 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
563 │ that likely │ │ │ │ │ │ │ │
564 │ drivers │ │ │ │ │ │ │ │
565 │ who have │ │ │ │ │ │ │ │
566 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
567 │ much to likely │ │ │ │ │ │ │ │
568 │ drink to │ │ │ │ │ │ │ │
569 │ drive │ │ │ │ │ │ │ │
570 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
571 │ will A. unlikely│ │ │ │ │ │ │ │
572 │ Get │ │ │ │ │ │ │ │
573 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
574 │ by the unlikely│ │ │ │ │ │ │ │
575 │ police? │ │ │ │ │ │ │ │
576 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
579 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
582 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
583 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
584 │group typical month did you have one or more │ │ │
585 │ alcoholic beverages to drink? │ │ │
586 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
587 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
588 │ typical month did you have one or more │ │ │
589 │ alcoholic beverages to drink? │ │ │
590 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
591 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
592 │ typical month did you have one or more │ │ │
593 │ alcoholic beverages to drink? │ │ │
594 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
595 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
596 │ typical month did you have one or more │ │ │
597 │ alcoholic beverages to drink? │ │ │
598 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
599 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
600 │ typical month did you have one or more │ │ │
601 │ alcoholic beverages to drink? │ │ │
602 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
603 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
604 │ older typical month did you have one or more │ │ │
605 │ alcoholic beverages to drink? │ │ │
606 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
611 AT_SETUP([CTABLES SLABELS])
612 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
613 AT_DATA([ctables.sps],
615 CTABLES /TABLE qn1 [COUNT COLPCT].
616 CTABLES /TABLE qn1 [COUNT COLPCT]
617 /SLABELS POSITION=ROW.
618 CTABLES /TABLE qn1 [COUNT COLPCT]
619 /SLABELS POSITION=ROW VISIBLE=NO.
621 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
623 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
626 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
627 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
628 │other motor vehicle? Several days a week│ 1274│ 18.3%│
629 │ Once a week or less│ 361│ 5.2%│
630 │ Only certain times │ 130│ 1.9%│
633 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
636 ╭────────────────────────────────────────────────────────────────────────┬─────╮
637 │ 1. How often do you usually drive a car or Every day Count │ 4667│
638 │other motor vehicle? Column │66.9%│
640 │ ╶───────────────────────────┼─────┤
641 │ Several days a week Count │ 1274│
644 │ ╶───────────────────────────┼─────┤
645 │ Once a week or less Count │ 361│
648 │ ╶───────────────────────────┼─────┤
649 │ Only certain times Count │ 130│
650 │ a year Column │ 1.9%│
652 │ ╶───────────────────────────┼─────┤
656 ╰────────────────────────────────────────────────────────────────────────┴─────╯
659 ╭────────────────────────────────────────────────────────────────────────┬─────╮
660 │ 1. How often do you usually drive a car or other Every day │ 4667│
661 │motor vehicle? │66.9%│
662 │ Several days a week │ 1274│
664 │ Once a week or less │ 361│
666 │ Only certain times a │ 130│
670 ╰────────────────────────────────────────────────────────────────────────┴─────╯
674 AT_SETUP([CTABLES simple totals])
675 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
676 AT_DATA([ctables.sps],
679 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
680 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
681 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
683 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
685 ╭────────────────────────────────────────────────────────────────────────┬─────╮
687 ├────────────────────────────────────────────────────────────────────────┼─────┤
688 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
689 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
692 │ Wine coolers │ 137│
693 │ Hard liquor or │ 888│
695 │ Flavored malt │ 83│
697 │ Number responding │ 4221│
698 ╰────────────────────────────────────────────────────────────────────────┴─────╯
701 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
703 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
704 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
705 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
707 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
708 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
709 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
711 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
712 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
713 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
715 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
716 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
717 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
719 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
720 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
721 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
723 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
727 AT_SETUP([CTABLES subtotals])
728 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
729 AT_DATA([ctables.sps],
731 CTABLES /TABLE=qn105ba BY qns1
732 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
733 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
734 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
735 CTABLES /TABLE=qn105ba BY qns1
736 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
737 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
739 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
741 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
742 │ │ S1. Including yourself, how many members of this household │
743 │ │ are age 16 or older? │
744 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
745 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
746 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
747 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
748 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
749 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
750 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
751 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
752 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
753 │ likely │ │ │ │ │ │ │ │
754 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
755 │ unlikely │ │ │ │ │ │ │ │
756 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
757 │ unlikely │ │ │ │ │ │ │ │
758 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
761 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
762 │ │ S1. Including yourself, how many members of this household │
763 │ │ are age 16 or older? │
764 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
765 │ │ │ │ │ │ │ │ 6 or │
766 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
767 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
768 │ │ │ │ │ │ Column│ │ │
769 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
770 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
771 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
772 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
773 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
774 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
775 │ likely │ │ │ │ │ │ │ │
776 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
777 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
778 │ unlikely │ │ │ │ │ │ │ │
779 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
780 │ unlikely │ │ │ │ │ │ │ │
781 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
782 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
785 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
786 │ │ S1. Including yourself, how many members of this household │
787 │ │ are age 16 or older? │
788 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
789 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
790 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
791 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
792 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
793 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
794 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
795 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
796 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
797 │ likely │ │ │ │ │ │ │ │
798 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
799 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
800 │ unlikely │ │ │ │ │ │ │ │
801 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
802 │ unlikely │ │ │ │ │ │ │ │
803 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
804 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯