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?
48 # AT_SETUP([CTABLES parsing])
49 # AT_DATA([ctables.sps],
50 # [[DATA LIST LIST NOTABLE /x y z.
51 # CTABLES /TABLE=(x + y) > z.
52 # CTABLES /TABLE=(x[c] + y[c]) > z.
53 # CTABLES /TABLE=(x + y) > z[c].
54 # CTABLES /TABLE=x BY y BY z.
55 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
56 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
58 # AT_CHECK([pspp ctables.sps])
61 AT_SETUP([CTABLES one categorical variable])
62 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
63 AT_DATA([ctables.sps],
66 CTABLES /TABLE BY qn1.
67 CTABLES /TABLE BY BY qn1.
69 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
71 ╭────────────────────────────────────────────────────────────────────────┬─────╮
73 ├────────────────────────────────────────────────────────────────────────┼─────┤
74 │ 1. How often do you usually drive a car or other Every day │ 4667│
75 │motor vehicle? Several days a week │ 1274│
76 │ Once a week or less │ 361│
77 │ Only certain times a │ 130│
80 ╰────────────────────────────────────────────────────────────────────────┴─────╯
83 ╭──────────────────────────────────────────────────────────────────────────────╮
84 │ 1. How often do you usually drive a car or other motor vehicle? │
85 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
86 │ │ Several days a │ Once a week or │ Only certain times a │ │
87 │Every day│ week │ less │ year │Never│
88 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
89 │ Count │ Count │ Count │ Count │Count│
90 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
91 │ 4667│ 1274│ 361│ 130│ 540│
92 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
104 AT_SETUP([CTABLES one scale variable])
105 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
106 AT_DATA([ctables.sps],
108 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
109 CTABLES /TABLE BY qnd1.
110 CTABLES /TABLE BY BY qnd1.
112 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
114 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
115 │ │Count│Mean│Std Deviation│Minimum│Maximum│
116 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
117 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
118 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
121 ╭──────────────────────────╮
122 │D1. AGE: What is your age?│
123 ├──────────────────────────┤
125 ├──────────────────────────┤
127 ╰──────────────────────────╯
130 D1. AGE: What is your age?
139 AT_SETUP([CTABLES simple stacking])
140 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
141 AT_DATA([ctables.sps],
143 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
145 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
147 ╭───────────────────────────────────────────────────────────────┬──────────────╮
154 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
155 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
156 │too much to drink to drive safely will A. Get certain │ │ │
157 │stopped by the police? Very likely │ 21%│ 22%│
158 │ Somewhat │ 38%│ 42%│
160 │ Somewhat │ 21%│ 18%│
164 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
165 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
166 │too much to drink to drive safely will B. Have an certain │ │ │
167 │accident? Very likely │ 36%│ 45%│
168 │ Somewhat │ 39%│ 32%│
174 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
175 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
176 │too much to drink to drive safely will C. Be certain │ │ │
177 │convicted for drunk driving? Very likely │ 32%│ 28%│
178 │ Somewhat │ 27%│ 32%│
180 │ Somewhat │ 15%│ 15%│
184 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
185 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
186 │too much to drink to drive safely will D. Be certain │ │ │
187 │arrested for drunk driving? Very likely │ 26%│ 27%│
188 │ Somewhat │ 32%│ 35%│
190 │ Somewhat │ 17%│ 15%│
194 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
198 AT_SETUP([CTABLES show or hide empty categories])
199 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
200 AT_DATA([ctables.sps],
202 IF (qn105ba = 2) qn105ba = 1.
203 IF (qns3a = 1) qns3a = 2.
204 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
205 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
206 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
207 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
208 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
209 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
210 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
212 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
214 ╭──────────────────────────────────────────────────────────────┬───────────────╮
221 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
222 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
223 │too much to drink to drive safely will A. Get certain │ │ │
224 │stopped by the police? Very likely│ .│ 0%│
231 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
234 ╭──────────────────────────────────────────────────────────────┬───────────────╮
241 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
242 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
243 │too much to drink to drive safely will A. Get certain │ │ │
244 │stopped by the police? Somewhat │ .│ 40%│
250 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
253 ╭────────────────────────────────────────────────────────────────────┬─────────╮
260 ├────────────────────────────────────────────────────────────────────┼─────────┤
261 │105b. How likely is it that drivers who have had too Almost │ 32%│
262 │much to drink to drive safely will A. Get stopped by certain │ │
263 │the police? Very likely │ 0%│
270 ╰────────────────────────────────────────────────────────────────────┴─────────╯
273 ╭────────────────────────────────────────────────────────────────────┬─────────╮
280 ├────────────────────────────────────────────────────────────────────┼─────────┤
281 │105b. How likely is it that drivers who have had too Almost │ 32%│
282 │much to drink to drive safely will A. Get stopped by certain │ │
283 │the police? Somewhat │ 40%│
289 ╰────────────────────────────────────────────────────────────────────┴─────────╯
293 AT_SETUP([CTABLES simple nesting])
294 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
295 AT_DATA([ctables.sps],
297 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
298 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
299 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
300 /CATEGORIES VARIABLES=qns3a TOTAL=YES
301 /CLABELS ROW=OPPOSITE.
303 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
305 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
308 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
309 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
310 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
311 │drive safely will A. Get stopped by Total │ 700│ 10%│
312 │the police? ╶──────────────────────────┼─────┼──────┤
313 │ Very S3a. Male │ 660│ 10%│
314 │ likely GENDER: Female│ 842│ 12%│
316 │ ╶──────────────────────────┼─────┼──────┤
317 │ Somewhat S3a. Male │ 1174│ 17%│
318 │ likely GENDER: Female│ 1589│ 23%│
320 │ ╶──────────────────────────┼─────┼──────┤
321 │ Somewhat S3a. Male │ 640│ 9%│
322 │ unlikely GENDER: Female│ 667│ 10%│
324 │ ╶──────────────────────────┼─────┼──────┤
325 │ Very S3a. Male │ 311│ 5%│
326 │ unlikely GENDER: Female│ 298│ 4%│
328 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
329 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
330 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
331 │drive safely will B. Have an accident? Total │ 1100│ 16%│
332 │ ╶──────────────────────────┼─────┼──────┤
333 │ Very S3a. Male │ 1104│ 16%│
334 │ likely GENDER: Female│ 1715│ 25%│
336 │ ╶──────────────────────────┼─────┼──────┤
337 │ Somewhat S3a. Male │ 1203│ 17%│
338 │ likely GENDER: Female│ 1214│ 18%│
340 │ ╶──────────────────────────┼─────┼──────┤
341 │ Somewhat S3a. Male │ 262│ 4%│
342 │ unlikely GENDER: Female│ 168│ 2%│
344 │ ╶──────────────────────────┼─────┼──────┤
345 │ Very S3a. Male │ 81│ 1%│
346 │ unlikely GENDER: Female│ 59│ 1%│
348 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
349 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
350 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
351 │drive safely will C. Be convicted for Total │ 1149│ 17%│
352 │drunk driving? ╶──────────────────────────┼─────┼──────┤
353 │ Very S3a. Male │ 988│ 14%│
354 │ likely GENDER: Female│ 1049│ 15%│
356 │ ╶──────────────────────────┼─────┼──────┤
357 │ Somewhat S3a. Male │ 822│ 12%│
358 │ likely GENDER: Female│ 1210│ 18%│
360 │ ╶──────────────────────────┼─────┼──────┤
361 │ Somewhat S3a. Male │ 446│ 7%│
362 │ unlikely GENDER: Female│ 548│ 8%│
364 │ ╶──────────────────────────┼─────┼──────┤
365 │ Very S3a. Male │ 268│ 4%│
366 │ unlikely GENDER: Female│ 354│ 5%│
368 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
369 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
370 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
371 │drive safely will D. Be arrested for Total │ 1101│ 16%│
372 │drunk driving? ╶──────────────────────────┼─────┼──────┤
373 │ Very S3a. Male │ 805│ 12%│
374 │ likely GENDER: Female│ 1029│ 15%│
376 │ ╶──────────────────────────┼─────┼──────┤
377 │ Somewhat S3a. Male │ 975│ 14%│
378 │ likely GENDER: Female│ 1332│ 19%│
380 │ ╶──────────────────────────┼─────┼──────┤
381 │ Somewhat S3a. Male │ 535│ 8%│
382 │ unlikely GENDER: Female│ 560│ 8%│
384 │ ╶──────────────────────────┼─────┼──────┤
385 │ Very S3a. Male │ 270│ 4%│
386 │ unlikely GENDER: Female│ 279│ 4%│
388 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
391 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
392 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
393 │ │ certain│likely│ likely │ unlikely│unlikely│
394 │ ├────────┼──────┼─────────┼─────────┼────────┤
396 │ │ Table %│ % │ Table % │ Table % │ Table %│
397 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
398 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
399 │GENDER: is it that drivers│ │ │ │ │ │
400 │ who have had too │ │ │ │ │ │
401 │ much to drink to │ │ │ │ │ │
402 │ drive safely will │ │ │ │ │ │
403 │ A. Get stopped by │ │ │ │ │ │
404 │ the police? │ │ │ │ │ │
405 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
406 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
407 │ is it that drivers│ │ │ │ │ │
408 │ who have had too │ │ │ │ │ │
409 │ much to drink to │ │ │ │ │ │
410 │ drive safely will │ │ │ │ │ │
411 │ A. Get stopped by │ │ │ │ │ │
412 │ the police? │ │ │ │ │ │
413 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
414 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
415 │ 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 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
423 │GENDER: is it that drivers│ │ │ │ │ │
424 │ who have had too │ │ │ │ │ │
425 │ much to drink to │ │ │ │ │ │
426 │ drive safely will │ │ │ │ │ │
427 │ B. Have an │ │ │ │ │ │
428 │ accident? │ │ │ │ │ │
429 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
430 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
431 │ is it that drivers│ │ │ │ │ │
432 │ who have had too │ │ │ │ │ │
433 │ much to drink to │ │ │ │ │ │
434 │ drive safely will │ │ │ │ │ │
435 │ B. Have an │ │ │ │ │ │
436 │ accident? │ │ │ │ │ │
437 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
438 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
439 │ 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 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
447 │GENDER: is it that drivers│ │ │ │ │ │
448 │ who have had too │ │ │ │ │ │
449 │ much to drink to │ │ │ │ │ │
450 │ drive safely will │ │ │ │ │ │
451 │ C. Be convicted │ │ │ │ │ │
452 │ for drunk driving?│ │ │ │ │ │
453 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
454 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
455 │ is it that drivers│ │ │ │ │ │
456 │ who have had too │ │ │ │ │ │
457 │ much to drink to │ │ │ │ │ │
458 │ drive safely will │ │ │ │ │ │
459 │ C. Be convicted │ │ │ │ │ │
460 │ for drunk driving?│ │ │ │ │ │
461 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
462 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
463 │ 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 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
471 │GENDER: is it that drivers│ │ │ │ │ │
472 │ who have had too │ │ │ │ │ │
473 │ much to drink to │ │ │ │ │ │
474 │ drive safely will │ │ │ │ │ │
475 │ D. Be arrested for│ │ │ │ │ │
476 │ drunk driving? │ │ │ │ │ │
477 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
478 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
479 │ is it that drivers│ │ │ │ │ │
480 │ who have had too │ │ │ │ │ │
481 │ much to drink to │ │ │ │ │ │
482 │ drive safely will │ │ │ │ │ │
483 │ D. Be arrested for│ │ │ │ │ │
484 │ drunk driving? │ │ │ │ │ │
485 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
486 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
487 │ 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 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
497 AT_SETUP([CTABLES nesting and scale variables])
498 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
499 AT_DATA([ctables.sps],
501 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
502 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
503 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
504 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
505 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
507 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
509 ╭─────────────────────────────────────────────────────────────────┬────────────╮
515 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
516 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
517 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
519 │ Once a week or │ 44│ 54│
521 │ Only certain │ 34│ 41│
524 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
527 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
528 │ │Minimum│Maximum│Mean│
529 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
530 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
531 │What is GENDER: months, has there been a │ │ │ │
532 │your time when you felt you │ │ │ │
533 │age? should cut down on your No │ 16│ 86│ 46│
535 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
536 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
537 │ months, has there been a │ │ │ │
538 │ time when you felt you │ │ │ │
539 │ should cut down on your No │ 16│ 86│ 48│
541 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
542 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
543 │What is GENDER: months, has there been a │ │ │ │
544 │your time when people criticized No │ 16│ 86│ 46│
545 │age? your drinking? │ │ │ │
546 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
547 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
548 │ months, has there been a │ │ │ │
549 │ time when people criticized No │ 16│ 86│ 48│
550 │ your drinking? │ │ │ │
551 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
554 ╭─────────────────────────────┬────────────────────────────────────────────────╮
555 │ │S1. Including yourself, how many members of this│
556 │ │ household are age 16 or older? │
557 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
558 │ │ │ │ │ │ │ │ 6 or │
559 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
560 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
561 │ │Column│Column│Column│Column│Column│Column│Column│
562 │ │ % │ % │ % │ % │ % │ % │ % │
563 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
564 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
565 │SAMPLE How certain │ │ │ │ │ │ │ │
566 │SOURCE: likely │ │ │ │ │ │ │ │
567 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
568 │ that likely │ │ │ │ │ │ │ │
569 │ drivers │ │ │ │ │ │ │ │
570 │ who have │ │ │ │ │ │ │ │
571 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
572 │ much to likely │ │ │ │ │ │ │ │
573 │ drink to │ │ │ │ │ │ │ │
574 │ drive │ │ │ │ │ │ │ │
575 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
576 │ will A. unlikely│ │ │ │ │ │ │ │
577 │ Get │ │ │ │ │ │ │ │
578 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
579 │ by the unlikely│ │ │ │ │ │ │ │
580 │ police? │ │ │ │ │ │ │ │
581 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
584 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
587 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
588 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
589 │group typical month did you have one or more │ │ │
590 │ alcoholic beverages to drink? │ │ │
591 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
592 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
593 │ typical month did you have one or more │ │ │
594 │ alcoholic beverages to drink? │ │ │
595 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
596 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
597 │ typical month did you have one or more │ │ │
598 │ alcoholic beverages to drink? │ │ │
599 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
600 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
601 │ typical month did you have one or more │ │ │
602 │ alcoholic beverages to drink? │ │ │
603 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
604 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
605 │ typical month did you have one or more │ │ │
606 │ alcoholic beverages to drink? │ │ │
607 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
608 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
609 │ older typical month did you have one or more │ │ │
610 │ alcoholic beverages to drink? │ │ │
611 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
616 AT_SETUP([CTABLES SLABELS])
617 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
618 AT_DATA([ctables.sps],
620 CTABLES /TABLE qn1 [COUNT COLPCT].
621 CTABLES /TABLE qn1 [COUNT COLPCT]
622 /SLABELS POSITION=ROW.
623 CTABLES /TABLE qn1 [COUNT COLPCT]
624 /SLABELS POSITION=ROW VISIBLE=NO.
626 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
628 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
631 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
632 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
633 │other motor vehicle? Several days a week│ 1274│ 18.3%│
634 │ Once a week or less│ 361│ 5.2%│
635 │ Only certain times │ 130│ 1.9%│
638 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
641 ╭────────────────────────────────────────────────────────────────────────┬─────╮
642 │ 1. How often do you usually drive a car or Every day Count │ 4667│
643 │other motor vehicle? Column │66.9%│
645 │ ╶───────────────────────────┼─────┤
646 │ Several days a week Count │ 1274│
649 │ ╶───────────────────────────┼─────┤
650 │ Once a week or less Count │ 361│
653 │ ╶───────────────────────────┼─────┤
654 │ Only certain times Count │ 130│
655 │ a year Column │ 1.9%│
657 │ ╶───────────────────────────┼─────┤
661 ╰────────────────────────────────────────────────────────────────────────┴─────╯
664 ╭────────────────────────────────────────────────────────────────────────┬─────╮
665 │ 1. How often do you usually drive a car or other Every day │ 4667│
666 │motor vehicle? │66.9%│
667 │ Several days a week │ 1274│
669 │ Once a week or less │ 361│
671 │ Only certain times a │ 130│
675 ╰────────────────────────────────────────────────────────────────────────┴─────╯
679 AT_SETUP([CTABLES simple totals])
680 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
681 AT_DATA([ctables.sps],
684 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
685 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
686 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
688 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
690 ╭────────────────────────────────────────────────────────────────────────┬─────╮
692 ├────────────────────────────────────────────────────────────────────────┼─────┤
693 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
694 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
697 │ Wine coolers │ 137│
698 │ Hard liquor or │ 888│
700 │ Flavored malt │ 83│
702 │ Number responding │ 4221│
703 ╰────────────────────────────────────────────────────────────────────────┴─────╯
706 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
708 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
709 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
710 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
712 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
713 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
714 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
716 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
717 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
718 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
720 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
721 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
722 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
724 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
725 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
726 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
728 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
732 AT_SETUP([CTABLES subtotals])
733 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
734 AT_DATA([ctables.sps],
736 CTABLES /TABLE=qn105ba BY qns1
737 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
738 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
739 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
740 CTABLES /TABLE=qn105ba BY qns1
741 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
742 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
744 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
746 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
747 │ │ S1. Including yourself, how many members of this household │
748 │ │ are age 16 or older? │
749 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
750 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
751 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
752 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
753 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
754 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
755 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
756 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
757 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
758 │ likely │ │ │ │ │ │ │ │
759 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
760 │ unlikely │ │ │ │ │ │ │ │
761 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
762 │ unlikely │ │ │ │ │ │ │ │
763 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
766 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
767 │ │ S1. Including yourself, how many members of this household │
768 │ │ are age 16 or older? │
769 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
770 │ │ │ │ │ │ │ │ 6 or │
771 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
772 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
773 │ │ │ │ │ │ Column│ │ │
774 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
775 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
776 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
777 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
778 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
779 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
780 │ likely │ │ │ │ │ │ │ │
781 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
782 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
783 │ unlikely │ │ │ │ │ │ │ │
784 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
785 │ unlikely │ │ │ │ │ │ │ │
786 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
787 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
790 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
791 │ │ S1. Including yourself, how many members of this household │
792 │ │ are age 16 or older? │
793 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
794 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
795 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
796 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
797 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
798 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
799 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
800 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
801 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
802 │ likely │ │ │ │ │ │ │ │
803 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
804 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
805 │ unlikely │ │ │ │ │ │ │ │
806 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
807 │ unlikely │ │ │ │ │ │ │ │
808 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
809 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
813 AT_SETUP([CTABLES PCOMPUTE])
814 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
815 AT_DATA([ctables.sps],
818 /PCOMPUTE &x=EXPR([3] + [4])
819 /PCOMPUTE &y=EXPR([4] + [5])
820 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
821 /PPROPERTIES &y LABEL='4+5'
822 /TABLE=qn105ba BY qns1
823 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
825 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
827 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
828 │ │ S1. Including yourself, how many members of this household │
829 │ │ are age 16 or older? │
830 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
831 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
832 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
833 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
834 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
835 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
836 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
837 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
838 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
839 │ likely │ │ │ │ │ │ │ │
840 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
841 │ unlikely │ │ │ │ │ │ │ │
842 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
843 │ unlikely │ │ │ │ │ │ │ │
844 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯