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.
31 dnl - TITLES: )DATE, )TIME, )TABLE.
35 dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
40 dnl - Test WEIGHT and adjustment weights.
41 dnl - PCOMPUTE and PPROPERTIES.
42 dnl - HIDESMALLCOUNTS.
44 # AT_SETUP([CTABLES parsing])
45 # AT_DATA([ctables.sps],
46 # [[DATA LIST LIST NOTABLE /x y z.
47 # CTABLES /TABLE=(x + y) > z.
48 # CTABLES /TABLE=(x[c] + y[c]) > z.
49 # CTABLES /TABLE=(x + y) > z[c].
50 # CTABLES /TABLE=x BY y BY z.
51 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
52 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
54 # AT_CHECK([pspp ctables.sps])
57 AT_SETUP([CTABLES one categorical variable])
58 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
59 AT_DATA([ctables.sps],
62 CTABLES /TABLE BY qn1.
63 CTABLES /TABLE BY BY qn1.
65 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
67 ╭────────────────────────────────────────────────────────────────────────┬─────╮
69 ├────────────────────────────────────────────────────────────────────────┼─────┤
70 │ 1. How often do you usually drive a car or other Every day │ 4667│
71 │motor vehicle? Several days a week │ 1274│
72 │ Once a week or less │ 361│
73 │ Only certain times a │ 130│
76 ╰────────────────────────────────────────────────────────────────────────┴─────╯
79 ╭──────────────────────────────────────────────────────────────────────────────╮
80 │ 1. How often do you usually drive a car or other motor vehicle? │
81 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
82 │ │ Several days a │ Once a week or │ Only certain times a │ │
83 │Every day│ week │ less │ year │Never│
84 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
85 │ Count │ Count │ Count │ Count │Count│
86 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
87 │ 4667│ 1274│ 361│ 130│ 540│
88 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
100 AT_SETUP([CTABLES one scale variable])
101 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
102 AT_DATA([ctables.sps],
104 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
105 CTABLES /TABLE BY qnd1.
106 CTABLES /TABLE BY BY qnd1.
108 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
110 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
111 │ │Count│Mean│Std Deviation│Minimum│Maximum│
112 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
113 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
114 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
117 ╭──────────────────────────╮
118 │D1. AGE: What is your age?│
119 ├──────────────────────────┤
121 ├──────────────────────────┤
123 ╰──────────────────────────╯
126 D1. AGE: What is your age?
135 AT_SETUP([CTABLES simple stacking])
136 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
137 AT_DATA([ctables.sps],
139 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
141 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
143 ╭───────────────────────────────────────────────────────────────┬──────────────╮
150 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
151 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
152 │too much to drink to drive safely will A. Get certain │ │ │
153 │stopped by the police? Very likely │ 21%│ 22%│
154 │ Somewhat │ 38%│ 42%│
156 │ Somewhat │ 21%│ 18%│
160 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
161 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
162 │too much to drink to drive safely will B. Have an certain │ │ │
163 │accident? Very likely │ 36%│ 45%│
164 │ Somewhat │ 39%│ 32%│
170 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
171 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
172 │too much to drink to drive safely will C. Be certain │ │ │
173 │convicted for drunk driving? Very likely │ 32%│ 28%│
174 │ Somewhat │ 27%│ 32%│
176 │ Somewhat │ 15%│ 15%│
180 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
181 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
182 │too much to drink to drive safely will D. Be certain │ │ │
183 │arrested for drunk driving? Very likely │ 26%│ 27%│
184 │ Somewhat │ 32%│ 35%│
186 │ Somewhat │ 17%│ 15%│
190 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
195 AT_SETUP([CTABLES simple nesting])
196 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
197 AT_DATA([ctables.sps],
199 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
200 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
201 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
202 /CATEGORIES VARIABLES=qns3a TOTAL=YES
203 /CLABELS ROW=OPPOSITE.
205 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
207 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
210 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
211 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
212 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
213 │drive safely will A. Get stopped by Total │ 700│ 10%│
214 │the police? ╶──────────────────────────┼─────┼──────┤
215 │ Very S3a. Male │ 660│ 10%│
216 │ likely GENDER: Female│ 842│ 12%│
218 │ ╶──────────────────────────┼─────┼──────┤
219 │ Somewhat S3a. Male │ 1174│ 17%│
220 │ likely GENDER: Female│ 1589│ 23%│
222 │ ╶──────────────────────────┼─────┼──────┤
223 │ Somewhat S3a. Male │ 640│ 9%│
224 │ unlikely GENDER: Female│ 667│ 10%│
226 │ ╶──────────────────────────┼─────┼──────┤
227 │ Very S3a. Male │ 311│ 5%│
228 │ unlikely GENDER: Female│ 298│ 4%│
230 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
231 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
232 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
233 │drive safely will B. Have an accident? Total │ 1100│ 16%│
234 │ ╶──────────────────────────┼─────┼──────┤
235 │ Very S3a. Male │ 1104│ 16%│
236 │ likely GENDER: Female│ 1715│ 25%│
238 │ ╶──────────────────────────┼─────┼──────┤
239 │ Somewhat S3a. Male │ 1203│ 17%│
240 │ likely GENDER: Female│ 1214│ 18%│
242 │ ╶──────────────────────────┼─────┼──────┤
243 │ Somewhat S3a. Male │ 262│ 4%│
244 │ unlikely GENDER: Female│ 168│ 2%│
246 │ ╶──────────────────────────┼─────┼──────┤
247 │ Very S3a. Male │ 81│ 1%│
248 │ unlikely GENDER: Female│ 59│ 1%│
250 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
251 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
252 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
253 │drive safely will C. Be convicted for Total │ 1149│ 17%│
254 │drunk driving? ╶──────────────────────────┼─────┼──────┤
255 │ Very S3a. Male │ 988│ 14%│
256 │ likely GENDER: Female│ 1049│ 15%│
258 │ ╶──────────────────────────┼─────┼──────┤
259 │ Somewhat S3a. Male │ 822│ 12%│
260 │ likely GENDER: Female│ 1210│ 18%│
262 │ ╶──────────────────────────┼─────┼──────┤
263 │ Somewhat S3a. Male │ 446│ 7%│
264 │ unlikely GENDER: Female│ 548│ 8%│
266 │ ╶──────────────────────────┼─────┼──────┤
267 │ Very S3a. Male │ 268│ 4%│
268 │ unlikely GENDER: Female│ 354│ 5%│
270 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
271 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
272 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
273 │drive safely will D. Be arrested for Total │ 1101│ 16%│
274 │drunk driving? ╶──────────────────────────┼─────┼──────┤
275 │ Very S3a. Male │ 805│ 12%│
276 │ likely GENDER: Female│ 1029│ 15%│
278 │ ╶──────────────────────────┼─────┼──────┤
279 │ Somewhat S3a. Male │ 975│ 14%│
280 │ likely GENDER: Female│ 1332│ 19%│
282 │ ╶──────────────────────────┼─────┼──────┤
283 │ Somewhat S3a. Male │ 535│ 8%│
284 │ unlikely GENDER: Female│ 560│ 8%│
286 │ ╶──────────────────────────┼─────┼──────┤
287 │ Very S3a. Male │ 270│ 4%│
288 │ unlikely GENDER: Female│ 279│ 4%│
290 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
293 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
294 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
295 │ │ certain│likely│ likely │ unlikely│unlikely│
296 │ ├────────┼──────┼─────────┼─────────┼────────┤
298 │ │ Table %│ % │ Table % │ Table % │ Table %│
299 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
300 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
301 │GENDER: is it that drivers│ │ │ │ │ │
302 │ who have had too │ │ │ │ │ │
303 │ much to drink to │ │ │ │ │ │
304 │ drive safely will │ │ │ │ │ │
305 │ A. Get stopped by │ │ │ │ │ │
306 │ the police? │ │ │ │ │ │
307 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
308 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
309 │ is it that drivers│ │ │ │ │ │
310 │ who have had too │ │ │ │ │ │
311 │ much to drink to │ │ │ │ │ │
312 │ drive safely will │ │ │ │ │ │
313 │ A. Get stopped by │ │ │ │ │ │
314 │ the police? │ │ │ │ │ │
315 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
316 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
317 │ is it that drivers│ │ │ │ │ │
318 │ who have had too │ │ │ │ │ │
319 │ much to drink to │ │ │ │ │ │
320 │ drive safely will │ │ │ │ │ │
321 │ A. Get stopped by │ │ │ │ │ │
322 │ the police? │ │ │ │ │ │
323 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
324 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
325 │GENDER: is it that drivers│ │ │ │ │ │
326 │ who have had too │ │ │ │ │ │
327 │ much to drink to │ │ │ │ │ │
328 │ drive safely will │ │ │ │ │ │
329 │ B. Have an │ │ │ │ │ │
330 │ accident? │ │ │ │ │ │
331 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
332 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
333 │ is it that drivers│ │ │ │ │ │
334 │ who have had too │ │ │ │ │ │
335 │ much to drink to │ │ │ │ │ │
336 │ drive safely will │ │ │ │ │ │
337 │ B. Have an │ │ │ │ │ │
338 │ accident? │ │ │ │ │ │
339 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
340 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
341 │ is it that drivers│ │ │ │ │ │
342 │ who have had too │ │ │ │ │ │
343 │ much to drink to │ │ │ │ │ │
344 │ drive safely will │ │ │ │ │ │
345 │ B. Have an │ │ │ │ │ │
346 │ accident? │ │ │ │ │ │
347 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
348 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
349 │GENDER: is it that drivers│ │ │ │ │ │
350 │ who have had too │ │ │ │ │ │
351 │ much to drink to │ │ │ │ │ │
352 │ drive safely will │ │ │ │ │ │
353 │ C. Be convicted │ │ │ │ │ │
354 │ for drunk driving?│ │ │ │ │ │
355 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
356 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
357 │ is it that drivers│ │ │ │ │ │
358 │ who have had too │ │ │ │ │ │
359 │ much to drink to │ │ │ │ │ │
360 │ drive safely will │ │ │ │ │ │
361 │ C. Be convicted │ │ │ │ │ │
362 │ for drunk driving?│ │ │ │ │ │
363 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
364 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
365 │ is it that drivers│ │ │ │ │ │
366 │ who have had too │ │ │ │ │ │
367 │ much to drink to │ │ │ │ │ │
368 │ drive safely will │ │ │ │ │ │
369 │ C. Be convicted │ │ │ │ │ │
370 │ for drunk driving?│ │ │ │ │ │
371 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
372 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
373 │GENDER: is it that drivers│ │ │ │ │ │
374 │ who have had too │ │ │ │ │ │
375 │ much to drink to │ │ │ │ │ │
376 │ drive safely will │ │ │ │ │ │
377 │ D. Be arrested for│ │ │ │ │ │
378 │ drunk driving? │ │ │ │ │ │
379 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
380 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
381 │ is it that drivers│ │ │ │ │ │
382 │ who have had too │ │ │ │ │ │
383 │ much to drink to │ │ │ │ │ │
384 │ drive safely will │ │ │ │ │ │
385 │ D. Be arrested for│ │ │ │ │ │
386 │ drunk driving? │ │ │ │ │ │
387 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
388 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
389 │ is it that drivers│ │ │ │ │ │
390 │ who have had too │ │ │ │ │ │
391 │ much to drink to │ │ │ │ │ │
392 │ drive safely will │ │ │ │ │ │
393 │ D. Be arrested for│ │ │ │ │ │
394 │ drunk driving? │ │ │ │ │ │
395 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
399 AT_SETUP([CTABLES nesting and scale variables])
400 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
401 AT_DATA([ctables.sps],
403 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
404 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
405 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1.
406 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
408 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
410 ╭─────────────────────────────────────────────────────────────────┬────────────╮
416 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
417 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
418 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
420 │ Once a week or │ 44│ 54│
422 │ Only certain │ 34│ 41│
425 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
428 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
429 │ │Minimum│Maximum│Mean│
430 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
431 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
432 │What is GENDER: months, has there been a │ │ │ │
433 │your time when you felt you │ │ │ │
434 │age? should cut down on your No │ 16│ 86│ 46│
436 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
437 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
438 │ months, has there been a │ │ │ │
439 │ time when you felt you │ │ │ │
440 │ should cut down on your No │ 16│ 86│ 48│
442 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
443 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
444 │What is GENDER: months, has there been a │ │ │ │
445 │your time when people criticized No │ 16│ 86│ 46│
446 │age? your drinking? │ │ │ │
447 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
448 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
449 │ months, has there been a │ │ │ │
450 │ time when people criticized No │ 16│ 86│ 48│
451 │ your drinking? │ │ │ │
452 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
455 ╭──────────────────────────────────┬───────────────────────────────────────────╮
456 │ │S1. Including yourself, how many members of│
457 │ │ this household are age 16 or older? │
458 │ ├──────┬───────┬──────┬──────┬───────┬──────┤
460 │ │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
461 │ ├──────┼───────┼──────┼──────┼───────┼──────┤
462 │ │Column│ Column│Column│Column│ Column│Column│
463 │ │ % │ % │ % │ % │ % │ % │
464 ├──────────────────────────────────┼──────┼───────┼──────┼──────┼───────┼──────┤
465 │Sa1. RDD 105b. How Almost │ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
466 │SAMPLE likely is it certain │ │ │ │ │ │ │
467 │SOURCE: that drivers Very │ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
468 │ who have had likely │ │ │ │ │ │ │
469 │ too much to Somewhat│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
470 │ drink to likely │ │ │ │ │ │ │
471 │ drive safely Somewhat│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
472 │ will A. Get unlikely│ │ │ │ │ │ │
473 │ stopped by Very │ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
474 │ the police? unlikely│ │ │ │ │ │ │
475 ╰──────────────────────────────────┴──────┴───────┴──────┴──────┴───────┴──────╯
478 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
481 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
482 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
483 │group typical month did you have one or more │ │ │
484 │ alcoholic beverages to drink? │ │ │
485 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
486 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
487 │ typical month did you have one or more │ │ │
488 │ alcoholic beverages to drink? │ │ │
489 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
490 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
491 │ typical month did you have one or more │ │ │
492 │ alcoholic beverages to drink? │ │ │
493 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
494 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
495 │ typical month did you have one or more │ │ │
496 │ alcoholic beverages to drink? │ │ │
497 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
498 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
499 │ typical month did you have one or more │ │ │
500 │ alcoholic beverages to drink? │ │ │
501 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
502 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
503 │ older typical month did you have one or more │ │ │
504 │ alcoholic beverages to drink? │ │ │
505 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
510 AT_SETUP([CTABLES SLABELS])
511 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
512 AT_DATA([ctables.sps],
514 CTABLES /TABLE qn1 [COUNT COLPCT].
515 CTABLES /TABLE qn1 [COUNT COLPCT]
516 /SLABELS POSITION=ROW.
517 CTABLES /TABLE qn1 [COUNT COLPCT]
518 /SLABELS POSITION=ROW VISIBLE=NO.
520 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
522 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
525 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
526 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
527 │other motor vehicle? Several days a week│ 1274│ 18.3%│
528 │ Once a week or less│ 361│ 5.2%│
529 │ Only certain times │ 130│ 1.9%│
532 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
535 ╭────────────────────────────────────────────────────────────────────────┬─────╮
536 │ 1. How often do you usually drive a car or Every day Count │ 4667│
537 │other motor vehicle? Column │66.9%│
539 │ ╶───────────────────────────┼─────┤
540 │ Several days a week Count │ 1274│
543 │ ╶───────────────────────────┼─────┤
544 │ Once a week or less Count │ 361│
547 │ ╶───────────────────────────┼─────┤
548 │ Only certain times Count │ 130│
549 │ a year Column │ 1.9%│
551 │ ╶───────────────────────────┼─────┤
555 ╰────────────────────────────────────────────────────────────────────────┴─────╯
558 ╭────────────────────────────────────────────────────────────────────────┬─────╮
559 │ 1. How often do you usually drive a car or other Every day │ 4667│
560 │motor vehicle? │66.9%│
561 │ Several days a week │ 1274│
563 │ Once a week or less │ 361│
565 │ Only certain times a │ 130│
569 ╰────────────────────────────────────────────────────────────────────────┴─────╯
573 AT_SETUP([CTABLES simple totals])
574 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
575 AT_DATA([ctables.sps],
578 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
579 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
580 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
582 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
584 ╭────────────────────────────────────────────────────────────────────────┬─────╮
586 ├────────────────────────────────────────────────────────────────────────┼─────┤
587 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
588 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
591 │ Wine coolers │ 137│
592 │ Hard liquor or │ 888│
594 │ Flavored malt │ 83│
596 │ Number responding │ 4221│
597 ╰────────────────────────────────────────────────────────────────────────┴─────╯
600 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
602 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
603 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
604 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
606 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
607 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
608 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
610 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
611 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
612 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
614 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
615 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
616 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
618 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
619 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
620 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
622 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
626 AT_SETUP([CTABLES subtotals])
627 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
628 AT_DATA([ctables.sps],
630 CTABLES /TABLE=qn105ba BY qns1
631 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
632 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
633 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
634 CTABLES /TABLE=qn105ba BY qns1
635 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
636 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
638 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
640 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
641 │ │ S1. Including yourself, how many members of this household │
642 │ │ are age 16 or older? │
643 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
644 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
645 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
646 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
647 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
648 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
649 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
650 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
651 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
652 │ likely │ │ │ │ │ │ │ │
653 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
654 │ unlikely │ │ │ │ │ │ │ │
655 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
656 │ unlikely │ │ │ │ │ │ │ │
657 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
660 ╭────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────╮
661 │ │ S1. Including yourself, how many members of this │
662 │ │ household are age 16 or older? │
663 │ ├─────────┬────────┬─────────┬────────┬─────────┬─────────┤
664 │ │ 1 │ 2 │ 3 │ 4 │ 5 │6 or more│
665 │ ├─────────┼────────┼─────────┼────────┼─────────┼─────────┤
666 │ │ Column %│Column %│ Column %│Column %│ Column %│ Column %│
667 ├────────────────────────────────────────────────────────────┼─────────┼────────┼─────────┼────────┼─────────┼─────────┤
668 │105b. How likely is it that drivers who have had Almost │ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
669 │too much to drink to drive safely will A. Get certain │ │ │ │ │ │ │
670 │stopped by the police? Very likely│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
671 │ Somewhat │ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
672 │ likely │ │ │ │ │ │ │
673 │ Subtotal │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
674 │ Somewhat │ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
675 │ unlikely │ │ │ │ │ │ │
676 │ Very │ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
677 │ unlikely │ │ │ │ │ │ │
678 │ Subtotal │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
679 ╰────────────────────────────────────────────────────────────┴─────────┴────────┴─────────┴────────┴─────────┴─────────╯
682 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
683 │ │ S1. Including yourself, how many members of this household │
684 │ │ are age 16 or older? │
685 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
686 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
687 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
688 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
689 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
690 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
691 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
692 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
693 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
694 │ likely │ │ │ │ │ │ │ │
695 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
696 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
697 │ unlikely │ │ │ │ │ │ │ │
698 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
699 │ unlikely │ │ │ │ │ │ │ │
700 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
701 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯