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.
38 dnl - SMISSING (see documentation).
39 dnl - Test WEIGHT and adjustment weights.
40 dnl - Test PCOMPUTE and PPROPERTIES.
42 dnl * multi-dimensional
43 dnl * MISSING, OTHERNM
47 dnl * summary statistics and formats?
48 dnl - HIDESMALLCOUNTS.
49 dnl - Are string ranges a thing?
52 dnl CTABLES /TABLE=qnd1 [MEAN, MEDIAN] BY qns3a.
53 dnl produces a bad median:
55 dnl +--------------------------+-----------------------+
56 dnl | | S3a. GENDER: |
57 dnl | +-----------+-----------+
58 dnl | | Male | Female |
59 dnl | +----+------+----+------+
60 dnl | |Mean|Median|Mean|Median|
61 dnl +--------------------------+----+------+----+------+
62 dnl |D1. AGE: What is your age?| 46| 999| 50| 999|
63 dnl +--------------------------+----+------+----+------+
67 # AT_SETUP([CTABLES parsing])
68 # AT_DATA([ctables.sps],
69 # [[DATA LIST LIST NOTABLE /x y z.
70 # CTABLES /TABLE=(x + y) > z.
71 # CTABLES /TABLE=(x[c] + y[c]) > z.
72 # CTABLES /TABLE=(x + y) > z[c].
73 # CTABLES /TABLE=x BY y BY z.
74 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
75 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
77 # AT_CHECK([pspp ctables.sps])
80 AT_SETUP([CTABLES one categorical variable])
81 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
82 AT_DATA([ctables.sps],
85 CTABLES /TABLE BY qn1.
86 CTABLES /TABLE BY BY qn1.
88 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
90 ╭────────────────────────────────────────────────────────────────────────┬─────╮
92 ├────────────────────────────────────────────────────────────────────────┼─────┤
93 │ 1. How often do you usually drive a car or other Every day │ 4667│
94 │motor vehicle? Several days a week │ 1274│
95 │ Once a week or less │ 361│
96 │ Only certain times a │ 130│
99 ╰────────────────────────────────────────────────────────────────────────┴─────╯
102 ╭──────────────────────────────────────────────────────────────────────────────╮
103 │ 1. How often do you usually drive a car or other motor vehicle? │
104 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
105 │ │ Several days a │ Once a week or │ Only certain times a │ │
106 │Every day│ week │ less │ year │Never│
107 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
108 │ Count │ Count │ Count │ Count │Count│
109 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
110 │ 4667│ 1274│ 361│ 130│ 540│
111 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
123 AT_SETUP([CTABLES one scale variable])
124 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
125 AT_DATA([ctables.sps],
127 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
128 CTABLES /TABLE BY qnd1.
129 CTABLES /TABLE BY BY qnd1.
131 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
133 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
134 │ │Count│Mean│Std Deviation│Minimum│Maximum│
135 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
136 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
137 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
140 ╭──────────────────────────╮
141 │D1. AGE: What is your age?│
142 ├──────────────────────────┤
144 ├──────────────────────────┤
146 ╰──────────────────────────╯
149 D1. AGE: What is your age?
158 AT_SETUP([CTABLES simple stacking])
159 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
160 AT_DATA([ctables.sps],
162 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
164 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
166 ╭───────────────────────────────────────────────────────────────┬──────────────╮
173 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
174 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
175 │too much to drink to drive safely will A. Get certain │ │ │
176 │stopped by the police? Very likely │ 21%│ 22%│
177 │ Somewhat │ 38%│ 42%│
179 │ Somewhat │ 21%│ 18%│
183 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
184 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
185 │too much to drink to drive safely will B. Have an certain │ │ │
186 │accident? Very likely │ 36%│ 45%│
187 │ Somewhat │ 39%│ 32%│
193 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
194 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
195 │too much to drink to drive safely will C. Be certain │ │ │
196 │convicted for drunk driving? Very likely │ 32%│ 28%│
197 │ Somewhat │ 27%│ 32%│
199 │ Somewhat │ 15%│ 15%│
203 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
204 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
205 │too much to drink to drive safely will D. Be certain │ │ │
206 │arrested for drunk driving? Very likely │ 26%│ 27%│
207 │ Somewhat │ 32%│ 35%│
209 │ Somewhat │ 17%│ 15%│
213 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
217 AT_SETUP([CTABLES show or hide empty categories])
218 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
219 AT_DATA([ctables.sps],
221 IF (qn105ba = 2) qn105ba = 1.
222 IF (qns3a = 1) qns3a = 2.
223 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
224 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
225 /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
226 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
227 /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
228 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
229 /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
231 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
233 ╭──────────────────────────────────────────────────────────────┬───────────────╮
240 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
241 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
242 │too much to drink to drive safely will A. Get certain │ │ │
243 │stopped by the police? Very likely│ .│ 0%│
250 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
253 ╭──────────────────────────────────────────────────────────────┬───────────────╮
260 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
261 │105b. How likely is it that drivers who have had Almost │ .│ 32%│
262 │too much to drink to drive safely will A. Get certain │ │ │
263 │stopped by the police? Somewhat │ .│ 40%│
269 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
272 ╭────────────────────────────────────────────────────────────────────┬─────────╮
279 ├────────────────────────────────────────────────────────────────────┼─────────┤
280 │105b. How likely is it that drivers who have had too Almost │ 32%│
281 │much to drink to drive safely will A. Get stopped by certain │ │
282 │the police? Very likely │ 0%│
289 ╰────────────────────────────────────────────────────────────────────┴─────────╯
292 ╭────────────────────────────────────────────────────────────────────┬─────────╮
299 ├────────────────────────────────────────────────────────────────────┼─────────┤
300 │105b. How likely is it that drivers who have had too Almost │ 32%│
301 │much to drink to drive safely will A. Get stopped by certain │ │
302 │the police? Somewhat │ 40%│
308 ╰────────────────────────────────────────────────────────────────────┴─────────╯
312 AT_SETUP([CTABLES simple nesting])
313 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
314 AT_DATA([ctables.sps],
316 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
317 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
318 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
319 /CATEGORIES VARIABLES=qns3a TOTAL=YES
320 /CLABELS ROW=OPPOSITE.
322 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
324 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
327 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
328 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
329 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
330 │drive safely will A. Get stopped by Total │ 700│ 10%│
331 │the police? ╶──────────────────────────┼─────┼──────┤
332 │ Very S3a. Male │ 660│ 10%│
333 │ likely GENDER: Female│ 842│ 12%│
335 │ ╶──────────────────────────┼─────┼──────┤
336 │ Somewhat S3a. Male │ 1174│ 17%│
337 │ likely GENDER: Female│ 1589│ 23%│
339 │ ╶──────────────────────────┼─────┼──────┤
340 │ Somewhat S3a. Male │ 640│ 9%│
341 │ unlikely GENDER: Female│ 667│ 10%│
343 │ ╶──────────────────────────┼─────┼──────┤
344 │ Very S3a. Male │ 311│ 5%│
345 │ unlikely GENDER: Female│ 298│ 4%│
347 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
348 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
349 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
350 │drive safely will B. Have an accident? Total │ 1100│ 16%│
351 │ ╶──────────────────────────┼─────┼──────┤
352 │ Very S3a. Male │ 1104│ 16%│
353 │ likely GENDER: Female│ 1715│ 25%│
355 │ ╶──────────────────────────┼─────┼──────┤
356 │ Somewhat S3a. Male │ 1203│ 17%│
357 │ likely GENDER: Female│ 1214│ 18%│
359 │ ╶──────────────────────────┼─────┼──────┤
360 │ Somewhat S3a. Male │ 262│ 4%│
361 │ unlikely GENDER: Female│ 168│ 2%│
363 │ ╶──────────────────────────┼─────┼──────┤
364 │ Very S3a. Male │ 81│ 1%│
365 │ unlikely GENDER: Female│ 59│ 1%│
367 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
368 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
369 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
370 │drive safely will C. Be convicted for Total │ 1149│ 17%│
371 │drunk driving? ╶──────────────────────────┼─────┼──────┤
372 │ Very S3a. Male │ 988│ 14%│
373 │ likely GENDER: Female│ 1049│ 15%│
375 │ ╶──────────────────────────┼─────┼──────┤
376 │ Somewhat S3a. Male │ 822│ 12%│
377 │ likely GENDER: Female│ 1210│ 18%│
379 │ ╶──────────────────────────┼─────┼──────┤
380 │ Somewhat S3a. Male │ 446│ 7%│
381 │ unlikely GENDER: Female│ 548│ 8%│
383 │ ╶──────────────────────────┼─────┼──────┤
384 │ Very S3a. Male │ 268│ 4%│
385 │ unlikely GENDER: Female│ 354│ 5%│
387 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
388 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
389 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
390 │drive safely will D. Be arrested for Total │ 1101│ 16%│
391 │drunk driving? ╶──────────────────────────┼─────┼──────┤
392 │ Very S3a. Male │ 805│ 12%│
393 │ likely GENDER: Female│ 1029│ 15%│
395 │ ╶──────────────────────────┼─────┼──────┤
396 │ Somewhat S3a. Male │ 975│ 14%│
397 │ likely GENDER: Female│ 1332│ 19%│
399 │ ╶──────────────────────────┼─────┼──────┤
400 │ Somewhat S3a. Male │ 535│ 8%│
401 │ unlikely GENDER: Female│ 560│ 8%│
403 │ ╶──────────────────────────┼─────┼──────┤
404 │ Very S3a. Male │ 270│ 4%│
405 │ unlikely GENDER: Female│ 279│ 4%│
407 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
410 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
411 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
412 │ │ certain│likely│ likely │ unlikely│unlikely│
413 │ ├────────┼──────┼─────────┼─────────┼────────┤
415 │ │ Table %│ % │ Table % │ Table % │ Table %│
416 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
417 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
418 │GENDER: is it that drivers│ │ │ │ │ │
419 │ who have had too │ │ │ │ │ │
420 │ much to drink to │ │ │ │ │ │
421 │ drive safely will │ │ │ │ │ │
422 │ A. Get stopped by │ │ │ │ │ │
423 │ the police? │ │ │ │ │ │
424 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
425 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
426 │ is it that drivers│ │ │ │ │ │
427 │ who have had too │ │ │ │ │ │
428 │ much to drink to │ │ │ │ │ │
429 │ drive safely will │ │ │ │ │ │
430 │ A. Get stopped by │ │ │ │ │ │
431 │ the police? │ │ │ │ │ │
432 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
433 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
434 │ is it that drivers│ │ │ │ │ │
435 │ who have had too │ │ │ │ │ │
436 │ much to drink to │ │ │ │ │ │
437 │ drive safely will │ │ │ │ │ │
438 │ A. Get stopped by │ │ │ │ │ │
439 │ the police? │ │ │ │ │ │
440 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
441 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
442 │GENDER: is it that drivers│ │ │ │ │ │
443 │ who have had too │ │ │ │ │ │
444 │ much to drink to │ │ │ │ │ │
445 │ drive safely will │ │ │ │ │ │
446 │ B. Have an │ │ │ │ │ │
447 │ accident? │ │ │ │ │ │
448 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
449 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
450 │ is it that drivers│ │ │ │ │ │
451 │ who have had too │ │ │ │ │ │
452 │ much to drink to │ │ │ │ │ │
453 │ drive safely will │ │ │ │ │ │
454 │ B. Have an │ │ │ │ │ │
455 │ accident? │ │ │ │ │ │
456 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
457 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
458 │ is it that drivers│ │ │ │ │ │
459 │ who have had too │ │ │ │ │ │
460 │ much to drink to │ │ │ │ │ │
461 │ drive safely will │ │ │ │ │ │
462 │ B. Have an │ │ │ │ │ │
463 │ accident? │ │ │ │ │ │
464 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
465 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
466 │GENDER: is it that drivers│ │ │ │ │ │
467 │ who have had too │ │ │ │ │ │
468 │ much to drink to │ │ │ │ │ │
469 │ drive safely will │ │ │ │ │ │
470 │ C. Be convicted │ │ │ │ │ │
471 │ for drunk driving?│ │ │ │ │ │
472 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
473 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
474 │ is it that drivers│ │ │ │ │ │
475 │ who have had too │ │ │ │ │ │
476 │ much to drink to │ │ │ │ │ │
477 │ drive safely will │ │ │ │ │ │
478 │ C. Be convicted │ │ │ │ │ │
479 │ for drunk driving?│ │ │ │ │ │
480 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
481 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
482 │ is it that drivers│ │ │ │ │ │
483 │ who have had too │ │ │ │ │ │
484 │ much to drink to │ │ │ │ │ │
485 │ drive safely will │ │ │ │ │ │
486 │ C. Be convicted │ │ │ │ │ │
487 │ for drunk driving?│ │ │ │ │ │
488 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
489 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
490 │GENDER: is it that drivers│ │ │ │ │ │
491 │ who have had too │ │ │ │ │ │
492 │ much to drink to │ │ │ │ │ │
493 │ drive safely will │ │ │ │ │ │
494 │ D. Be arrested for│ │ │ │ │ │
495 │ drunk driving? │ │ │ │ │ │
496 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
497 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
498 │ is it that drivers│ │ │ │ │ │
499 │ who have had too │ │ │ │ │ │
500 │ much to drink to │ │ │ │ │ │
501 │ drive safely will │ │ │ │ │ │
502 │ D. Be arrested for│ │ │ │ │ │
503 │ drunk driving? │ │ │ │ │ │
504 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
505 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
506 │ is it that drivers│ │ │ │ │ │
507 │ who have had too │ │ │ │ │ │
508 │ much to drink to │ │ │ │ │ │
509 │ drive safely will │ │ │ │ │ │
510 │ D. Be arrested for│ │ │ │ │ │
511 │ drunk driving? │ │ │ │ │ │
512 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
516 AT_SETUP([CTABLES nesting and scale variables])
517 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
518 AT_DATA([ctables.sps],
520 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
521 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
522 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
523 /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
524 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
526 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
528 ╭─────────────────────────────────────────────────────────────────┬────────────╮
534 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
535 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
536 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
538 │ Once a week or │ 44│ 54│
540 │ Only certain │ 34│ 41│
543 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
546 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
547 │ │Minimum│Maximum│Mean│
548 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
549 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
550 │What is GENDER: months, has there been a │ │ │ │
551 │your time when you felt you │ │ │ │
552 │age? should cut down on your No │ 16│ 86│ 46│
554 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
555 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
556 │ months, has there been a │ │ │ │
557 │ time when you felt you │ │ │ │
558 │ should cut down on your No │ 16│ 86│ 48│
560 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
561 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
562 │What is GENDER: months, has there been a │ │ │ │
563 │your time when people criticized No │ 16│ 86│ 46│
564 │age? your drinking? │ │ │ │
565 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
566 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
567 │ months, has there been a │ │ │ │
568 │ time when people criticized No │ 16│ 86│ 48│
569 │ your drinking? │ │ │ │
570 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
573 ╭─────────────────────────────┬────────────────────────────────────────────────╮
574 │ │S1. Including yourself, how many members of this│
575 │ │ household are age 16 or older? │
576 │ ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
577 │ │ │ │ │ │ │ │ 6 or │
578 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
579 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
580 │ │Column│Column│Column│Column│Column│Column│Column│
581 │ │ % │ % │ % │ % │ % │ % │ % │
582 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
583 │Sa1. RDD 105b. Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
584 │SAMPLE How certain │ │ │ │ │ │ │ │
585 │SOURCE: likely │ │ │ │ │ │ │ │
586 │ is it Very │ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
587 │ that likely │ │ │ │ │ │ │ │
588 │ drivers │ │ │ │ │ │ │ │
589 │ who have │ │ │ │ │ │ │ │
590 │ had too Somewhat│ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
591 │ much to likely │ │ │ │ │ │ │ │
592 │ drink to │ │ │ │ │ │ │ │
593 │ drive │ │ │ │ │ │ │ │
594 │ safely Somewhat│ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
595 │ will A. unlikely│ │ │ │ │ │ │ │
596 │ Get │ │ │ │ │ │ │ │
597 │ stopped Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
598 │ by the unlikely│ │ │ │ │ │ │ │
599 │ police? │ │ │ │ │ │ │ │
600 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
603 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
606 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
607 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
608 │group typical month did you have one or more │ │ │
609 │ alcoholic beverages to drink? │ │ │
610 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
611 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
612 │ typical month did you have one or more │ │ │
613 │ alcoholic beverages to drink? │ │ │
614 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
615 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
616 │ typical month did you have one or more │ │ │
617 │ alcoholic beverages to drink? │ │ │
618 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
619 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
620 │ typical month did you have one or more │ │ │
621 │ alcoholic beverages to drink? │ │ │
622 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
623 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
624 │ typical month did you have one or more │ │ │
625 │ alcoholic beverages to drink? │ │ │
626 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
627 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
628 │ older typical month did you have one or more │ │ │
629 │ alcoholic beverages to drink? │ │ │
630 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
635 AT_SETUP([CTABLES SLABELS])
636 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
637 AT_DATA([ctables.sps],
639 CTABLES /TABLE qn1 [COUNT COLPCT].
640 CTABLES /TABLE qn1 [COUNT COLPCT]
641 /SLABELS POSITION=ROW.
642 CTABLES /TABLE qn1 [COUNT COLPCT]
643 /SLABELS POSITION=ROW VISIBLE=NO.
645 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
647 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
650 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
651 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
652 │other motor vehicle? Several days a week│ 1274│ 18.3%│
653 │ Once a week or less│ 361│ 5.2%│
654 │ Only certain times │ 130│ 1.9%│
657 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
660 ╭────────────────────────────────────────────────────────────────────────┬─────╮
661 │ 1. How often do you usually drive a car or Every day Count │ 4667│
662 │other motor vehicle? Column │66.9%│
664 │ ╶───────────────────────────┼─────┤
665 │ Several days a week Count │ 1274│
668 │ ╶───────────────────────────┼─────┤
669 │ Once a week or less Count │ 361│
672 │ ╶───────────────────────────┼─────┤
673 │ Only certain times Count │ 130│
674 │ a year Column │ 1.9%│
676 │ ╶───────────────────────────┼─────┤
680 ╰────────────────────────────────────────────────────────────────────────┴─────╯
683 ╭────────────────────────────────────────────────────────────────────────┬─────╮
684 │ 1. How often do you usually drive a car or other Every day │ 4667│
685 │motor vehicle? │66.9%│
686 │ Several days a week │ 1274│
688 │ Once a week or less │ 361│
690 │ Only certain times a │ 130│
694 ╰────────────────────────────────────────────────────────────────────────┴─────╯
698 AT_SETUP([CTABLES simple totals])
699 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
700 AT_DATA([ctables.sps],
703 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
704 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
705 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
707 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
709 ╭────────────────────────────────────────────────────────────────────────┬─────╮
711 ├────────────────────────────────────────────────────────────────────────┼─────┤
712 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
713 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
716 │ Wine coolers │ 137│
717 │ Hard liquor or │ 888│
719 │ Flavored malt │ 83│
721 │ Number responding │ 4221│
722 ╰────────────────────────────────────────────────────────────────────────┴─────╯
725 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
727 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
728 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
729 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
731 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
732 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
733 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
735 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
736 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
737 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
739 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
740 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
741 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
743 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
744 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
745 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
747 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
751 AT_SETUP([CTABLES subtotals])
752 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
753 AT_DATA([ctables.sps],
755 CTABLES /TABLE=qn105ba BY qns1
756 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
757 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
758 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
759 CTABLES /TABLE=qn105ba BY qns1
760 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
761 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
763 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
765 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
766 │ │ S1. Including yourself, how many members of this household │
767 │ │ are age 16 or older? │
768 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
769 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
770 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
771 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
772 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
773 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
774 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
775 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
776 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
777 │ likely │ │ │ │ │ │ │ │
778 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
779 │ unlikely │ │ │ │ │ │ │ │
780 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
781 │ unlikely │ │ │ │ │ │ │ │
782 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
785 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
786 │ │ S1. Including yourself, how many members of this household │
787 │ │ are age 16 or older? │
788 │ ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
789 │ │ │ │ │ │ │ │ 6 or │
790 │ │ None │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
791 │ ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
792 │ │ │ │ │ │ Column│ │ │
793 │ │Column %│Column %│Column %│Column %│ % │Column %│Column %│
794 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
795 │105b. How likely is it that drivers who have Almost │ .│ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
796 │had too much to drink to drive safely will certain │ │ │ │ │ │ │ │
797 │A. Get stopped by the police? Very likely│ .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
798 │ Somewhat │ .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
799 │ likely │ │ │ │ │ │ │ │
800 │ Subtotal │ │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
801 │ Somewhat │ .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
802 │ unlikely │ │ │ │ │ │ │ │
803 │ Very │ .│ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
804 │ unlikely │ │ │ │ │ │ │ │
805 │ Subtotal │ │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
806 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
809 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
810 │ │ S1. Including yourself, how many members of this household │
811 │ │ are age 16 or older? │
812 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
813 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
814 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
815 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
816 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
817 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
818 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
819 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
820 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
821 │ likely │ │ │ │ │ │ │ │
822 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
823 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
824 │ unlikely │ │ │ │ │ │ │ │
825 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
826 │ unlikely │ │ │ │ │ │ │ │
827 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
828 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
832 AT_SETUP([CTABLES PCOMPUTE])
833 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
834 AT_DATA([ctables.sps],
837 /PCOMPUTE &x=EXPR([3] + [4])
838 /PCOMPUTE &y=EXPR([4] + [5])
839 /PPROPERTIES &x LABEL='3+4' HIDESOURCECATS=YES
840 /PPROPERTIES &y LABEL='4+5'
841 /TABLE=qn105ba BY qns1
842 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL]
844 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
846 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
847 │ │ S1. Including yourself, how many members of this household │
848 │ │ are age 16 or older? │
849 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
850 │ │ 1 │ 2 │ Subtotal│ 5 │ 3+4 │ 4+5 │ Subtotal │
851 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
852 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
853 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
854 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 11│ 81│ 30│ 92│
855 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
856 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 14│ 171│ 65│ 185│
857 │ Somewhat │ 590│ 1249│ 1839│ 20│ 265│ 92│ 285│
858 │ likely │ │ │ │ │ │ │ │
859 │ Somewhat │ 278│ 647│ 925│ 6│ 116│ 38│ 122│
860 │ unlikely │ │ │ │ │ │ │ │
861 │ Very │ 141│ 290│ 431│ 4│ 59│ 22│ 63│
862 │ unlikely │ │ │ │ │ │ │ │
863 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
867 AT_SETUP([CTABLES CLABELS])
868 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
869 AT_DATA([ctables.sps],
871 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
872 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
874 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
876 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
878 │ ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
880 │ ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
881 │ │ 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 │
882 │ │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │ younger │ 25 │ 35 │ 45 │ 55 │ 65 │ older │
883 │ ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
884 │ │ Count │ Count │ Count│ Count│ Count│ Count │ Count │ Count │ Count│ Count │ Count│ Count│ Count│ Count │
885 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
886 │Age │ 0│ 594│ 476│ 489│ 526│ 516│ 531│ 0│ 505│ 491│ 548│ 649│ 731│ 943│
887 │group │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
888 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
891 ╭──────────────────────────────┬────────────╮
895 ├──────────────────────────────┼────────────┤
896 │Age group 15 or younger Male │ 0│
898 │ ╶────────────────────┼────────────┤
899 │ 16 to 25 Male │ 594│
901 │ ╶────────────────────┼────────────┤
902 │ 26 to 35 Male │ 476│
904 │ ╶────────────────────┼────────────┤
905 │ 36 to 45 Male │ 489│
907 │ ╶────────────────────┼────────────┤
908 │ 46 to 55 Male │ 526│
910 │ ╶────────────────────┼────────────┤
911 │ 56 to 65 Male │ 516│
913 │ ╶────────────────────┼────────────┤
914 │ 66 or older Male │ 531│
916 ╰──────────────────────────────┴────────────╯