3 # AT_SETUP([CTABLES parsing])
4 # AT_DATA([ctables.sps],
5 # [[DATA LIST LIST NOTABLE /x y z.
6 # CTABLES /TABLE=(x + y) > z.
7 # CTABLES /TABLE=(x[c] + y[c]) > z.
8 # CTABLES /TABLE=(x + y) > z[c].
9 # CTABLES /TABLE=x BY y BY z.
10 # CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
11 # CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
13 # AT_CHECK([pspp ctables.sps])
16 AT_SETUP([CTABLES one categorical variable])
17 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
18 AT_DATA([ctables.sps],
21 CTABLES /TABLE BY qn1.
22 CTABLES /TABLE BY BY qn1.
24 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
26 ╭────────────────────────────────────────────────────────────────────────┬─────╮
28 ├────────────────────────────────────────────────────────────────────────┼─────┤
29 │ 1. How often do you usually drive a car or other Every day │ 4667│
30 │motor vehicle? Several days a week │ 1274│
31 │ Once a week or less │ 361│
32 │ Only certain times a │ 130│
35 ╰────────────────────────────────────────────────────────────────────────┴─────╯
38 ╭──────────────────────────────────────────────────────────────────────────────╮
39 │ 1. How often do you usually drive a car or other motor vehicle? │
40 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
41 │ │ Several days a │ Once a week or │ Only certain times a │ │
42 │Every day│ week │ less │ year │Never│
43 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
44 │ Count │ Count │ Count │ Count │Count│
45 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
46 │ 4667│ 1274│ 361│ 130│ 540│
47 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
59 AT_SETUP([CTABLES one scale variable])
60 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
61 AT_DATA([ctables.sps],
63 CTABLES /TABLE qnd1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
64 CTABLES /TABLE BY qnd1.
65 CTABLES /TABLE BY BY qnd1.
67 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
69 ╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
70 │ │Count│Mean│Std Deviation│Minimum│Maximum│
71 ├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
72 │D1. AGE: What is your age?│ 6930│ 48│ 19│ 16│ 86│
73 ╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
76 ╭──────────────────────────╮
77 │D1. AGE: What is your age?│
78 ├──────────────────────────┤
80 ├──────────────────────────┤
82 ╰──────────────────────────╯
85 D1. AGE: What is your age?
94 AT_SETUP([CTABLES simple stacking])
95 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
96 AT_DATA([ctables.sps],
98 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
100 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
102 ╭───────────────────────────────────────────────────────────────┬──────────────╮
109 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
110 │105b. How likely is it that drivers who have had Almost │ 10%│ 11%│
111 │too much to drink to drive safely will A. Get certain │ │ │
112 │stopped by the police? Very likely │ 21%│ 22%│
113 │ Somewhat │ 38%│ 42%│
115 │ Somewhat │ 21%│ 18%│
119 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
120 │105b. How likely is it that drivers who have had Almost │ 14%│ 18%│
121 │too much to drink to drive safely will B. Have an certain │ │ │
122 │accident? Very likely │ 36%│ 45%│
123 │ Somewhat │ 39%│ 32%│
129 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
130 │105b. How likely is it that drivers who have had Almost │ 18%│ 16%│
131 │too much to drink to drive safely will C. Be certain │ │ │
132 │convicted for drunk driving? Very likely │ 32%│ 28%│
133 │ Somewhat │ 27%│ 32%│
135 │ Somewhat │ 15%│ 15%│
139 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
140 │105b. How likely is it that drivers who have had Almost │ 16%│ 16%│
141 │too much to drink to drive safely will D. Be certain │ │ │
142 │arrested for drunk driving? Very likely │ 26%│ 27%│
143 │ Somewhat │ 32%│ 35%│
145 │ Somewhat │ 17%│ 15%│
149 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
154 AT_SETUP([CTABLES simple nesting])
155 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
156 AT_DATA([ctables.sps],
158 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
159 /CATEGORIES VARIABLES=qns3a TOTAL=YES.
160 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
161 /CATEGORIES VARIABLES=qns3a TOTAL=YES
162 /CLABELS ROW=OPPOSITE.
164 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
166 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
169 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
170 │105b. How likely is it that drivers Almost S3a. Male │ 297│ 4%│
171 │who have had too much to drink to certain GENDER: Female│ 403│ 6%│
172 │drive safely will A. Get stopped by Total │ 700│ 10%│
173 │the police? ╶──────────────────────────┼─────┼──────┤
174 │ Very S3a. Male │ 660│ 10%│
175 │ likely GENDER: Female│ 842│ 12%│
177 │ ╶──────────────────────────┼─────┼──────┤
178 │ Somewhat S3a. Male │ 1174│ 17%│
179 │ likely GENDER: Female│ 1589│ 23%│
181 │ ╶──────────────────────────┼─────┼──────┤
182 │ Somewhat S3a. Male │ 640│ 9%│
183 │ unlikely GENDER: Female│ 667│ 10%│
185 │ ╶──────────────────────────┼─────┼──────┤
186 │ Very S3a. Male │ 311│ 5%│
187 │ unlikely GENDER: Female│ 298│ 4%│
189 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
190 │105b. How likely is it that drivers Almost S3a. Male │ 429│ 6%│
191 │who have had too much to drink to certain GENDER: Female│ 671│ 10%│
192 │drive safely will B. Have an accident? Total │ 1100│ 16%│
193 │ ╶──────────────────────────┼─────┼──────┤
194 │ Very S3a. Male │ 1104│ 16%│
195 │ likely GENDER: Female│ 1715│ 25%│
197 │ ╶──────────────────────────┼─────┼──────┤
198 │ Somewhat S3a. Male │ 1203│ 17%│
199 │ likely GENDER: Female│ 1214│ 18%│
201 │ ╶──────────────────────────┼─────┼──────┤
202 │ Somewhat S3a. Male │ 262│ 4%│
203 │ unlikely GENDER: Female│ 168│ 2%│
205 │ ╶──────────────────────────┼─────┼──────┤
206 │ Very S3a. Male │ 81│ 1%│
207 │ unlikely GENDER: Female│ 59│ 1%│
209 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
210 │105b. How likely is it that drivers Almost S3a. Male │ 539│ 8%│
211 │who have had too much to drink to certain GENDER: Female│ 610│ 9%│
212 │drive safely will C. Be convicted for Total │ 1149│ 17%│
213 │drunk driving? ╶──────────────────────────┼─────┼──────┤
214 │ Very S3a. Male │ 988│ 14%│
215 │ likely GENDER: Female│ 1049│ 15%│
217 │ ╶──────────────────────────┼─────┼──────┤
218 │ Somewhat S3a. Male │ 822│ 12%│
219 │ likely GENDER: Female│ 1210│ 18%│
221 │ ╶──────────────────────────┼─────┼──────┤
222 │ Somewhat S3a. Male │ 446│ 7%│
223 │ unlikely GENDER: Female│ 548│ 8%│
225 │ ╶──────────────────────────┼─────┼──────┤
226 │ Very S3a. Male │ 268│ 4%│
227 │ unlikely GENDER: Female│ 354│ 5%│
229 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
230 │105b. How likely is it that drivers Almost S3a. Male │ 498│ 7%│
231 │who have had too much to drink to certain GENDER: Female│ 603│ 9%│
232 │drive safely will D. Be arrested for Total │ 1101│ 16%│
233 │drunk driving? ╶──────────────────────────┼─────┼──────┤
234 │ Very S3a. Male │ 805│ 12%│
235 │ likely GENDER: Female│ 1029│ 15%│
237 │ ╶──────────────────────────┼─────┼──────┤
238 │ Somewhat S3a. Male │ 975│ 14%│
239 │ likely GENDER: Female│ 1332│ 19%│
241 │ ╶──────────────────────────┼─────┼──────┤
242 │ Somewhat S3a. Male │ 535│ 8%│
243 │ unlikely GENDER: Female│ 560│ 8%│
245 │ ╶──────────────────────────┼─────┼──────┤
246 │ Very S3a. Male │ 270│ 4%│
247 │ unlikely GENDER: Female│ 279│ 4%│
249 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
252 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
253 │ │ Almost │ Very │ Somewhat│ Somewhat│ Very │
254 │ │ certain│likely│ likely │ unlikely│unlikely│
255 │ ├────────┼──────┼─────────┼─────────┼────────┤
257 │ │ Table %│ % │ Table % │ Table % │ Table %│
258 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
259 │S3a. Male 105b. How likely │ 4%│ 10%│ 17%│ 9%│ 5%│
260 │GENDER: is it that drivers│ │ │ │ │ │
261 │ who have had too │ │ │ │ │ │
262 │ much to drink to │ │ │ │ │ │
263 │ drive safely will │ │ │ │ │ │
264 │ A. Get stopped by │ │ │ │ │ │
265 │ the police? │ │ │ │ │ │
266 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
267 │ Female 105b. How likely │ 6%│ 12%│ 23%│ 10%│ 4%│
268 │ is it that drivers│ │ │ │ │ │
269 │ who have had too │ │ │ │ │ │
270 │ much to drink to │ │ │ │ │ │
271 │ drive safely will │ │ │ │ │ │
272 │ A. Get stopped by │ │ │ │ │ │
273 │ the police? │ │ │ │ │ │
274 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
275 │ Total 105b. How likely │ 10%│ 22%│ 40%│ 19%│ 9%│
276 │ is it that drivers│ │ │ │ │ │
277 │ who have had too │ │ │ │ │ │
278 │ much to drink to │ │ │ │ │ │
279 │ drive safely will │ │ │ │ │ │
280 │ A. Get stopped by │ │ │ │ │ │
281 │ the police? │ │ │ │ │ │
282 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
283 │S3a. Male 105b. How likely │ 6%│ 16%│ 17%│ 4%│ 1%│
284 │GENDER: is it that drivers│ │ │ │ │ │
285 │ who have had too │ │ │ │ │ │
286 │ much to drink to │ │ │ │ │ │
287 │ drive safely will │ │ │ │ │ │
288 │ B. Have an │ │ │ │ │ │
289 │ accident? │ │ │ │ │ │
290 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
291 │ Female 105b. How likely │ 10%│ 25%│ 18%│ 2%│ 1%│
292 │ is it that drivers│ │ │ │ │ │
293 │ who have had too │ │ │ │ │ │
294 │ much to drink to │ │ │ │ │ │
295 │ drive safely will │ │ │ │ │ │
296 │ B. Have an │ │ │ │ │ │
297 │ accident? │ │ │ │ │ │
298 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
299 │ Total 105b. How likely │ 16%│ 41%│ 35%│ 6%│ 2%│
300 │ is it that drivers│ │ │ │ │ │
301 │ who have had too │ │ │ │ │ │
302 │ much to drink to │ │ │ │ │ │
303 │ drive safely will │ │ │ │ │ │
304 │ B. Have an │ │ │ │ │ │
305 │ accident? │ │ │ │ │ │
306 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
307 │S3a. Male 105b. How likely │ 8%│ 14%│ 12%│ 7%│ 4%│
308 │GENDER: is it that drivers│ │ │ │ │ │
309 │ who have had too │ │ │ │ │ │
310 │ much to drink to │ │ │ │ │ │
311 │ drive safely will │ │ │ │ │ │
312 │ C. Be convicted │ │ │ │ │ │
313 │ for drunk driving?│ │ │ │ │ │
314 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
315 │ Female 105b. How likely │ 9%│ 15%│ 18%│ 8%│ 5%│
316 │ is it that drivers│ │ │ │ │ │
317 │ who have had too │ │ │ │ │ │
318 │ much to drink to │ │ │ │ │ │
319 │ drive safely will │ │ │ │ │ │
320 │ C. Be convicted │ │ │ │ │ │
321 │ for drunk driving?│ │ │ │ │ │
322 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
323 │ Total 105b. How likely │ 17%│ 30%│ 30%│ 15%│ 9%│
324 │ is it that drivers│ │ │ │ │ │
325 │ who have had too │ │ │ │ │ │
326 │ much to drink to │ │ │ │ │ │
327 │ drive safely will │ │ │ │ │ │
328 │ C. Be convicted │ │ │ │ │ │
329 │ for drunk driving?│ │ │ │ │ │
330 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
331 │S3a. Male 105b. How likely │ 7%│ 12%│ 14%│ 8%│ 4%│
332 │GENDER: is it that drivers│ │ │ │ │ │
333 │ who have had too │ │ │ │ │ │
334 │ much to drink to │ │ │ │ │ │
335 │ drive safely will │ │ │ │ │ │
336 │ D. Be arrested for│ │ │ │ │ │
337 │ drunk driving? │ │ │ │ │ │
338 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
339 │ Female 105b. How likely │ 9%│ 15%│ 19%│ 8%│ 4%│
340 │ is it that drivers│ │ │ │ │ │
341 │ who have had too │ │ │ │ │ │
342 │ much to drink to │ │ │ │ │ │
343 │ drive safely will │ │ │ │ │ │
344 │ D. Be arrested for│ │ │ │ │ │
345 │ drunk driving? │ │ │ │ │ │
346 │ ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
347 │ Total 105b. How likely │ 16%│ 27%│ 34%│ 16%│ 8%│
348 │ is it that drivers│ │ │ │ │ │
349 │ who have had too │ │ │ │ │ │
350 │ much to drink to │ │ │ │ │ │
351 │ drive safely will │ │ │ │ │ │
352 │ D. Be arrested for│ │ │ │ │ │
353 │ drunk driving? │ │ │ │ │ │
354 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
358 AT_SETUP([CTABLES nesting and scale variables])
359 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
360 AT_DATA([ctables.sps],
362 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
363 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
364 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1.
365 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
367 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
369 ╭─────────────────────────────────────────────────────────────────┬────────────╮
375 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
376 │D1. AGE: What 1. How often do you usually drive Every day │ 46│ 46│
377 │is your age? a car or other motor vehicle? Several days a │ 51│ 59│
379 │ Once a week or │ 44│ 54│
381 │ Only certain │ 34│ 41│
384 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
387 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
388 │ │Minimum│Maximum│Mean│
389 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
390 │D1. AGE: S3a. Male 26. During the last 12 Yes│ 16│ 86│ 42│
391 │What is GENDER: months, has there been a │ │ │ │
392 │your time when you felt you │ │ │ │
393 │age? should cut down on your No │ 16│ 86│ 46│
395 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
396 │ Female 26. During the last 12 Yes│ 16│ 86│ 43│
397 │ months, has there been a │ │ │ │
398 │ time when you felt you │ │ │ │
399 │ should cut down on your No │ 16│ 86│ 48│
401 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
402 │D1. AGE: S3a. Male 27. During the last 12 Yes│ 16│ 86│ 38│
403 │What is GENDER: months, has there been a │ │ │ │
404 │your time when people criticized No │ 16│ 86│ 46│
405 │age? your drinking? │ │ │ │
406 │ ╶───────────────────────────────────────┼───────┼───────┼────┤
407 │ Female 27. During the last 12 Yes│ 17│ 69│ 37│
408 │ months, has there been a │ │ │ │
409 │ time when people criticized No │ 16│ 86│ 48│
410 │ your drinking? │ │ │ │
411 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
414 ╭──────────────────────────────────┬───────────────────────────────────────────╮
415 │ │S1. Including yourself, how many members of│
416 │ │ this household are age 16 or older? │
417 │ ├──────┬───────┬──────┬──────┬───────┬──────┤
419 │ │ 1 │ 2 │ 3 │ 4 │ 5 │ more │
420 │ ├──────┼───────┼──────┼──────┼───────┼──────┤
421 │ │Column│ Column│Column│Column│ Column│Column│
422 │ │ % │ % │ % │ % │ % │ % │
423 ├──────────────────────────────────┼──────┼───────┼──────┼──────┼───────┼──────┤
424 │Sa1. RDD 105b. How Almost │ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
425 │SAMPLE likely is it certain │ │ │ │ │ │ │
426 │SOURCE: that drivers Very │ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
427 │ who have had likely │ │ │ │ │ │ │
428 │ too much to Somewhat│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
429 │ drink to likely │ │ │ │ │ │ │
430 │ drive safely Somewhat│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
431 │ will A. Get unlikely│ │ │ │ │ │ │
432 │ stopped by Very │ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
433 │ the police? unlikely│ │ │ │ │ │ │
434 ╰──────────────────────────────────┴──────┴───────┴──────┴──────┴───────┴──────╯
437 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
440 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
441 │Age 16 to 25 20. On how many of the thirty days in this │ 5.2│ 6.0│
442 │group typical month did you have one or more │ │ │
443 │ alcoholic beverages to drink? │ │ │
444 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
445 │ 26 to 35 20. On how many of the thirty days in this │ 4.7│ 5.9│
446 │ typical month did you have one or more │ │ │
447 │ alcoholic beverages to drink? │ │ │
448 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
449 │ 36 to 45 20. On how many of the thirty days in this │ 5.5│ 6.8│
450 │ typical month did you have one or more │ │ │
451 │ alcoholic beverages to drink? │ │ │
452 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
453 │ 46 to 55 20. On how many of the thirty days in this │ 5.8│ 7.7│
454 │ typical month did you have one or more │ │ │
455 │ alcoholic beverages to drink? │ │ │
456 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
457 │ 56 to 65 20. On how many of the thirty days in this │ 6.3│ 8.2│
458 │ typical month did you have one or more │ │ │
459 │ alcoholic beverages to drink? │ │ │
460 │ ╶───────────────────────────────────────────────────────┼────┼──────────┤
461 │ 66 or 20. On how many of the thirty days in this │ 7.1│ 9.2│
462 │ older typical month did you have one or more │ │ │
463 │ alcoholic beverages to drink? │ │ │
464 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
469 AT_SETUP([CTABLES SLABELS])
470 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
471 AT_DATA([ctables.sps],
473 CTABLES /TABLE qn1 [COUNT COLPCT].
474 CTABLES /TABLE qn1 [COUNT COLPCT]
475 /SLABELS POSITION=ROW.
476 CTABLES /TABLE qn1 [COUNT COLPCT]
477 /SLABELS POSITION=ROW VISIBLE=NO.
479 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
481 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
484 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
485 │ 1. How often do you usually drive a car or Every day │ 4667│ 66.9%│
486 │other motor vehicle? Several days a week│ 1274│ 18.3%│
487 │ Once a week or less│ 361│ 5.2%│
488 │ Only certain times │ 130│ 1.9%│
491 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
494 ╭────────────────────────────────────────────────────────────────────────┬─────╮
495 │ 1. How often do you usually drive a car or Every day Count │ 4667│
496 │other motor vehicle? Column │66.9%│
498 │ ╶───────────────────────────┼─────┤
499 │ Several days a week Count │ 1274│
502 │ ╶───────────────────────────┼─────┤
503 │ Once a week or less Count │ 361│
506 │ ╶───────────────────────────┼─────┤
507 │ Only certain times Count │ 130│
508 │ a year Column │ 1.9%│
510 │ ╶───────────────────────────┼─────┤
514 ╰────────────────────────────────────────────────────────────────────────┴─────╯
517 ╭────────────────────────────────────────────────────────────────────────┬─────╮
518 │ 1. How often do you usually drive a car or other Every day │ 4667│
519 │motor vehicle? │66.9%│
520 │ Several days a week │ 1274│
522 │ Once a week or less │ 361│
524 │ Only certain times a │ 130│
528 ╰────────────────────────────────────────────────────────────────────────┴─────╯
532 AT_SETUP([CTABLES simple totals])
533 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
534 AT_DATA([ctables.sps],
537 /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
538 CTABLES /TABLE=region > qn18 [MEAN, COUNT]
539 /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
541 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
543 ╭────────────────────────────────────────────────────────────────────────┬─────╮
545 ├────────────────────────────────────────────────────────────────────────┼─────┤
546 │17. When you drink alcoholic beverages, which ONE of OR, something else│ 2│
547 │the following beverages do you drink MOST OFTEN? Beer │ 1073│
550 │ Wine coolers │ 137│
551 │ Hard liquor or │ 888│
553 │ Flavored malt │ 83│
555 │ Number responding │ 4221│
556 ╰────────────────────────────────────────────────────────────────────────┴─────╯
559 ╭───────────────────────────────────────────────────────────────────┬────┬─────╮
561 ├───────────────────────────────────────────────────────────────────┼────┼─────┤
562 │Region NE 18. When you drink ANSWERFROM(QN17R1), about how │4.36│ 949│
563 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
565 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
566 │ MW 18. When you drink ANSWERFROM(QN17R1), about how │4.67│ 1027│
567 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
569 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
570 │ S 18. When you drink ANSWERFROM(QN17R1), about how │4.71│ 1287│
571 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
573 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
574 │ W 18. When you drink ANSWERFROM(QN17R1), about how │4.69│ 955│
575 │ many ANSWERFROM(QN17R2) do you usually drink per │ │ │
577 │ ╶────────────────────────────────────────────────────────────┼────┼─────┤
578 │ All 18. When you drink ANSWERFROM(QN17R1), about how │4.62│ 4218│
579 │ regions many ANSWERFROM(QN17R2) do you usually drink per │ │ │
581 ╰───────────────────────────────────────────────────────────────────┴────┴─────╯
585 AT_SETUP([CTABLES subtotals])
586 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
587 AT_DATA([ctables.sps],
589 CTABLES /TABLE=qn105ba BY qns1
590 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
591 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
592 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
593 CTABLES /TABLE=qn105ba BY qns1
594 /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
595 /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
597 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
599 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
600 │ │ S1. Including yourself, how many members of this household │
601 │ │ are age 16 or older? │
602 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
603 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
604 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
605 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
606 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
607 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
608 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
609 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
610 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
611 │ likely │ │ │ │ │ │ │ │
612 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
613 │ unlikely │ │ │ │ │ │ │ │
614 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
615 │ unlikely │ │ │ │ │ │ │ │
616 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
619 ╭────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────╮
620 │ │ S1. Including yourself, how many members of this │
621 │ │ household are age 16 or older? │
622 │ ├─────────┬────────┬─────────┬────────┬─────────┬─────────┤
623 │ │ 1 │ 2 │ 3 │ 4 │ 5 │6 or more│
624 │ ├─────────┼────────┼─────────┼────────┼─────────┼─────────┤
625 │ │ Column %│Column %│ Column %│Column %│ Column %│ Column %│
626 ├────────────────────────────────────────────────────────────┼─────────┼────────┼─────────┼────────┼─────────┼─────────┤
627 │105b. How likely is it that drivers who have had Almost │ 9.5%│ 8.2%│ 12.4%│ 9.9%│ 20.0%│ 23.8%│
628 │too much to drink to drive safely will A. Get certain │ │ │ │ │ │ │
629 │stopped by the police? Very likely│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
630 │ Somewhat │ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
631 │ likely │ │ │ │ │ │ │
632 │ Subtotal │ 72.8%│ 68.6%│ 75.0%│ 74.0%│ 81.8%│ 81.0%│
633 │ Somewhat │ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│ 9.5%│
634 │ unlikely │ │ │ │ │ │ │
635 │ Very │ 9.2%│ 9.7%│ 8.2%│ 9.4%│ 7.3%│ 9.5%│
636 │ unlikely │ │ │ │ │ │ │
637 │ Subtotal │ 27.2%│ 31.4%│ 25.0%│ 26.0%│ 18.2%│ 19.0%│
638 ╰────────────────────────────────────────────────────────────┴─────────┴────────┴─────────┴────────┴─────────┴─────────╯
641 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
642 │ │ S1. Including yourself, how many members of this household │
643 │ │ are age 16 or older? │
644 │ ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
645 │ │ 1 │ 2 │ Subtotal│ 3 │ 4 │ 5 │ Subtotal │
646 │ ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
647 │ │ Count │ Count │ Count │ Count │ Count │ Count│ Count │
648 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
649 │105b. How likely is it that drivers who have Almost │ 147│ 246│ 393│ 62│ 19│ 11│ 92│
650 │had too much to drink to drive safely will A. certain │ │ │ │ │ │ │ │
651 │Get stopped by the police? Very likely│ 384│ 552│ 936│ 120│ 51│ 14│ 185│
652 │ Somewhat │ 590│ 1249│ 1839│ 193│ 72│ 20│ 285│
653 │ likely │ │ │ │ │ │ │ │
654 │ Subtotal │ 1121│ 2047│ 3168│ 375│ 142│ 45│ 562│
655 │ Somewhat │ 278│ 647│ 925│ 84│ 32│ 6│ 122│
656 │ unlikely │ │ │ │ │ │ │ │
657 │ Very │ 141│ 290│ 431│ 41│ 18│ 4│ 63│
658 │ unlikely │ │ │ │ │ │ │ │
659 │ Subtotal │ 419│ 937│ 1356│ 125│ 50│ 10│ 185│
660 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯