-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReplication code for STOP Experiment.Rmd
581 lines (464 loc) · 19.6 KB
/
Replication code for STOP Experiment.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
---
title: "Safer Transit Options for Passengers Experiment Replication Code"
output: html_notebook
---
For the Safer Transit Options for Passengers field experiment, CRRC-Georgia interviewers observed about 360 minibus trips. However, some routes observed in the treatment and control groups were found in both groups or observed multiple times within the same wave. Given this, a number of observations were excluded when performing inferential statistics.
The logic of observation exclusion is as follows.Only one observation was kept per wave of observation. Hence, if a minibus was observed twice in the second round of observations, only one observation was kept. Only the first observation was kept, given that a person riding on a minibus and immediately returning on the same bus would likely arouse driver suspicion.In one case, a minibus was observed five times in total. The same logic was applied in this case, with only the first observation kept per wave.
Besides this issue, a number of minibuses were not found at the second measureement phase.Given this issue, multivariate matching with genetic weights was used in the analysis.
If you are interested in conducting a similar experiment and want to hear about some of our lessons learnt from conducting the trial, get in touch and we are happy to have a conversation.
After excluding problematic observations, there were 68 in the first wave control group, 103 in the treatment group second wave of observation, 60 in the third wave of observation treatment group, and 107 in the new or former control group.
```{r}
## Subsetting included observations
stopsub<-subset(stop, keep==1)
table(stopsub$group)
```
The code below was used for subsetting and matching.
```{r}
stopsub$condition<-as.numeric(stopsub$group)
stopsubt1c1<-subset(stopsub, stopsub$condition==1|stopsub$condition==2)
stopsubc1c2<-subset(stopsub, stopsub$condition==1|stopsub$condition==4)
stopsubt1t2<-subset(stopsub, stopsub$condition==2|stopsub$condition==3)
table(stopsubt1c1$condition)
stopsubt1c1$treat<-stopsubt1c1$condition
stopsubt1c1$treat[stopsubt1c1$treat==1]<-0
stopsubt1c1$treat[stopsubt1c1$treat==2]<-1
table(stopsubt1c1$treat)
stopsubc1c2$treat<-stopsubc1c2$condition
table(stopsubc1c2$treat)
stopsubc1c2$treat[stopsubc1c2$treat==1]<-0
stopsubc1c2$treat[stopsubc1c2$treat==4]<-1
stopsubt1t2$treat<-stopsubt1t2$condition
table(stopsubt1t2$treat)
stopsubt1t2$treat[stopsubt1t2$treat==2]<-0
stopsubt1t2$treat[stopsubt1t2$treat==3]<-1
psmodelstop1<-glm(stopsubt1c1$treat~stopsubt1c1$e1 + stopsubt1c1$e2 + stopsubt1c1$e5 + stopsubt1c1$e6 + stopsubt1c1$e7 + stopsubt1c1$e8 + stopsubt1c1$e9 + stopsubt1c1$distance, family = binomial)
stopsubt1c1$psm<-psmodelstop1$fitted.values
psmodelstop2<-glm(stopsubc1c2$treat~stopsubc1c2$e1 + stopsubc1c2$e2 + stopsubc1c2$e3 + stopsubc1c2$e4 + stopsubc1c2$e5 + stopsubc1c2$e6 + stopsubc1c2$e7 + stopsubc1c2$e8 + stopsubc1c2$e9 + stopsubc1c2$distance, family = binomial)
stopsubc1c2$psm<-psmodelstop2$fitted.values
psmodelstop3<-glm(stopsubt1t2$treat~stopsubt1t2$e1 + stopsubt1t2$e2 + stopsubt1t2$e3 + stopsubt1t2$e4 + stopsubt1t2$e5 + stopsubt1t2$e6 + stopsubt1t2$e7 + stopsubt1t2$e8 + stopsubt1t2$e9 + stopsubt1t2$distance, family = binomial)
stopsubt1t2$psm<-psmodelstop3$fitted.values
### match on
XTC = cbind(stopsubt1c1$e1, stopsubt1c1$e2, stopsubt1c1$e5, stopsubt1c1$e6, stopsubt1c1$e7, stopsubt1c1$e8, stopsubt1c1$e9, stopsubt1c1$distance, stopsubt1c1$psm)
XCC = cbind(stopsubc1c2$e1, stopsubc1c2$e2, stopsubc1c2$e5, stopsubc1c2$e6, stopsubc1c2$e7, stopsubc1c2$e8, stopsubc1c2$e9, stopsubc1c2$distance, stopsubc1c2$psm)
XTT = cbind(stopsubt1t2$e1, stopsubt1t2$e2, stopsubt1t2$e5, stopsubt1t2$e6, stopsubt1t2$e7, stopsubt1t2$e8, stopsubt1t2$e9, stopsubt1t2$distance, stopsubt1t2$psm)
BalmatTC = cbind(stopsubt1c1$e1, stopsubt1c1$e2, stopsubt1c1$e5, stopsubt1c1$e6, stopsubt1c1$e7, stopsubt1c1$e8, stopsubt1c1$e9, stopsubt1c1$distance, stopsubt1c1$psm)
BalmatCC = cbind(stopsubc1c2$e1, stopsubc1c2$e2, stopsubc1c2$e5, stopsubc1c2$e6, stopsubc1c2$e7, stopsubc1c2$e8, stopsubc1c2$e9, stopsubc1c2$distance, stopsubc1c2$psm)
BalmatTT = cbind(stopsubt1t2$e1, stopsubt1t2$e2, stopsubt1t2$e5, stopsubt1t2$e6, stopsubt1t2$e7, stopsubt1t2$e8, stopsubt1t2$e9, stopsubt1t2$distance, stopsubt1t2$psm)
genoutTC <- GenMatch(Tr=stopsubt1c1$treat, X=XTC, int.seed = 42, unif.seed = 43,
BalanceMatrix=BalmatTC, estimand="ATT",
pop.size=500)
genoutCC <- GenMatch(Tr=stopsubc1c2$treat, X=XCC, int.seed = 42, unif.seed = 43,
BalanceMatrix=BalmatCC, estimand="ATT",
pop.size=500)
genoutTT <- GenMatch(Tr=stopsubt1t2$treat, X=XTT, int.seed = 42, unif.seed = 43,
BalanceMatrix=BalmatTT, estimand="ATT",
pop.size=500)
```
Match balance is tested for below in the wave 1 treatment and control group observations.
```{r}
mout1<-Match(Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
mb1 <- MatchBalance(stopsubt1c1$treat ~stopsubt1c1$e1 + stopsubt1c1$e2 + stopsubt1c1$e5 + stopsubt1c1$e6 + stopsubt1c1$e7 + stopsubt1c1$e8 + stopsubt1c1$e9 + stopsubt1c1$distance + stopsubt1c1$psm , match.out=mout1, nboots=5000)
```
Here match balance is presented for the comparison of the treatment wave one observations as well as treatment wave two observations.
```{r}
mout2<-Match(Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
mb2 <- MatchBalance(stopsubt1t2$treat ~stopsubt1t2$e1 + stopsubt1t2$e2 + stopsubt1t2$e5 + stopsubt1t2$e6 + stopsubt1t2$e7 + stopsubt1t2$e8 + stopsubt1t2$e9 + stopsubt1t2$distance + stopsubt1t2$psm , match.out=mout2, nboots=5000)
```
Finally, the match balance for the comparison of control groups in the first round of observation compared to in the second round of observation.
```{r}
mout3<-Match(Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
mb3 <- MatchBalance(stopsubc1c2$treat ~stopsubc1c2$e1 + stopsubc1c2$e2 + stopsubc1c2$e5 + stopsubc1c2$e6 + stopsubc1c2$e7 + stopsubc1c2$e8 + stopsubc1c2$e9 + stopsubc1c2$distance + stopsubc1c2$psm , match.out=mout3, nboots=5000)
```
Below is the code used to estimate the overall treatment effect.
```{r}
moutTC <- Match(Y=stopsubt1c1$total, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTC)
```
And the 95% confidence intervals.
```{r}
tottcconup<-(moutTC$est+moutTC$se*1.96)
tottccondown<-(moutTC$est-moutTC$se*1.96)
tottcinter<-c(tottcconup,tottccondown)
tottcinter
```
Estimates for changes in speed.
```{r}
moutTCspeed <- Match(Y=stopsubt1c1$speed, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCspeed)
```
And the 95% confidence intervals.
```{r}
speedtcconup<-(moutTCspeed$est+moutTCspeed$se*1.96)
speedtccondown<-(moutTCspeed$est-moutTCspeed$se*1.96)
speedtcinter<-c(speedtcconup,speedtccondown)
speedtcinter
```
Estimate of the decline in telephone calls.
```{r}
moutTCtelephone <- Match(Y=stopsubt1c1$Telephone, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCtelephone)
```
And the 95% confidence intervals.
```{r}
telephonetcconup<-(moutTCtelephone$est+moutTCtelephone$se*1.96)
telephonetccondown<-(moutTCtelephone$est-moutTCtelephone$se*1.96)
telephonetcinter<-c(telephonetcconup,telephonetccondown)
telephonetcinter
```
Estimates for effects on texting.
```{r}
moutTCtexting <- Match(Y=stopsubt1c1$Texting, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCtexting)
```
And the 95% confidence intervals.
```{r}
textingtcconup<-(moutTCtexting$est+moutTCtexting$se*1.96)
textingtccondown<-(moutTCtexting$est-moutTCtexting$se*1.96)
textingtcinter<-c(textingtcconup,textingtccondown)
textingtcinter
```
Estimates for the effect on smoking.
```{r}
moutTCsmoking <- Match(Y=stopsubt1c1$Smoking, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCsmoking)
```
And the 95% confidence intervals.
```{r}
smokingtcconup<-(moutTCsmoking$est+moutTCsmoking$se*1.96)
smokingtccondown<-(moutTCsmoking$est-moutTCsmoking$se*1.96)
smokingtcinter<-c(smokingtcconup,smokingtccondown)
smokingtcinter
```
And the estimate for seat belt use.
```{r}
moutTCbelt <- Match(Y=stopsubt1c1$Belt, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCbelt)
```
And the 95% confidence intervals.
```{r}
belttcconup<-(moutTCbelt$est+moutTCbelt$se*1.96)
belttccondown<-(moutTCbelt$est-moutTCbelt$se*1.96)
belttcinter<-c(belttcconup,belttccondown)
belttcinter
```
The data on passing.
```{r}
moutTCpass <- Match(Y=stopsubt1c1$Pass, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCpass)
```
And the 95% confidence intervals.
```{r}
passtcconup<-(moutTCpass$est+moutTCpass$se*1.96)
passtccondown<-(moutTCpass$est-moutTCpass$se*1.96)
passtcinter<-c(passtcconup,passtccondown)
passtcinter
```
The data on aggressive maneuvers.
```{r}
moutTCagman <- Match(Y=stopsubt1c1$Agman, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCagman)
```
And the 95% confidence intervals.
```{r}
agmantcconup<-(moutTCagman$est+moutTCagman$se*1.96)
agmantccondown<-(moutTCagman$est-moutTCagman$se*1.96)
agmantcinter<-c(agmantcconup,agmantccondown)
agmantcinter
```
Aggressive behavior towards passengers.
```{r}
moutTCagpassenger <- Match(Y=stopsubt1c1$Agpassenger, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCagpassenger)
```
And the 95% confidence intervals.
```{r}
agpassengertcconup<-(moutTCagpassenger$est+moutTCagpassenger$se*1.96)
agpassengertccondown<-(moutTCagpassenger$est-moutTCagpassenger$se*1.96)
agpassengertcinter<-c(agpassengertcconup,agpassengertccondown)
agpassengertcinter
```
Estimates on aggressive behavior towards non-passengers.
```{r}
moutTCagother <- Match(Y=stopsubt1c1$Agother, Tr=stopsubt1c1$treat, X=XTC, estimand="ATT",
Weight.matrix=genoutTC)
summary(moutTCagother)
```
And the 95% confidence intervals.
```{r}
agothertcconup<-(moutTCagother$est+moutTCagother$se*1.96)
agothertccondown<-(moutTCagother$est-moutTCagother$se*1.96)
agothertcinter<-c(agothertcconup,agothertccondown)
agothertcinter
```
Below we test for a contamination effect, comparing the first round control group to the second round control group. Overall, we see no contamination effect.
```{r}
moutCC <- Match(Y=stopsubc1c2$total, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCC)
```
And the 95% confidence intervals.
```{r}
totccconup<-(moutCC$est+moutCC$se*1.96)
totcccondown<-(moutCC$est-moutCC$se*1.96)
totccinter<-c(totccconup,totcccondown)
totccinter
```
The estimates for speed are significant.
```{r}
moutCCspeed <- Match(Y=stopsubc1c2$speed, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCspeed)
```
And the 95% confidence intervals.
```{r}
speedccconup<-(moutCCspeed$est+moutCCspeed$se*1.96)
speedcccondown<-(moutCCspeed$est-moutCCspeed$se*1.96)
speedccinter<-c(speedccconup,speedcccondown)
speedccinter
```
For telephone calls.
```{r}
moutCCtelephone <- Match(Y=stopsubc1c2$Telephone, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCtelephone)
```
And the 95% confidence intervals.
```{r}
telephoneccconup<-(moutCCtelephone$est+moutCCtelephone$se*1.96)
telephonecccondown<-(moutCCtelephone$est-moutCCtelephone$se*1.96)
telephoneccinter<-c(telephoneccconup,telephonecccondown)
telephoneccinter
```
Estimates on text messaging.
```{r}
moutCCtexting <- Match(Y=stopsubc1c2$Texting, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCtexting)
```
And the 95% confidence intervals.
```{r}
textingccconup<-(moutCCtexting$est+moutCCtexting$se*1.96)
textingcccondown<-(moutCCtexting$est-moutCCtexting$se*1.96)
textingccinter<-c(textingccconup,textingcccondown)
textingccinter
```
Estimates on smoking.
```{r}
moutCCsmoking <- Match(Y=stopsubc1c2$Smoking, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCsmoking)
```
And the 95% confidence intervals.
```{r}
smokingccconup<-(moutCCsmoking$est+moutCCsmoking$se*1.96)
smokingcccondown<-(moutCCsmoking$est-moutCCsmoking$se*1.96)
smokingccinter<-c(smokingccconup,smokingcccondown)
smokingccinter
```
Estimates for seatbelt use.
```{r}
moutCCbelt <- Match(Y=stopsubc1c2$Belt, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCbelt)
```
And the 95% confidence intervals.
```{r}
beltccconup<-(moutCCbelt$est+moutCCbelt$se*1.96)
beltcccondown<-(moutCCbelt$est-moutCCbelt$se*1.96)
beltccinter<-c(beltccconup,beltcccondown)
beltccinter
```
Estimates for passing.
```{r}
moutCCpass <- Match(Y=stopsubc1c2$Pass, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCpass)
```
And the 95% confidence intervals.
```{r}
passccconup<-(moutCCpass$est+moutCCpass$se*1.96)
passcccondown<-(moutCCpass$est-moutCCpass$se*1.96)
passccinter<-c(passccconup,passcccondown)
passccinter
```
Estimates for aggressive maneuvers.
```{r}
moutCCagman <- Match(Y=stopsubc1c2$Agman, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCagman)
```
And the 95% confidence intervals.
```{r}
agmanccconup<-(moutCCagman$est+moutCCagman$se*1.96)
agmancccondown<-(moutCCagman$est-moutCCagman$se*1.96)
agmanccinter<-c(agmanccconup,agmancccondown)
agmanccinter
```
Estimates for aggressive behavior towards passengers.
```{r}
moutCCagpassenger <- Match(Y=stopsubc1c2$Agpassenger, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCagpassenger)
```
And the 95% confidence intervals.
```{r}
agpassengerccconup<-(moutCCagpassenger$est+moutCCagpassenger$se*1.96)
agpassengercccondown<-(moutCCagpassenger$est-moutCCagpassenger$se*1.96)
agpassengerccinter<-c(agpassengerccconup,agpassengercccondown)
agpassengerccinter
```
Estimates for aggressive maneuvers.
```{r}
moutCCagother <- Match(Y=stopsubc1c2$Agother, Tr=stopsubc1c2$treat, X=XCC, estimand="ATT",
Weight.matrix=genoutCC)
summary(moutCCagother)
```
And the 95% confidence intervals.
```{r}
agotherccconup<-(moutCCagother$est+moutCCagother$se*1.96)
agothercccondown<-(moutCCagother$est-moutCCagother$se*1.96)
agotherccinter<-c(agotherccconup,agothercccondown)
agotherccinter
```
Below we present estimates for lasting effects. If there is no significant change, this potentially suggests a lack of lasting effect. The logic of this is that if there is no significant increase from the significantly lower level of dangerous driving behavior, then this suggests that dangerous driving behaviors remained at lower levels. Overall, we find a lasting effect, but dangerous driving behaviors increased.
```{r}
moutTT <- Match(Y=stopsubt1t2$total, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTT)
```
And the 95% confidence intervals.
```{r}
totttconup<-(moutTT$est+moutTT$se*1.96)
totttcondown<-(moutTT$est-moutTT$se*1.96)
totttinter<-c(totttconup,totttcondown)
totttinter
```
Estimates on speed.
```{r}
moutTTspeed <- Match(Y=stopsubt1t2$speed, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTspeed)
```
And the 95% confidence intervals.
```{r}
speedttconup<-(moutTTspeed$est+moutTTspeed$se*1.96)
speedttcondown<-(moutTTspeed$est-moutTTspeed$se*1.96)
speedttinter<-c(speedttconup,speedttcondown)
speedttinter
```
Estimates for telephone calls.
```{r}
moutTTtelephone <- Match(Y=stopsubt1t2$Telephone, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTtelephone)
```
And the 95% confidence intervals.
```{r}
telephonettconup<-(moutTTtelephone$est+moutTTtelephone$se*1.96)
telephonettcondown<-(moutTTtelephone$est-moutTTtelephone$se*1.96)
telephonettinter<-c(telephonettconup,telephonettcondown)
telephonettinter
```
Estimates for text messaging.
```{r}
moutTTtexting <- Match(Y=stopsubt1t2$Texting, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTtexting)
```
And the 95% confidence intervals.
```{r}
textingttconup<-(moutTTtexting$est+moutTTtexting$se*1.96)
textingttcondown<-(moutTTtexting$est-moutTTtexting$se*1.96)
textingttinter<-c(textingttconup,textingttcondown)
textingttinter
```
Estimates for smoking.
```{r}
moutTTsmoking <- Match(Y=stopsubt1t2$Smoking, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTsmoking)
```
And the 95% confidence intervals.
```{r}
smokingttconup<-(moutTTsmoking$est+moutTTsmoking$se*1.96)
smokingttcondown<-(moutTTsmoking$est-moutTTsmoking$se*1.96)
smokingttinter<-c(smokingttconup,smokingttcondown)
smokingttinter
```
Estimates for seat belt use.
```{r}
moutTTbelt <- Match(Y=stopsubt1t2$Belt, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTbelt)
```
And the 95% confidence intervals.
```{r}
beltttconup<-(moutTTbelt$est+moutTTbelt$se*1.96)
beltttcondown<-(moutTTbelt$est-moutTTbelt$se*1.96)
beltttinter<-c(beltttconup,beltttcondown)
beltttinter
```
Estimates for illegal passing.
```{r}
moutTTpass <- Match(Y=stopsubt1t2$Pass, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTpass)
```
And the 95% confidence intervals.
```{r}
passttconup<-(moutTTpass$est+moutTTpass$se*1.96)
passttcondown<-(moutTTpass$est-moutTTpass$se*1.96)
passttinter<-c(passttconup,passttcondown)
passttinter
```
Estimates for aggressive maneuvers.
```{r}
moutTTagman <- Match(Y=stopsubt1t2$Agman, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTagman)
```
And the 95% confidence intervals.
```{r}
agmanttconup<-(moutTTagman$est+moutTTagman$se*1.96)
agmanttcondown<-(moutTTagman$est-moutTTagman$se*1.96)
agmanttinter<-c(agmanttconup,agmanttcondown)
agmanttinter
```
Estimates for aggression towards passengers.
```{r}
moutTTagpassenger <- Match(Y=stopsubt1t2$Agpassenger, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTagpassenger)
```
And the 95% confidence intervals.
```{r}
agpassengerttconup<-(moutTTagpassenger$est+moutTTagpassenger$se*1.96)
agpassengerttcondown<-(moutTTagpassenger$est-moutTTagpassenger$se*1.96)
agpassengerttinter<-c(agpassengerttconup,agpassengerttcondown)
agpassengerttinter
```
Estimates for aggressive towards others.
```{r}
moutTTagother <- Match(Y=stopsubt1t2$Agother, Tr=stopsubt1t2$treat, X=XTT, estimand="ATT",
Weight.matrix=genoutTT)
summary(moutTTagother)
```
And the 95% confidence intervals.
```{r}
agotherttconup<-(moutTTagother$est+moutTTagother$se*1.96)
agotherttcondown<-(moutTTagother$est-moutTTagother$se*1.96)
agotherttinter<-c(agotherttconup,agotherttcondown)
agotherttinter
```