PCOMPUTE works
[pspp] / tests / language / stats / ctables.at
1 AT_BANNER([CTABLES])
2
3 dnl TODO:
4 dnl
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.
18 dnl   * .SE 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.
23 dnl - CATEGORIES:
24 dnl   * Special case for explicit category specifications and multiple dichotomy sets
25 dnl   * THRU
26 dnl   * OTHERNM
27 dnl   * String values
28 dnl   * Date values
29 dnl   * Data-dependent sorting.
30 dnl - TITLES: )DATE, )TIME, )TABLE.
31 dnl - SIGTEST
32 dnl - COMPARETEST
33 dnl - FORMAT:
34 dnl   * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
35 dnl   * EMPTY.
36 dnl   * MISSING.
37 dnl - VLABELS.
38 dnl - SMISSING.
39 dnl - Test WEIGHT and adjustment weights.
40 dnl - Test PCOMPUTE and PPROPERTIES.
41 dnl - PCOMPUTE:
42 dnl   * multi-dimensional
43 dnl   * MISSING, OTHERNM
44 dnl   * strings
45 dnl - HIDESMALLCOUNTS.
46 dnl - Are string ranges a thing?
47
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].
57 # ]])
58 # AT_CHECK([pspp ctables.sps])
59 # AT_CLEANUP
60
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],
64 [[GET 'nhtsa.sav'.
65 CTABLES /TABLE qn1.
66 CTABLES /TABLE BY qn1.
67 CTABLES /TABLE BY BY qn1.
68 ]])
69 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
70                                   Custom Tables
71 ╭────────────────────────────────────────────────────────────────────────┬─────╮
72 │                                                                        │Count│
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│
78 │                                                   year                 │     │
79 │                                                   Never                │  540│
80 ╰────────────────────────────────────────────────────────────────────────┴─────╯
81
82                                   Custom Tables
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 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
93
94 Custom Tables
95 Every day
96 ╭─────╮
97 │Count│
98 ├─────┤
99 │ 4667│
100 ╰─────╯
101 ])
102 AT_CLEANUP
103
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],
107 [[GET 'nhtsa.sav'.
108 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
109 CTABLES /TABLE BY qnd1.
110 CTABLES /TABLE BY BY qnd1.
111 ]])
112 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
113                             Custom Tables
114 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
115 │                          │Count│Mean│Std Deviation│Minimum│Maximum│
116 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
117 │D1. AGE: What is your age?│ 6930│  48│           19│     16│     86│
118 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
119
120         Custom Tables
121 ╭──────────────────────────╮
122 │D1. AGE: What is your age?│
123 ├──────────────────────────┤
124 │           Mean           │
125 ├──────────────────────────┤
126 │                        48│
127 ╰──────────────────────────╯
128
129 Custom Tables
130 D1. AGE: What is your age?
131 ╭────╮
132 │Mean│
133 ├────┤
134 │  48│
135 ╰────╯
136 ])
137 AT_CLEANUP
138
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],
142 [[GET 'nhtsa.sav'.
143 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
144 ]])
145 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
146                                   Custom Tables
147 ╭───────────────────────────────────────────────────────────────┬──────────────╮
148 │                                                               │ S3a. GENDER: │
149 │                                                               ├──────┬───────┤
150 │                                                               │ Male │ Female│
151 │                                                               ├──────┼───────┤
152 │                                                               │Column│ Column│
153 │                                                               │   %  │   %   │
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%│
159 │                                                   likely      │      │       │
160 │                                                   Somewhat    │   21%│    18%│
161 │                                                   unlikely    │      │       │
162 │                                                   Very        │   10%│     8%│
163 │                                                   unlikely    │      │       │
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%│
169 │                                                   likely      │      │       │
170 │                                                   Somewhat    │    9%│     4%│
171 │                                                   unlikely    │      │       │
172 │                                                   Very        │    3%│     2%│
173 │                                                   unlikely    │      │       │
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%│
179 │                                                   likely      │      │       │
180 │                                                   Somewhat    │   15%│    15%│
181 │                                                   unlikely    │      │       │
182 │                                                   Very        │    9%│     9%│
183 │                                                   unlikely    │      │       │
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%│
189 │                                                   likely      │      │       │
190 │                                                   Somewhat    │   17%│    15%│
191 │                                                   unlikely    │      │       │
192 │                                                   Very        │    9%│     7%│
193 │                                                   unlikely    │      │       │
194 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
195 ])
196 AT_CLEANUP
197
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],
201 [[GET 'nhtsa.sav'.
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.
211 ]])
212 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
213                                   Custom Tables
214 ╭──────────────────────────────────────────────────────────────┬───────────────╮
215 │                                                              │  S3a. GENDER: │
216 │                                                              ├───────┬───────┤
217 │                                                              │  Male │ Female│
218 │                                                              ├───────┼───────┤
219 │                                                              │ Column│ Column│
220 │                                                              │   %   │   %   │
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%│
225 │                                                   Somewhat   │      .│    40%│
226 │                                                   likely     │       │       │
227 │                                                   Somewhat   │      .│    19%│
228 │                                                   unlikely   │       │       │
229 │                                                   Very       │      .│     9%│
230 │                                                   unlikely   │       │       │
231 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
232
233                                   Custom Tables
234 ╭──────────────────────────────────────────────────────────────┬───────────────╮
235 │                                                              │  S3a. GENDER: │
236 │                                                              ├───────┬───────┤
237 │                                                              │  Male │ Female│
238 │                                                              ├───────┼───────┤
239 │                                                              │ Column│ Column│
240 │                                                              │   %   │   %   │
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%│
245 │                                                   likely     │       │       │
246 │                                                   Somewhat   │      .│    19%│
247 │                                                   unlikely   │       │       │
248 │                                                   Very       │      .│     9%│
249 │                                                   unlikely   │       │       │
250 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
251
252                                   Custom Tables
253 ╭────────────────────────────────────────────────────────────────────┬─────────╮
254 │                                                                    │   S3a.  │
255 │                                                                    │ GENDER: │
256 │                                                                    ├─────────┤
257 │                                                                    │  Female │
258 │                                                                    ├─────────┤
259 │                                                                    │ Column %│
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%│
264 │                                                        Somewhat    │      40%│
265 │                                                        likely      │         │
266 │                                                        Somewhat    │      19%│
267 │                                                        unlikely    │         │
268 │                                                        Very        │       9%│
269 │                                                        unlikely    │         │
270 ╰────────────────────────────────────────────────────────────────────┴─────────╯
271
272                                   Custom Tables
273 ╭────────────────────────────────────────────────────────────────────┬─────────╮
274 │                                                                    │   S3a.  │
275 │                                                                    │ GENDER: │
276 │                                                                    ├─────────┤
277 │                                                                    │  Female │
278 │                                                                    ├─────────┤
279 │                                                                    │ Column %│
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%│
284 │                                                        likely      │         │
285 │                                                        Somewhat    │      19%│
286 │                                                        unlikely    │         │
287 │                                                        Very        │       9%│
288 │                                                        unlikely    │         │
289 ╰────────────────────────────────────────────────────────────────────┴─────────╯
290 ])
291 AT_CLEANUP
292
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],
296 [[GET 'nhtsa.sav'.
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.
302 ]])
303 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
304                                   Custom Tables
305 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
306 │                                                                 │     │ Table│
307 │                                                                 │Count│   %  │
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%│
315 │                                                           Total │ 1502│   22%│
316 │                                      ╶──────────────────────────┼─────┼──────┤
317 │                                       Somewhat   S3a.     Male  │ 1174│   17%│
318 │                                       likely     GENDER:  Female│ 1589│   23%│
319 │                                                           Total │ 2763│   40%│
320 │                                      ╶──────────────────────────┼─────┼──────┤
321 │                                       Somewhat   S3a.     Male  │  640│    9%│
322 │                                       unlikely   GENDER:  Female│  667│   10%│
323 │                                                           Total │ 1307│   19%│
324 │                                      ╶──────────────────────────┼─────┼──────┤
325 │                                       Very       S3a.     Male  │  311│    5%│
326 │                                       unlikely   GENDER:  Female│  298│    4%│
327 │                                                           Total │  609│    9%│
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%│
335 │                                                           Total │ 2819│   41%│
336 │                                      ╶──────────────────────────┼─────┼──────┤
337 │                                       Somewhat   S3a.     Male  │ 1203│   17%│
338 │                                       likely     GENDER:  Female│ 1214│   18%│
339 │                                                           Total │ 2417│   35%│
340 │                                      ╶──────────────────────────┼─────┼──────┤
341 │                                       Somewhat   S3a.     Male  │  262│    4%│
342 │                                       unlikely   GENDER:  Female│  168│    2%│
343 │                                                           Total │  430│    6%│
344 │                                      ╶──────────────────────────┼─────┼──────┤
345 │                                       Very       S3a.     Male  │   81│    1%│
346 │                                       unlikely   GENDER:  Female│   59│    1%│
347 │                                                           Total │  140│    2%│
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%│
355 │                                                           Total │ 2037│   30%│
356 │                                      ╶──────────────────────────┼─────┼──────┤
357 │                                       Somewhat   S3a.     Male  │  822│   12%│
358 │                                       likely     GENDER:  Female│ 1210│   18%│
359 │                                                           Total │ 2032│   30%│
360 │                                      ╶──────────────────────────┼─────┼──────┤
361 │                                       Somewhat   S3a.     Male  │  446│    7%│
362 │                                       unlikely   GENDER:  Female│  548│    8%│
363 │                                                           Total │  994│   15%│
364 │                                      ╶──────────────────────────┼─────┼──────┤
365 │                                       Very       S3a.     Male  │  268│    4%│
366 │                                       unlikely   GENDER:  Female│  354│    5%│
367 │                                                           Total │  622│    9%│
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%│
375 │                                                           Total │ 1834│   27%│
376 │                                      ╶──────────────────────────┼─────┼──────┤
377 │                                       Somewhat   S3a.     Male  │  975│   14%│
378 │                                       likely     GENDER:  Female│ 1332│   19%│
379 │                                                           Total │ 2307│   34%│
380 │                                      ╶──────────────────────────┼─────┼──────┤
381 │                                       Somewhat   S3a.     Male  │  535│    8%│
382 │                                       unlikely   GENDER:  Female│  560│    8%│
383 │                                                           Total │ 1095│   16%│
384 │                                      ╶──────────────────────────┼─────┼──────┤
385 │                                       Very       S3a.     Male  │  270│    4%│
386 │                                       unlikely   GENDER:  Female│  279│    4%│
387 │                                                           Total │  549│    8%│
388 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
389
390                                   Custom Tables
391 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
392 │                                 │ Almost │ Very │ Somewhat│ Somewhat│  Very  │
393 │                                 │ certain│likely│  likely │ unlikely│unlikely│
394 │                                 ├────────┼──────┼─────────┼─────────┼────────┤
395 │                                 │        │ Table│         │         │        │
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 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
494 ])
495 AT_CLEANUP
496
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],
500 [[GET 'nhtsa.sav'.
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].
506 ]])
507 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
508                                   Custom Tables
509 ╭─────────────────────────────────────────────────────────────────┬────────────╮
510 │                                                                 │S3a. GENDER:│
511 │                                                                 ├─────┬──────┤
512 │                                                                 │ Male│Female│
513 │                                                                 ├─────┼──────┤
514 │                                                                 │ Mean│ Mean │
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│
518 │                                                  week           │     │      │
519 │                                                  Once a week or │   44│    54│
520 │                                                  less           │     │      │
521 │                                                  Only certain   │   34│    41│
522 │                                                  times a year   │     │      │
523 │                                                  Never          │   39│    55│
524 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
525
526                                   Custom Tables
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│
534 │                         drinking?                       │       │       │    │
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│
540 │                         drinking?                       │       │       │    │
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 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
552
553                                   Custom Tables
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 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
582
583                                   Custom Tables
584 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
585 │                                                              │    │    Std   │
586 │                                                              │Mean│ Deviation│
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 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
612 ])
613 AT_CLEANUP
614
615
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],
619 [[GET 'nhtsa.sav'.
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.
625 ]])
626 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
627                                   Custom Tables
628 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
629 │                                                                │     │ Column│
630 │                                                                │Count│   %   │
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%│
636 │                                             a year             │     │       │
637 │                                             Never              │  540│   7.7%│
638 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
639
640                                   Custom Tables
641 ╭────────────────────────────────────────────────────────────────────────┬─────╮
642 │ 1. How often do you usually drive a car or  Every day           Count  │ 4667│
643 │other motor vehicle?                                             Column │66.9%│
644 │                                                                 %      │     │
645 │                                            ╶───────────────────────────┼─────┤
646 │                                             Several days a week Count  │ 1274│
647 │                                                                 Column │18.3%│
648 │                                                                 %      │     │
649 │                                            ╶───────────────────────────┼─────┤
650 │                                             Once a week or less Count  │  361│
651 │                                                                 Column │ 5.2%│
652 │                                                                 %      │     │
653 │                                            ╶───────────────────────────┼─────┤
654 │                                             Only certain times  Count  │  130│
655 │                                             a year              Column │ 1.9%│
656 │                                                                 %      │     │
657 │                                            ╶───────────────────────────┼─────┤
658 │                                             Never               Count  │  540│
659 │                                                                 Column │ 7.7%│
660 │                                                                 %      │     │
661 ╰────────────────────────────────────────────────────────────────────────┴─────╯
662
663                                   Custom Tables
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│
668 │                                                                        │18.3%│
669 │                                                   Once a week or less  │  361│
670 │                                                                        │ 5.2%│
671 │                                                   Only certain times a │  130│
672 │                                                   year                 │ 1.9%│
673 │                                                   Never                │  540│
674 │                                                                        │ 7.7%│
675 ╰────────────────────────────────────────────────────────────────────────┴─────╯
676 ])
677 AT_CLEANUP
678
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],
682 [[GET 'nhtsa.sav'.
683 CTABLES /TABLE=qn17
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'.
687 ]])
688 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
689                                   Custom Tables
690 ╭────────────────────────────────────────────────────────────────────────┬─────╮
691 │                                                                        │Count│
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│
695 │                                                      Light beer        │  620│
696 │                                                      Wine              │ 1418│
697 │                                                      Wine coolers      │  137│
698 │                                                      Hard liquor or    │  888│
699 │                                                      mixed drinks      │     │
700 │                                                      Flavored malt     │   83│
701 │                                                      drinks            │     │
702 │                                                      Number responding │ 4221│
703 ╰────────────────────────────────────────────────────────────────────────┴─────╯
704
705                                   Custom Tables
706 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
707 │                                                                   │Mean│Count│
708 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
709 │Region NE       18. When you drink ANSWERFROM(QN17R1), about how   │4.36│  949│
710 │                many ANSWERFROM(QN17R2) do you usually drink per   │    │     │
711 │                sitting?                                           │    │     │
712 │      ╶────────────────────────────────────────────────────────────┼────┼─────┤
713 │       MW       18. When you drink ANSWERFROM(QN17R1), about how   │4.67│ 1027│
714 │                many ANSWERFROM(QN17R2) do you usually drink per   │    │     │
715 │                sitting?                                           │    │     │
716 │      ╶────────────────────────────────────────────────────────────┼────┼─────┤
717 │       S        18. When you drink ANSWERFROM(QN17R1), about how   │4.71│ 1287│
718 │                many ANSWERFROM(QN17R2) do you usually drink per   │    │     │
719 │                sitting?                                           │    │     │
720 │      ╶────────────────────────────────────────────────────────────┼────┼─────┤
721 │       W        18. When you drink ANSWERFROM(QN17R1), about how   │4.69│  955│
722 │                many ANSWERFROM(QN17R2) do you usually drink per   │    │     │
723 │                sitting?                                           │    │     │
724 │      ╶────────────────────────────────────────────────────────────┼────┼─────┤
725 │       All      18. When you drink ANSWERFROM(QN17R1), about how   │4.62│ 4218│
726 │       regions  many ANSWERFROM(QN17R2) do you usually drink per   │    │     │
727 │                sitting?                                           │    │     │
728 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
729 ])
730 AT_CLEANUP
731
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],
735 [[GET 'nhtsa.sav'.
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].
743 ]])
744 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
745                                                       Custom Tables
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 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
764
765                                                       Custom Tables
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 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
788
789                                                       Custom Tables
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 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
810 ])
811 AT_CLEANUP
812
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],
816 [[GET 'nhtsa.sav'.
817 CTABLES
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]
824 ]])
825 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
826                                                       Custom Tables
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 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
845 ])
846 AT_CLEANUP