-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReplicationCode.do
More file actions
1911 lines (1863 loc) · 77.1 KB
/
ReplicationCode.do
File metadata and controls
1911 lines (1863 loc) · 77.1 KB
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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
***Figure 1***
clear
set more off
use "Senate.dta"
keep year congress senator earmarks appropriations
drop if year < 2008
egen minyear = min(year), by(senator)
egen maxyear = max(year), by(senator)
drop if minyear != 2008
drop if maxyear != 2010
egen category = mean(appropriations), by(senator)
replace category = 2 if category != 0 & category != 1
g category_year = category*1000 + congress
egen meanearmarks = mean(earmarks), by(category_year)
sort category_year
drop if category_year == category_year[_n-1]
keep category congress meanearmarks
rename meanearmarks earmarks
reshape wide earmarks, i(congress) j(category)
graph twoway (line earmarks* congress) (scatter earmarks* congress)
gr_edit .style.editstyle margin(vsmall) editcopy
gr_edit .style.editstyle boxstyle(shadestyle(color(white))) editcopy
gr_edit .style.editstyle boxstyle(linestyle(color(white))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Earmarks (dollars per capita)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Congress
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 110 111 1, tickset(major) ruletype(range)
gr_edit .yaxis1.reset_rule 0 100 20, tickset(major) ruletype(range)
gr_edit .xaxis1.plotregion.xscale.curmin = 109.8
gr_edit .xaxis1.plotregion.xscale.curmax = 111.2
gr_edit .plotregion1.plot5.style.editstyle marker(symbol(diamond)) editcopy
gr_edit .plotregion1.plot5.style.editstyle marker(fillcolor(green)) editcopy
gr_edit .plotregion1.plot5.style.editstyle marker(linestyle(color(green))) editcopy
gr_edit .plotregion1.plot5.style.editstyle marker(size(medlarge)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(green)) editcopy
gr_edit .plotregion1.AddTextBox added_text editor 85 110.7
gr_edit .plotregion1.added_text_new = 1
gr_edit .plotregion1.added_text_rec = 1
gr_edit .plotregion1.added_text[1].style.editstyle angle(default) size(small) color(green) horizontal(left) vertical(middle) margin(zero) linegap(zero) drawbox(no) boxmargin(zero) fillcolor(bluishgray) linestyle( width(thin) color(black) pattern(solid)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[1].text = {}
gr_edit .plotregion1.added_text[1].text.Arrpush Appropriations Committee Members
gr_edit .plotregion1.plot3.style.editstyle line(color(blue)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(width(thick)) editcopy
gr_edit .plotregion1.plot6.style.editstyle marker(symbol(diamond)) editcopy
gr_edit .plotregion1.plot6.style.editstyle marker(fillcolor(blue)) editcopy
gr_edit .plotregion1.plot6.style.editstyle marker(linestyle(color(blue))) editcopy
gr_edit .plotregion1.plot6.style.editstyle marker(size(medlarge)) editcopy
gr_edit .plotregion1.AddTextBox added_text editor 75 110.15
gr_edit .plotregion1.added_text_new = 2
gr_edit .plotregion1.added_text_rec = 2
gr_edit .plotregion1.added_text[2].style.editstyle angle(default) size(small) color(blue) horizontal(left) vertical(middle) margin(zero) linegap(zero) drawbox(no) boxmargin(zero) fillcolor(bluishgray) linestyle( width(thin) color(black) pattern(solid)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[2].text = {}
gr_edit .plotregion1.added_text[2].text.Arrpush Joined Appropriations between 110th and 111th
gr_edit .plotregion1.plot1.style.editstyle line(color(red)) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(width(thick)) editcopy
gr_edit .plotregion1.plot4.style.editstyle marker(size(medlarge)) editcopy
gr_edit .plotregion1.plot4.style.editstyle marker(symbol(diamond)) editcopy
gr_edit .plotregion1.plot4.style.editstyle marker(fillcolor(red)) editcopy
gr_edit .plotregion1.plot4.style.editstyle marker(linestyle(color(red))) editcopy
gr_edit .plotregion1.AddTextBox added_text editor 34 110.4
gr_edit .plotregion1.added_text_new = 3
gr_edit .plotregion1.added_text_rec = 3
gr_edit .plotregion1.added_text[3].style.editstyle angle(default) size(small) color(red) horizontal(left) vertical(middle) margin(zero) linegap(zero) drawbox(no) boxmargin(zero) fillcolor(bluishgray) linestyle( width(thin) color(black) pattern(solid)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[3].text = {}
gr_edit .plotregion1.added_text[3].text.Arrpush Non-Members
graph save "Figure1.gph", replace
***Table 1***
clear
set more off
use "Senate.dta"
*mean and standard deviation of dollars per capita
sum faads
postfile Table1 coef ster pval upper lower using "Table1.dta", replace
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
xi:areg log_faads `i' i.year majority seniority, a(id) cluster(state)
post Table1 (_b[`i']) (_se[`i']) (2*ttail(e(df_r),abs(_b[`i']/_se[`i']))) (_b[`i'] + _se[`i']*invttail(e(df_r),.025)) (_b[`i'] - _se[`i']*invttail(e(df_r),.025))
}
postclose Table1
clear
use "Table1.dta"
foreach i of varlist coef ster upper lower {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
g result = coef + " (" + ster + ") [" + lower + "," + upper + "]"
replace result = result + "*" if pval <= .05
replace result = result + "*" if pval <= .01
replace result = subinstr(result, ".000 (.000)**", "", .)
g committee = ""
replace committee = "Aging" if _n == 1
replace committee = "Agriculture" if _n == 2
replace committee = "Appropriations" if _n == 3
replace committee = "Armed Services" if _n == 4
replace committee = "Banking" if _n == 5
replace committee = "Budget" if _n == 6
replace committee = "Commerce" if _n == 7
replace committee = "Economic" if _n == 8
replace committee = "Energy" if _n == 9
replace committee = "Environment" if _n == 10
replace committee = "Ethics" if _n == 11
replace committee = "Finance" if _n == 12
replace committee = "Foreign Affairs" if _n == 13
replace committee = "Governmental Affairs" if _n == 14
replace committee = "Health" if _n == 15
replace committee = "Indian Affairs" if _n == 16
replace committee = "Intelligence" if _n == 17
replace committee = "Judiciary" if _n == 18
replace committee = "Labor" if _n == 19
replace committee = "Library" if _n == 20
replace committee = "Printing" if _n == 21
replace committee = "Rules" if _n == 22
replace committee = "Small Business" if _n == 23
replace committee = "Veterans' Affairs" if _n == 24
keep committee result
order committee result
sort committee
save "Table1.dta", replace
browse
***Table2***
clear
set more off
use "House.dta"
*mean and standard deviation of dollars per capita
sum faads
postfile Table2 coef ster pval upper lower using "Table2.dta", replace
foreach i of varlist agricul-waysmeans {
xi:areg log_faads `i' i.year majority seniority, a(id) cluster(state)
post Table2 (_b[`i']) (_se[`i']) (2*ttail(e(df_r),abs(_b[`i']/_se[`i']))) (_b[`i'] + _se[`i']*invttail(e(df_r),.025)) (_b[`i'] - _se[`i']*invttail(e(df_r),.025))
}
postclose Table2
clear
use "Table2.dta"
foreach i of varlist coef ster upper lower {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
g result = coef + " (" + ster + ") [" + lower + "," + upper + "]"
replace result = result + "*" if pval <= .05
replace result = result + "*" if pval <= .01
replace result = subinstr(result, ".000 (.000)**", "", .)
g committee = ""
replace committee = "Agriculture" if _n == 1
replace committee = "Appropriations" if _n == 2
replace committee = "Armed Services" if _n == 3
replace committee = "Banking" if _n == 4
replace committee = "Budget" if _n == 5
replace committee = "DC" if _n == 6
replace committee = "Education" if _n == 7
replace committee = "Energy" if _n == 8
replace committee = "Foreign Affairs" if _n == 9
replace committee = "Government Operations" if _n == 10
replace committee = "Homeland Security" if _n == 11
replace committee = "House Administration" if _n == 12
replace committee = "Judiciary" if _n == 13
replace committee = "Merchant Marine" if _n == 14
replace committee = "Natural Resources" if _n == 15
replace committee = "Post Office" if _n == 16
replace committee = "Public Works" if _n == 17
replace committee = "Rules" if _n == 18
replace committee = "Science" if _n == 19
replace committee = "Small Business" if _n == 20
replace committee = "Ethics" if _n == 21
replace committee = "Veterans' Affairs" if _n == 22
replace committee = "Ways and Means" if _n == 23
keep committee result
order committee result
sort committee
save "Table2.dta", replace
browse
***Table 3***
clear
set more off
use "Senate.dta"
postfile Table3 mean_dollars sd_dollars auth_coef auth_se auth_pval approp_coef approp_se approp_pval using "Table3.dta", replace
foreach i in ag com def energy home hud interior labor milcon trans {
sum faads_`i'
scalar mean_dollars = r(mean)
scalar sd_dollars = r(sd)
xi:areg log_faads_`i' auth_`i' i.year majority seniority, a(senator) cluster(state)
scalar auth_coef = _b[auth_`i']
scalar auth_se = _se[auth_`i']
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_`i']/_se[auth_`i']))
xi:areg log_faads_`i' mem_`i' i.year majority seniority, a(senator) cluster(state)
post Table3 (mean_dollars) (sd_dollars) (auth_coef) (auth_se) (auth_pval) (_b[mem_`i']) (_se[mem_`i']) (2*ttail(e(df_r),abs(_b[mem_`i']/_se[mem_`i'])))
}
*Pooled
tostring year, gen(year_string)
g senator_year = senator + "_" + year_string
keep log_faads_* faads_* auth_* mem_* year majority seniority senator senator_year state year_string
reshape long mem_ faads_ log_faads_ auth_, i(senator_year) j(subcommittee) string
drop if subcommittee == "fin" | subcommittee == "for" | subcommittee == "treas"
g senator_sc = senator + "_" + subcommittee
g year_sc = year_string + "_" + subcommittee
xi:areg log_faads_ auth_ i.year_sc seniority majority, a(senator_sc) cluster(state)
scalar auth_coef = _b[auth_]
scalar auth_se = _se[auth_]
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_]/_se[auth_]))
xi:areg log_faads_ mem_ i.year_sc seniority majority, a(senator_sc) cluster(state)
post Table3 (.) (.) (auth_coef) (auth_se) (auth_pval) (_b[mem_]) (_se[mem_]) (2*ttail(e(df_r),abs(_b[mem_]/_se[mem_])))
*Naive
areg log_faads_ auth_ seniority majority, a(year_sc) cluster(state)
scalar auth_coef = _b[auth_]
scalar auth_se = _se[auth_]
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_]/_se[auth_]))
areg log_faads_ mem_ seniority majority, a(year_sc) cluster(state)
post Table3 (.) (.) (auth_coef) (auth_se) (auth_pval) (_b[mem_]) (_se[mem_]) (2*ttail(e(df_r),abs(_b[mem_]/_se[mem_])))
postclose Table3
clear
use "Table3.dta"
browse
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Transportation" if _n == 10
replace issue = "Pooled" if _n == 11
replace issue = "Naive" if _n == 12
foreach i of varlist mean_dollars sd_dollars {
tostring `i', replace format(%5.1f) force
replace `i' = trim(`i')
replace `i' = "" if `i' == "."
}
foreach i of varlist auth_coef auth_se approp_coef approp_se {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
foreach i in auth approp {
g `i' = `i'_coef + " (" + `i'_se + ")"
replace `i' = `i' + "*" if `i'_pval <= .05
replace `i' = `i' + "*" if `i'_pval <= .01
}
g dollars = mean_dollars + " (" + sd_dollars + ")"
replace dollars = "" if dollars == " ()"
keep issue dollars auth approp
order issue dollars auth approp
save "Table3.dta", replace
browse
***Table 4****
clear
set more off
use "House.dta"
postfile Table4 mean_dollars sd_dollars auth_coef auth_se auth_pval approp_coef approp_se approp_pval using "Table4.dta", replace
foreach i in ag com def energy hs hud interior labor milcon trans va {
sum faads_`i'
scalar mean_dollars = r(mean)
scalar sd_dollars = r(sd)
xi:areg log_faads_`i' auth_`i' i.year majority seniority , a(id) cluster(state)
scalar auth_coef = _b[auth_`i']
scalar auth_se = _se[auth_`i']
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_`i']/_se[auth_`i']))
xi:areg log_faads_`i' mem_`i' i.year majority seniority , a(id) cluster(state)
post Table4 (mean_dollars) (sd_dollars) (auth_coef) (auth_se) (auth_pval) (_b[mem_`i']) (_se[mem_`i']) (2*ttail(e(df_r),abs(_b[mem_`i']/_se[mem_`i'])))
}
*Pooled
tostring year, gen(year_string)
g id_year = id + "_" + year_string
keep log_faads_* mem_* auth_* year majority seniority id id_year state year_string
reshape long mem_ auth_ log_faads_ , i(id_year) j(subcommittee) string
g id_sc = id + "_" + subcommittee
g year_sc = year_string + "_" + subcommittee
drop if subcommittee == "dc" | subcommittee == "for" | subcommittee == "fin" | subcommittee == "leg" | subcommittee == "treas" | subcommittee == "state"
drop if mem_ == . & auth_ == .
xi:areg log_faads_ auth_ i.year_sc seniority majority, a(id_sc) cluster(state)
scalar auth_coef = _b[auth_]
scalar auth_se = _se[auth_]
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_]/_se[auth_]))
xi:areg log_faads_ mem_ i.year_sc seniority majority, a(id_sc) cluster(state)
post Table4 (.) (.) (auth_coef) (auth_se) (auth_pval) (_b[mem_]) (_se[mem_]) (2*ttail(e(df_r),abs(_b[mem_]/_se[mem_])))
*Naive
areg log_faads_ auth_ seniority majority, a(year_sc) cluster(state)
scalar auth_coef = _b[auth_]
scalar auth_se = _se[auth_]
scalar auth_pval = 2*ttail(e(df_r),abs(_b[auth_]/_se[auth_]))
areg log_faads_ mem_ seniority majority, a(year_sc) cluster(state)
post Table4 (.) (.) (auth_coef) (auth_se) (auth_pval) (_b[mem_]) (_se[mem_]) (2*ttail(e(df_r),abs(_b[mem_]/_se[mem_])))
postclose Table4
clear
use "Table4.dta"
browse
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Veterans' Affairs" if _n == 10
replace issue = "Transportation" if _n == 11
replace issue = "Pooled" if _n == 12
replace issue = "Naive" if _n == 13
foreach i of varlist mean_dollars sd_dollars {
tostring `i', replace format(%5.1f) force
replace `i' = trim(`i')
replace `i' = "" if `i' == "."
}
foreach i of varlist auth_coef auth_se approp_coef approp_se {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
foreach i in auth approp {
g `i' = `i'_coef + " (" + `i'_se + ")"
replace `i' = `i' + "*" if `i'_pval <= .05
replace `i' = `i' + "*" if `i'_pval <= .01
}
g dollars = mean_dollars + " (" + sd_dollars + ")"
replace dollars = "" if dollars == " ()"
keep issue dollars auth approp
order issue dollars auth approp
save "Table4.dta", replace
browse
***Table 5***
clear
clear matrix
clear mata
set matsize 10000
set more off
use "Senate.dta"
postfile Table5 coef_1 se_1 pval_1 coef_2 se_2 pval_2 coef_3 se_3 pval_3 coef_4 se_4 pval_4 coef_5 se_5 pval_5 coef_6 se_6 pval_6 using "Table5.dta", replace
foreach i in ag com def energy home hud interior labor milcon trans {
forvalues j = 1/6 {
g approp_`i'_`j' = approp_`i' == `j'
replace approp_`i'_`j' = . if approp_`i' == .
}
xi:areg log_faads_`i' approp_`i'_* i.year majority seniority, a(senator) cluster(state)
post Table5 ///
(_b[approp_`i'_1]) (_se[approp_`i'_1]) (2*ttail(e(df_r),abs(_b[approp_`i'_1]/_se[approp_`i'_1]))) ///
(_b[approp_`i'_2]) (_se[approp_`i'_2]) (2*ttail(e(df_r),abs(_b[approp_`i'_2]/_se[approp_`i'_2]))) ///
(_b[approp_`i'_3]) (_se[approp_`i'_3]) (2*ttail(e(df_r),abs(_b[approp_`i'_3]/_se[approp_`i'_3]))) ///
(_b[approp_`i'_4]) (_se[approp_`i'_4]) (2*ttail(e(df_r),abs(_b[approp_`i'_4]/_se[approp_`i'_4]))) ///
(_b[approp_`i'_5]) (_se[approp_`i'_5]) (2*ttail(e(df_r),abs(_b[approp_`i'_5]/_se[approp_`i'_5]))) ///
(_b[approp_`i'_6]) (_se[approp_`i'_6]) (2*ttail(e(df_r),abs(_b[approp_`i'_6]/_se[approp_`i'_6])))
drop approp_`i'_*
}
*Pooled
tostring year, gen(year_string)
g senator_year = senator + "_" + year_string
keep log_faads_* approp_* year majority seniority senator senator_year state year_string
reshape long approp_ log_faads_ , i(senator_year) j(subcommittee) string
drop if subcommittee == "fin" | subcommittee == "for" | subcommittee == "treas"
g senator_sc = senator + "_" + subcommittee
g year_sc = year_string + "_" + subcommittee
rename approp_ approp
forvalues j = 1/6 {
g approp_`j' = approp == `j'
replace approp_`j' = . if approp == .
}
xi:areg log_faads_ approp_* i.year_sc seniority majority, a(senator_sc) cluster(state)
post Table5 ///
(_b[approp_1]) (_se[approp_1]) (2*ttail(e(df_r),abs(_b[approp_1]/_se[approp_1]))) ///
(_b[approp_2]) (_se[approp_2]) (2*ttail(e(df_r),abs(_b[approp_2]/_se[approp_2]))) ///
(_b[approp_3]) (_se[approp_3]) (2*ttail(e(df_r),abs(_b[approp_3]/_se[approp_3]))) ///
(_b[approp_4]) (_se[approp_4]) (2*ttail(e(df_r),abs(_b[approp_4]/_se[approp_4]))) ///
(_b[approp_5]) (_se[approp_5]) (2*ttail(e(df_r),abs(_b[approp_5]/_se[approp_5]))) ///
(_b[approp_6]) (_se[approp_6]) (2*ttail(e(df_r),abs(_b[approp_6]/_se[approp_6])))
postclose Table5
clear
use "Table5.dta"
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Transportation" if _n == 10
replace issue = "Pooled" if _n == 11
forvalues j = 1/6 {
foreach i of varlist coef_`j' se_`j' {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
g result_`j' = coef_`j' + " (" + se_`j' + ")"
replace result_`j' = result_`j' + "*" if pval_`j' <= .05
replace result_`j' = result_`j' + "*" if pval_`j' <= .01
}
keep issue result_*
save "Table5.dta", replace
browse
***Table 6***
clear
clear matrix
clear mata
set matsize 10000
set more off
use "House.dta"
postfile Table6 coef_1 se_1 pval_1 coef_2 se_2 pval_2 coef_3 se_3 pval_3 coef_4 se_4 pval_4 coef_5 se_5 pval_5 coef_6 se_6 pval_6 using "Table6.dta", replace
foreach i in ag com def energy hs hud interior labor milcon trans va {
forvalues j = 1/6 {
g approp_`i'_`j' = approp_`i' == `j'
replace approp_`i'_`j' = . if approp_`i' == .
}
xi:areg log_faads_`i' approp_`i'_* i.year majority seniority , a(id) cluster(state)
post Table6 ///
(_b[approp_`i'_1]) (_se[approp_`i'_1]) (2*ttail(e(df_r),abs(_b[approp_`i'_1]/_se[approp_`i'_1]))) ///
(_b[approp_`i'_2]) (_se[approp_`i'_2]) (2*ttail(e(df_r),abs(_b[approp_`i'_2]/_se[approp_`i'_2]))) ///
(_b[approp_`i'_3]) (_se[approp_`i'_3]) (2*ttail(e(df_r),abs(_b[approp_`i'_3]/_se[approp_`i'_3]))) ///
(_b[approp_`i'_4]) (_se[approp_`i'_4]) (2*ttail(e(df_r),abs(_b[approp_`i'_4]/_se[approp_`i'_4]))) ///
(_b[approp_`i'_5]) (_se[approp_`i'_5]) (2*ttail(e(df_r),abs(_b[approp_`i'_5]/_se[approp_`i'_5]))) ///
(_b[approp_`i'_6]) (_se[approp_`i'_6]) (2*ttail(e(df_r),abs(_b[approp_`i'_6]/_se[approp_`i'_6])))
drop approp_`i'_*
}
*Pooled
tostring year, gen(year_string)
g id_year = id + "_" + year_string
keep log_faads_* faads_* approp_* log_non_* non_* year majority seniority id id_year state year_string
reshape long approp_ faads_ log_faads_ log_non_ non_, i(id_year) j(subcommittee) string
g id_sc = id + "_" + subcommittee
g year_sc = year_string + "_" + subcommittee
drop if subcommittee == "dc" | subcommittee == "for" | subcommittee == "fin" | subcommittee == "leg" | subcommittee == "treas" | subcommittee == "state"
drop if approp_ == .
rename approp_ approp
forvalues j = 1/6 {
g approp_`j' = approp == `j'
replace approp_`j' = . if approp == .
}
xi:areg log_faads_ approp_* i.year_sc seniority majority, a(id_sc) cluster(state)
post Table6 ///
(_b[approp_1]) (_se[approp_1]) (2*ttail(e(df_r),abs(_b[approp_1]/_se[approp_1]))) ///
(_b[approp_2]) (_se[approp_2]) (2*ttail(e(df_r),abs(_b[approp_2]/_se[approp_2]))) ///
(_b[approp_3]) (_se[approp_3]) (2*ttail(e(df_r),abs(_b[approp_3]/_se[approp_3]))) ///
(_b[approp_4]) (_se[approp_4]) (2*ttail(e(df_r),abs(_b[approp_4]/_se[approp_4]))) ///
(_b[approp_5]) (_se[approp_5]) (2*ttail(e(df_r),abs(_b[approp_5]/_se[approp_5]))) ///
(_b[approp_6]) (_se[approp_6]) (2*ttail(e(df_r),abs(_b[approp_6]/_se[approp_6])))
postclose Table6
clear
use "Table6.dta"
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Transportation" if _n == 10
replace issue = "Veterans' Affairs" if _n == 11
replace issue = "Pooled" if _n == 12
forvalues j = 1/6 {
foreach i of varlist coef_`j' se_`j' {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
g result_`j' = coef_`j' + " (" + se_`j' + ")"
replace result_`j' = result_`j' + "*" if pval_`j' <= .05
replace result_`j' = result_`j' + "*" if pval_`j' <= .01
}
keep issue result_*
save "Table6.dta", replace
browse
**Table A1**
clear
set more off
use "Senate.dta"
rename id legislator
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
egen `i'_ever = max(`i'), by(legislator)
egen `i'_always = min(`i'), by(legislator)
}
egen mincong = min(congress), by(legislator)
drop if mincong == 98
sort legislator
drop if legislator == legislator[_n-1]
postfile TableA1_senate senate using "TableA1_senate.dta", replace
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
sum `i'_always if `i'_ever == 1
post TableA1_senate (1 - r(mean))
}
postclose TableA1_senate
clear
use "TableA1_senate.dta"
tostring senate, replace format(%5.3f) force
replace senate = subinstr(senate, "0.", ".", .)
replace senate = subinstr(senate, "1.000", "1", .)
g committee = ""
replace committee = "Aging" if _n == 1
replace committee = "Agriculture" if _n == 2
replace committee = "Appropriations" if _n == 3
replace committee = "Armed Services" if _n == 4
replace committee = "Banking" if _n == 5
replace committee = "Budget" if _n == 6
replace committee = "Commerce" if _n == 7
replace committee = "Economic" if _n == 8
replace committee = "Energy" if _n == 9
replace committee = "Environment" if _n == 10
replace committee = "Ethics" if _n == 11
replace committee = "Finance" if _n == 12
replace committee = "Foreign Affairs" if _n == 13
replace committee = "Governmental Affairs" if _n == 14
replace committee = "Health" if _n == 15
replace committee = "Indian Affairs" if _n == 16
replace committee = "Intelligence" if _n == 17
replace committee = "Judiciary" if _n == 18
replace committee = "Labor" if _n == 19
replace committee = "Library" if _n == 20
replace committee = "Printing" if _n == 21
replace committee = "Rules" if _n == 22
replace committee = "Small Business" if _n == 23
replace committee = "Veterans' Affairs" if _n == 24
order committee senate
sort committee
save "TableA1_senate.dta", replace
browse
clear
set more off
use "House.dta"
split id, p(_)
egen legislator = group(id1 id2 id3)
drop id1-id4
foreach i in agricul approps armserv_natlsec banking_finserv budget dc educlab ///
engycom fornaff_intlrel govtops homesec hradmin judicry merchmar natrlres ///
postoff_civserv pubwork_transpo_infrast rules scitech smallbus ethics vetaffrs waysmeans {
egen `i'_ever = max(`i'), by(legislator)
egen `i'_always = min(`i'), by(legislator)
}
egen mincong = min(congress), by(legislator)
drop if mincong == 98
sort legislator
drop if legislator == legislator[_n-1]
postfile TableA1_house house using "TableA1_house.dta", replace
foreach i in agricul approps armserv_natlsec banking_finserv budget dc educlab ///
engycom fornaff_intlrel govtops homesec hradmin judicry merchmar natrlres ///
postoff_civserv pubwork_transpo_infrast rules scitech smallbus ethics vetaffrs waysmeans {
sum `i'_always if `i'_ever == 1
post TableA1_house (1 - r(mean))
}
postclose TableA1_house
clear
use "TableA1_house.dta"
tostring house, replace format(%5.3f) force
replace house = subinstr(house, "0.", ".", .)
g committee = ""
replace committee = "Agriculture" if _n == 1
replace committee = "Appropriations" if _n == 2
replace committee = "Armed Services" if _n == 3
replace committee = "Banking" if _n == 4
replace committee = "Budget" if _n == 5
replace committee = "DC" if _n == 6
replace committee = "Education" if _n == 7
replace committee = "Energy" if _n == 8
replace committee = "Foreign Affairs" if _n == 9
replace committee = "Government Operations" if _n == 10
replace committee = "Homeland Security" if _n == 11
replace committee = "House Administration" if _n == 12
replace committee = "Judiciary" if _n == 13
replace committee = "Merchant Marine" if _n == 14
replace committee = "Natural Resources" if _n == 15
replace committee = "Post Office" if _n == 16
replace committee = "Public Works" if _n == 17
replace committee = "Rules" if _n == 18
replace committee = "Science" if _n == 19
replace committee = "Small Business" if _n == 20
replace committee = "Ethics" if _n == 21
replace committee = "Veterans' Affairs" if _n == 22
replace committee = "Ways and Means" if _n == 23
order committee house
sort committee
save "TableA1_house.dta", replace
browse
**Table A2**
clear
set more off
use "Senate.dta"
egen mincong = min(congress), by(id)
foreach i in ag com def energy home hud interior labor milcon trans {
g `i'_on = approp_`i' >= 3 & approp_`i' <= 6
egen `i'_ever = max(`i'_on), by(id)
egen `i'_always = min(`i'_on), by(id)
}
drop if mincong == 98
sort id
drop if id == id[_n-1]
postfile TableA2_senate senate using "TableA2_senate.dta", replace
foreach i in ag com def energy home hud interior labor milcon trans {
sum `i'_always if `i'_ever == 1
post TableA2_senate (1 - r(mean))
}
postclose TableA2_senate
clear
use "TableA2_senate.dta"
tostring senate, replace format(%5.3f) force
replace senate = subinstr(senate, "0.", ".", .)
replace senate = subinstr(senate, "1.000", "1", .)
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Transportation" if _n == 10
order issue senate
sort issue
save "TableA2_senate.dta", replace
browse
clear
set more off
use "House.dta"
split id, p(_)
egen legislator = group(id1 id2 id3)
drop id1-id4
egen mincong = min(congress), by(legislator)
foreach i in ag com def energy hs interior labor milcon trans va {
g `i'_on = approp_`i' >= 3 & approp_`i' <= 6
egen `i'_ever = max(`i'_on), by(legislator)
egen `i'_always = min(`i'_on), by(legislator)
}
drop if mincong == 98
sort legislator
drop if legislator == legislator[_n-1]
postfile TableA2_house house using "TableA2_house.dta", replace
foreach i in ag com def energy hs interior labor milcon trans va {
sum `i'_always if `i'_ever == 1
post TableA2_house (1 - r(mean))
}
postclose TableA2_house
clear
use "TableA2_house.dta"
tostring house, replace format(%5.3f) force
replace house = subinstr(house, "0.", ".", .)
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Interior" if _n == 6
replace issue = "Labor" if _n == 7
replace issue = "Military Construction" if _n == 8
replace issue = "Transportation" if _n == 9
replace issue = "Veterans' Affairs" if _n == 10
order issue house
sort issue
save "TableA2_house.dta", replace
browse
***Table A3***
clear
set more off
use "Senate.dta"
egen state_year = group(state year)
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
egen tot_`i' = total(`i'), by(state_year)
replace tot_`i' = 1 if tot_`i' == 3
replace tot_`i' = . if `i' == .
}
postfile TableA3 first_coef first_se first_pval f_stat second_coef second_se second_pval using "TableA3.dta", replace
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
xi:reg tot_`i' `i' i.year i.id majority seniority, cluster(state)
scalar first_coef = _b[`i']
scalar first_se = _se[`i']
scalar first_pval = 2*ttail(e(df_r),abs(_b[`i']/_se[`i']))
test `i'
scalar fstat = r(F)
xi:ivregress 2sls log_faads (tot_`i' = `i') i.year i.id majority seniority, cluster(state)
post TableA3 (first_coef) (first_se) (first_pval) (fstat) (_b[tot_`i']) (_se[tot_`i']) (2*ttail(e(N),abs(_b[tot_`i']/_se[tot_`i'])))
}
postclose TableA3
clear
use "TableA3.dta"
*In how many cases is the first stage coefficient statistically distinguishable from 1?
count if abs(first_coef - 1)/first_se >= 1.96
foreach i of varlist first_coef first_se second_coef second_se {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
foreach i in first second {
g `i' = `i'_coef + " (" + `i'_se + ")"
replace `i' = `i' + "*" if `i'_pval <= .05
replace `i' = `i' + "*" if `i'_pval <= .01
replace `i' = subinstr(`i', ".000 (.000)**", "", .)
}
tostring f_stat, replace format(%7.1f) force
replace f_stat = trim(f_stat)
g committee = ""
replace committee = "Aging" if _n == 1
replace committee = "Agriculture" if _n == 2
replace committee = "Appropriations" if _n == 3
replace committee = "Armed Services" if _n == 4
replace committee = "Banking" if _n == 5
replace committee = "Budget" if _n == 6
replace committee = "Commerce" if _n == 7
replace committee = "Economic" if _n == 8
replace committee = "Energy" if _n == 9
replace committee = "Environment" if _n == 10
replace committee = "Ethics" if _n == 11
replace committee = "Finance" if _n == 12
replace committee = "Foreign Affairs" if _n == 13
replace committee = "Governmental Affairs" if _n == 14
replace committee = "Health" if _n == 15
replace committee = "Indian Affairs" if _n == 16
replace committee = "Intelligence" if _n == 17
replace committee = "Judiciary" if _n == 18
replace committee = "Labor" if _n == 19
replace committee = "Library" if _n == 20
replace committee = "Printing" if _n == 21
replace committee = "Rules" if _n == 22
replace committee = "Small Business" if _n == 23
replace committee = "Veterans' Affairs" if _n == 24
keep committee first f_stat second
order committee first f_stat second
save "TableA3.dta", replace
browse
***Table A4***
clear
set more off
use "Senate.dta"
egen state_year = group(state year)
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
egen tot_`i' = total(`i'), by(state_year)
replace tot_`i' = 1 if tot_`i' == 3
replace tot_`i' = . if `i' == .
g other_`i' = tot_`i' - `i'
g both_`i' = `i'*other_`i'
}
postfile TableA4 comm_coef comm_se comm_pval interaction_coef interaction_se interaction_pval switches_with switches_without using "TableA4.dta", replace
foreach i in aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans {
sort id year
qui:count if abs(`i' - `i'[_n-1]) == 1 & other_`i' == 1 & other_`i'[_n-1] == 1
scalar switches_with = r(N)
qui:count if abs(`i' - `i'[_n-1]) == 1 & other_`i' == 0 & other_`i'[_n-1] == 0
scalar switches_without = r(N)
qui:xi:areg log_faads `i' other_`i' both_`i' i.year majority seniority, a(id) cluster(state)
post TableA4 (_b[`i']) (_se[`i']) (2*ttail(e(df_r),abs(_b[`i']/_se[`i']))) (_b[both_`i']) (_se[both_`i']) (2*ttail(e(df_r),abs(_b[both_`i']/_se[both_`i']))) (switches_with) (switches_without)
}
postclose TableA4
clear
use "TableA4.dta"
g committee = ""
replace committee = "Aging" if _n == 1
replace committee = "Agriculture" if _n == 2
replace committee = "Appropriations" if _n == 3
replace committee = "Armed Services" if _n == 4
replace committee = "Banking" if _n == 5
replace committee = "Budget" if _n == 6
replace committee = "Commerce" if _n == 7
replace committee = "Economic" if _n == 8
replace committee = "Energy" if _n == 9
replace committee = "Environment" if _n == 10
replace committee = "Ethics" if _n == 11
replace committee = "Finance" if _n == 12
replace committee = "Foreign Affairs" if _n == 13
replace committee = "Governmental Affairs" if _n == 14
replace committee = "Health" if _n == 15
replace committee = "Indian Affairs" if _n == 16
replace committee = "Intelligence" if _n == 17
replace committee = "Judiciary" if _n == 18
replace committee = "Labor" if _n == 19
replace committee = "Library" if _n == 20
replace committee = "Printing" if _n == 21
replace committee = "Rules" if _n == 22
replace committee = "Small Business" if _n == 23
replace committee = "Veterans' Affairs" if _n == 24
foreach i of varlist comm_coef comm_se interaction_coef interaction_se {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
foreach i in comm interaction {
g `i' = `i'_coef + " (" + `i'_se + ")"
replace `i' = `i' + "*" if `i'_pval <= .05
replace `i' = `i' + "*" if `i'_pval <= .01
replace `i' = subinstr(`i', ".000 (.000)**", "", .)
}
keep committee comm interaction switches*
order committee comm interaction switches_without switches_with
save "TableA4.dta", replace
browse
***Table A5***
clear
set more off
use "Senate.dta"
egen state_year = group(state year)
foreach i of varlist aging agriculture appropriations armed banking budget commerce economic energy ///
environment ethics finance foreign government health indian intelligence judiciary ///
labor library printing rules small veterans mem_ag-mem_treas {
egen sen_`i' = max(`i'), by(state_year)
replace sen_`i' = . if `i' == .
}
sort state_year
drop if state_year == state_year[_n-1]
keep state year sen_*
foreach i in ag com energy fin def milcon for hud home interior labor trans treas {
rename sen_mem_`i' sen_approp_`i'
}
sort state year
save "SenateStateLevelCommittees.dta", replace
clear
use "House.dta"
sort state year
merge state year using "SenateStateLevelCommittees.dta"
tab _merge
keep if _merge == 3
drop _merge
rename sen_agriculture sen_agricul
rename sen_appropriations sen_approps
rename sen_armed sen_armserv_natlsec
g sen_banking_finserv = max(sen_banking, sen_finance)
rename sen_labor sen_educlab
g sen_engycom = max(sen_energy, sen_commerce)
rename sen_foreign sen_fornaff_intlrel
rename sen_government sen_govtops
rename sen_judiciary sen_judicry
g sen_natrlres = max(sen_energy, sen_environment, sen_indian)
rename sen_commerce sen_pubwork_transpo_infrast
rename sen_small sen_smallbus
rename sen_veterans sen_vetaffrs
postfile TableA5 without_coef without_se withsenator_coef withsenator_se using "TableA5.dta", replace
foreach i in agricul approps armserv_natlsec banking_finserv budget educlab engycom ethics ///
fornaff_intlrel govtops judicry natrlres pubwork_transpo_infrast rules smallbus vetaffrs {
qui:g both_`i' = `i'*sen_`i'
qui:xi:areg log_faads `i' sen_`i' both_`i' i.year majority seniority, a(id) cluster(state)
post TableA5 (_b[`i']) (_se[`i']) (_b[both_`i']) (_se[both_`i'])
}
postclose TableA5
clear
use "TableA5.dta"
foreach i in without withsenator {
g `i'_stars = abs(`i'_coef/`i'_se) >= 1.96
replace `i'_stars = 2 if abs(`i'_coef/`i'_se) >= 2.576
}
foreach i of varlist without_coef-withsenator_se {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
foreach i in without withsenator {
g `i' = `i'_coef + " (" + `i'_se + ")"
replace `i' = `i' + "*" if `i'_stars == 1
replace `i' = `i' + "**" if `i'_stars == 2
replace `i' = subinstr(`i', ".000 (.000)**", "", .)
}
g committee = ""
replace committee = "Agriculture" if _n == 1
replace committee = "Appropriations" if _n == 2
replace committee = "Armed Services" if _n == 3
replace committee = "Banking" if _n == 4
replace committee = "Budget" if _n == 5
replace committee = "Education" if _n == 6
replace committee = "Energy" if _n == 7
replace committee = "Ethics" if _n == 8
replace committee = "Foreign Affairs" if _n == 9
replace committee = "Government Operations" if _n == 10
replace committee = "Judiciary" if _n == 11
replace committee = "Natural Resources" if _n == 12
replace committee = "Public Works" if _n == 13
replace committee = "Rules" if _n == 14
replace committee = "Small Business" if _n == 15
replace committee = "Veterans' Affairs" if _n == 16
keep committee without withsenator
order committee without withsenator
save "TableA5.dta", replace
browse
***Table A6***
clear
clear matrix
clear mata
set matsize 10000
set more off
use "Senate.dta"
postfile TableA6 coef_1 se_1 pval_1 coef_2 se_2 pval_2 coef_3 se_3 pval_3 coef_4 se_4 pval_4 coef_5 se_5 pval_5 coef_6 se_6 pval_6 using "TableA6.dta", replace
foreach i in ag com def energy home hud interior labor milcon trans {
forvalues j = 1/6 {
g approp_`i'_`j' = approp_`i' == `j'
replace approp_`i'_`j' = . if approp_`i' == .
}
xi:areg log_non_`i' approp_`i'_* i.year majority seniority, a(senator) cluster(state)
post TableA6 ///
(_b[approp_`i'_1]) (_se[approp_`i'_1]) (2*ttail(e(df_r),abs(_b[approp_`i'_1]/_se[approp_`i'_1]))) ///
(_b[approp_`i'_2]) (_se[approp_`i'_2]) (2*ttail(e(df_r),abs(_b[approp_`i'_2]/_se[approp_`i'_2]))) ///
(_b[approp_`i'_3]) (_se[approp_`i'_3]) (2*ttail(e(df_r),abs(_b[approp_`i'_3]/_se[approp_`i'_3]))) ///
(_b[approp_`i'_4]) (_se[approp_`i'_4]) (2*ttail(e(df_r),abs(_b[approp_`i'_4]/_se[approp_`i'_4]))) ///
(_b[approp_`i'_5]) (_se[approp_`i'_5]) (2*ttail(e(df_r),abs(_b[approp_`i'_5]/_se[approp_`i'_5]))) ///
(_b[approp_`i'_6]) (_se[approp_`i'_6]) (2*ttail(e(df_r),abs(_b[approp_`i'_6]/_se[approp_`i'_6])))
drop approp_`i'_*
}
*Pooled
tostring year, gen(year_string)
g senator_year = senator + "_" + year_string
keep log_non_* approp_* year majority seniority senator senator_year state year_string
reshape long approp_ log_non_ , i(senator_year) j(subcommittee) string
drop if subcommittee == "fin" | subcommittee == "for" | subcommittee == "treas"
g senator_sc = senator + "_" + subcommittee
g year_sc = year_string + "_" + subcommittee
rename approp_ approp
forvalues j = 1/6 {
g approp_`j' = approp == `j'
replace approp_`j' = . if approp == .
}
xi:areg log_non_ approp_* i.year_sc seniority majority, a(senator_sc) cluster(state)
post TableA6 ///
(_b[approp_1]) (_se[approp_1]) (2*ttail(e(df_r),abs(_b[approp_1]/_se[approp_1]))) ///
(_b[approp_2]) (_se[approp_2]) (2*ttail(e(df_r),abs(_b[approp_2]/_se[approp_2]))) ///
(_b[approp_3]) (_se[approp_3]) (2*ttail(e(df_r),abs(_b[approp_3]/_se[approp_3]))) ///
(_b[approp_4]) (_se[approp_4]) (2*ttail(e(df_r),abs(_b[approp_4]/_se[approp_4]))) ///
(_b[approp_5]) (_se[approp_5]) (2*ttail(e(df_r),abs(_b[approp_5]/_se[approp_5]))) ///
(_b[approp_6]) (_se[approp_6]) (2*ttail(e(df_r),abs(_b[approp_6]/_se[approp_6])))
postclose TableA6
clear
use "TableA6.dta"
g issue = ""
replace issue = "Agriculture" if _n == 1
replace issue = "Commerce" if _n == 2
replace issue = "Defense" if _n == 3
replace issue = "Energy" if _n == 4
replace issue = "Homeland Security" if _n == 5
replace issue = "Housing" if _n == 6
replace issue = "Interior" if _n == 7
replace issue = "Labor" if _n == 8
replace issue = "Military Construction" if _n == 9
replace issue = "Transportation" if _n == 10
replace issue = "Pooled" if _n == 11
forvalues j = 1/6 {
foreach i of varlist coef_`j' se_`j' {
tostring `i', replace format(%5.3f) force
replace `i' = subinstr(`i', "0.", ".", .)
replace `i' = subinstr(`i', "-.000", ".000", .)
replace `i' = trim(`i')
}
g result_`j' = coef_`j' + " (" + se_`j' + ")"
replace result_`j' = result_`j' + "*" if pval_`j' <= .05
replace result_`j' = result_`j' + "*" if pval_`j' <= .01
}
keep issue result_*
save "TableA6.dta", replace
browse