| clear |
| set mem 500m |
| set more off |
| set logtype text |
| set matsize 3000 |
|
|
| cap log close |
| log using "$Log/TableD2.log", replace |
|
|
| use "$AnalysisData/bills_analysis_101-111_replication.dta" |
| keep if private==0 |
|
|
| bysort v2 sponsor_state_abbrev sponsor_district sponsor_term_served: egen tot_bills=count(v2) |
|
|
| gen byte sponsor_democrat = sponsor_party==100 if sponsor_party~=. |
|
|
| gen byte NE = sponsor_state_icpsr>=1 & sponsor_state_icpsr<=14 if sponsor_state_icpsr~=. |
| gen byte MW = sponsor_state_icpsr>=21 & sponsor_state_icpsr<=37 if sponsor_state_icpsr~=. |
| gen byte SO = sponsor_state_icpsr>=40 & sponsor_state_icpsr<=56 if sponsor_state_icpsr~=. |
| gen byte WE = sponsor_state_icpsr>=61 & sponsor_state_icpsr<=82 if sponsor_state_icpsr~=. |
|
|
| replace sponsor_age=. if sponsor_age>100 |
| gen sponsor_rookie=(sponsor_tenure_run==1) if sponsor_tenure_run!=. |
| gen byte leader = (comc==1) | (comr==1) if comc~=. & comr~=. |
|
|
| gen lnpden=lnpop-lnarea |
| gen absMV=abs(MV1_democrat) |
|
|
| egen tag_congressmen=tag(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
| egen group_congressmen = group(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
| |
| sort v2 sponsor_state_abbrev sponsor_district sponsor_term_served HRnumber |
| bysort v2 sponsor_state_abbrev sponsor_district sponsor_term_served: gen tag_sponsor=_n |
| egen group_sponsor = group(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
|
|
| bysort v2 sponsor_state_abbrev sponsor_district sponsor_term_served: egen numb_cosponsors_m=mean(numb_cosponsors) |
|
|
| compress |
| |
| |
| sort v2 HRnumber |
| bysort v2 HRnumber: gen tag_bill=_n |
|
|
| gen int decade = 1980 if v2<=102 |
| replace decade=1990 if v2>=103 & v2<=107 |
| replace decade=2000 if v2>=108 |
|
|
| egen district_id = group(decade sponsor_state_abbrev sponsor_district) |
|
|
| sort district_id v2 HRnumber |
| bysort district_id v2: gen counter=_n |
| foreach var of varlist tot_bills sponsor_female MV1_female MV1_democrat mixed_gender_ele |
| sponsor_party sponsor_democrat sponsor_rookie sponsor_tenure_run sponsor_age |
| leader ivycoll black occ0 occ1 occ2 occ3 occ4 borninstate { |
| sort counter district_id v2 |
| bysort counter district_id: gen X=`var'[_n+1] if counter==1 & `var'[_n+1]!=. |
| bysort district_id v2: egen `var'_l1=max(X) |
| drop X |
| } |
| gen female_l1XMV1_female_l1=MV1_female_l1*sponsor_female_l1 |
| gen absMV_l1=abs(MV1_democrat_l1) |
|
|
| local controls1 = "i.v2 " |
| local controls2 = "i.v2 MV1_female_l1 female_l1XMV1_female_l1 " |
| local controls3 = "i.v2 MV1_female_l1 female_l1XMV1_female_l1 " |
| local controls4 = "i.v2 " |
| local controls5 = "i.v2 " |
|
|
| local other_controls = "i.minor house_* sponsor_democrat_l1 sponsor_rookie_l1 sponsor_tenure_run_l1 sponsor_age_l1 leader_l1 ivycoll_l1 black_l1 occ0_l1 occ1_l1 occ2_l1 occ3_l1 occ4_l1 borninstate_l1 tot_bills NE MW WE pct_black pct_urban pct_for_born pct_age_over65 lninc lnpden" |
| local billchars = "i.minor house_*" |
| local indivchars = "sponsor_democrat_l1 sponsor_rookie_l1 sponsor_tenure_run_l1 sponsor_age_l1 leader_l1 ivycoll_l1 black_l1 occ0_l1 occ1_l1 occ2_l1 occ3_l1 occ4_l1 borninstate_l1 tot_bills" |
| local districtchars = "NE MW WE pct_black pct_urban pct_for_born pct_age_over65 lninc lnpden" |
|
|
| local if1 = "if tag_bill==1 & sponsor_female==0" |
| local if2 = "if sponsor_party_l1==100 & tag_bill==1 & sponsor_female==0" |
| local if3 = "if sponsor_party_l1==200 & tag_bill==1 & sponsor_female==0" |
|
|
| forvalues j=1/5 { |
| forvalues k = 1/3 { |
| qui reg numb_cosponsors sponsor_female_l1 `controls2' `other_controls' `if`k'' & mixed_gender_election_l1==1, robust cluster(group_sponsor) |
| qui gen sample=e(sample) |
| |
| di "" |
| di "" |
| di "j = ", `j', "k = ", `k' |
| di "" |
| di "" |
|
|
| di "rdbwselect_2014 numb_cosponsors MV1_female_l1 `if`k'', c(0) kernel(uniform)" |
| rdbwselect_2014 numb_cosponsors MV1_female_l1 `if`k'', c(0) kernel(uniform) |
| local band = e(h_CCT) |
|
|
| if `j'==1 { |
| di "reg numb_cosponsors sponsor_female_l1 `controls`j'' `other_controls' `if`k'', robust cluster(group_sponsor)" |
| reg numb_cosponsors sponsor_female_l1 `controls`j'' `other_controls' `if`k'', robust cluster(group_sponsor) |
| } |
| else if `j'==2 { |
| di "reg numb_cosponsors sponsor_female_l1 `controls`j'' `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor)" |
| reg numb_cosponsors sponsor_female_l1 `controls`j'' `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor) |
| } |
| else if `j'==3 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' `if`k'' & tag_sponsor==1 & abs(MV1_female_l1)<=`band' |
| predict pscore if sample==1 |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor)" |
| reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'' & sample==1 & abs(MV1_female_l1 )<=`band', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
| else if `j'==4 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' absMV_l1 `if`k'' & tag_sponsor==1 |
| predict pscore |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor)" |
| reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
| else if `j'==5 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' `indivchars' absMV_l1 `if`k'' & tag_sponsor==1 |
| predict pscore |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor)" |
| reg numb_cosponsors sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
| |
| if `j'~=2 & `j'~=3 { |
| scalar b_col`j'_row`k' = _b[sponsor_female_l1] |
| scalar se_col`j'_row`k' = _se[sponsor_female_l1] |
| scalar n_col`j'_row`k' = e(N) |
| sum tag_congressmen if tag_congressmen==1 & e(sample) |
| scalar ni_col`j'_row`k' = e(N_clust) |
| scalar ob_col`j'_row`k' = . |
| } |
| else if `j'==2 | `j'==3 { |
| scalar b_col`j'_row`k' = _b[sponsor_female_l1] |
| scalar se_col`j'_row`k' = _se[sponsor_female_l1] |
| scalar n_col`j'_row`k' = e(N) |
| sum tag_congressmen if tag_congressmen==1 & e(sample) |
| scalar ni_col`j'_row`k' = e(N_clust) |
| scalar ob_col`j'_row`k' = round(`band') |
| } |
|
|
| drop sample |
| |
| } |
| } |
|
|
| preserve |
|
|
| |
|
|
| forvalues i = 1/5 { |
| gen var`i' =. |
| } |
| gen str20 var6 = "" |
| |
| forvalues j=1/5 { |
| forvalues k = 1/3 { |
| replace var`j' = b_col`j'_row`k' if _n==6*(`k'-1)+1 |
| replace var`j' = se_col`j'_row`k' if _n==6*(`k'-1)+2 |
| replace var`j' = n_col`j'_row`k' if _n==6*(`k'-1)+3 |
| replace var`j' = ni_col`j'_row`k' if _n==6*(`k'-1)+4 |
| replace var`j' = ob_col`j'_row`k' if _n==6*(`k'-1)+5 |
| } |
| } |
|
|
| keep var1-var6 |
| keep if _n<=18 |
|
|
| order var6 var1-var5 |
|
|
| ren var6 sampletype |
| ren var1 OLS_all |
| ren var2 RD_bwidth |
| ren var3 RD_match_bw |
| ren var4 PS_match |
| ren var5 PS_match_indiv |
|
|
| foreach var of varlist OLS_all RD_bwidth RD_match_bw PS_match PS_match_indiv { |
| gen str3 `var'_stars ="*" if abs(`var'/`var'[_n+1])>=1.645 & mod(_n,6)==1 |
| replace `var'_stars ="**" if abs(`var'/`var'[_n+1])>=1.96 & mod(_n,6)==1 |
| replace `var'_stars="***" if abs(`var'/`var'[_n+1])>=2.58 & mod(_n,6)==1 |
| } |
|
|
| replace sampletype = "All" if _n>=1 & _n<=5 |
| replace sampletype = "Democrats" if _n>=7 & _n<=11 |
| replace sampletype = "Republicans" if _n>=13 & _n<=17 |
|
|
| order sampletype OLS_all OLS_all_stars RD_bwidth RD_bwidth_stars RD_match_bw RD_match_bw_stars PS_match PS_match_stars PS_match_indiv PS_match_indiv_stars |
| export excel using "$Output/TableD2_Placebo_Cosponsors", firstrow(var) replace |
|
|
| restore |
|
|
|
|
| |
|
|
|
|
| |
| use "$AnalysisData/bills_analysis_101-111_replication.dta", clear |
| keep if private==0 |
|
|
| bysort v2 sponsor_state_abbrev sponsor_district sponsor_term_served: egen tot_bills=count(v2) |
|
|
| gen byte sponsor_democrat = sponsor_party==100 if sponsor_party~=. |
|
|
| gen byte NE = sponsor_state_icpsr>=1 & sponsor_state_icpsr<=14 if sponsor_state_icpsr~=. |
| gen byte MW = sponsor_state_icpsr>=21 & sponsor_state_icpsr<=37 if sponsor_state_icpsr~=. |
| gen byte SO = sponsor_state_icpsr>=40 & sponsor_state_icpsr<=56 if sponsor_state_icpsr~=. |
| gen byte WE = sponsor_state_icpsr>=61 & sponsor_state_icpsr<=82 if sponsor_state_icpsr~=. |
|
|
| replace sponsor_age=. if sponsor_age>100 |
| gen sponsor_rookie=(sponsor_tenure_run==1) if sponsor_tenure_run!=. |
| gen byte leader = (comc==1) | (comr==1) if comc~=. & comr~=. |
|
|
| gen lnpden=lnpop-lnarea |
| gen absMV=abs(MV1_democrat) |
|
|
| egen tag_congressmen=tag(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
| egen group_congressmen = group(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
| |
| sort v2 sponsor_state_abbrev sponsor_district sponsor_term_served HRnumber |
| bysort v2 sponsor_state_abbrev sponsor_district sponsor_term_served: gen tag_sponsor=_n |
| egen group_sponsor = group(v2 sponsor_state_abbrev sponsor_district sponsor_term_served) |
|
|
| cap drop pct_cosponsors_opposite |
| gen pct_cosponsors_opposite=100*numb_cosponsors_opposite/(numb_cosponsors+1) |
| replace pct_cosponsors_opposite=. if pct_cosponsors_opposite>100 |
|
|
| compress |
|
|
| |
| sort v2 HRnumber |
| bysort v2 HRnumber: gen tag_bill=_n |
|
|
| gen int decade = 1980 if v2<=102 |
| replace decade=1990 if v2>=103 & v2<=107 |
| replace decade=2000 if v2>=108 |
|
|
| egen district_id = group(decade sponsor_state_abbrev sponsor_district) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| sort district_id v2 HRnumber |
| bysort district_id v2: gen counter=_n |
| foreach var of varlist tot_bills sponsor_female MV1_female MV1_democrat mixed_gender_ele |
| sponsor_party sponsor_democrat sponsor_rookie sponsor_tenure_run sponsor_age |
| leader ivycoll black occ0 occ1 occ2 occ3 occ4 borninstate { |
| sort counter district_id v2 |
| bysort counter district_id: gen X=`var'[_n+1] if counter==1 & `var'[_n+1]!=. |
| bysort district_id v2: egen `var'_l1=max(X) |
| drop X |
| } |
| |
| gen female_l1XMV1_female_l1=MV1_female_l1*sponsor_female_l1 |
| gen absMV_l1=abs(MV1_democrat_l1) |
|
|
| local controls1 = "i.v2 " |
| local controls2 = "i.v2 MV1_female_l1 female_l1XMV1_female_l1 " |
| local controls3 = "i.v2 MV1_female_l1 female_l1XMV1_female_l1 " |
| local controls4 = "i.v2 " |
| local controls5 = "i.v2 " |
|
|
| local other_controls = "i.minor house_* sponsor_democrat_l1 sponsor_rookie_l1 sponsor_tenure_run_l1 sponsor_age_l1 leader_l1 ivycoll_l1 black_l1 occ0_l1 occ1_l1 occ2_l1 occ3_l1 occ4_l1 borninstate_l1 tot_bills NE MW WE pct_black pct_urban pct_for_born pct_age_over65 lninc lnpden" |
| local billchars = "i.minor house_*" |
| local indivchars = "sponsor_democrat_l1 sponsor_rookie_l1 sponsor_tenure_run_l1 sponsor_age_l1 leader_l1 ivycoll_l1 black_l1 occ0_l1 occ1_l1 occ2_l1 occ3_l1 occ4_l1 borninstate_l1 tot_bills" |
| local districtchars = "NE MW WE pct_black pct_urban pct_for_born pct_age_over65 lninc lnpden" |
|
|
| local if1 = "if tag_bill==1 & sponsor_female==0" |
| local if2 = "if sponsor_party_l1==100 & tag_bill==1 & sponsor_female==0" |
| local if3 = "if sponsor_party_l1==200 & tag_bill==1 & sponsor_female==0" |
|
|
| forvalues j=1/5 { |
| forvalues k = 1/3 { |
| qui reg pct_cosponsors_opposite sponsor_female_l1 `controls2' `other_controls' `if`k'' & mixed_gender_election_l1==1, robust cluster(group_sponsor) |
| qui gen sample=e(sample) |
| |
| di "" |
| di "" |
| di "j = ", `j', "k = ", `k' |
| di "" |
| di "" |
|
|
| di "rdbwselect_2014 pct_cosponsors_opposite MV1_female_l1 `if`k'', c(0) kernel(uniform)" |
| rdbwselect_2014 pct_cosponsors_opposite MV1_female_l1 `if`k'', c(0) kernel(uniform) |
| local band = e(h_CCT) |
| |
| if `j'==1 { |
| di "reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `other_controls' `if`k'', robust cluster(group_sponsor)" |
| reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `other_controls' `if`k'', robust cluster(group_sponsor) |
| } |
| else if `j'==2 { |
| di "reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor)" |
| reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor) |
| } |
| else if `j'==3 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' `if`k'' & tag_sponsor==1 & abs(MV1_female_l1)<=`band' |
| predict pscore if sample==1 |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor)" |
| reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'' & sample==1 & abs(MV1_female_l1)<=`band', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
| else if `j'==4 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' absMV_l1 `if`k'' & tag_sponsor==1 |
| predict pscore |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor)" |
| reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
| else if `j'==5 { |
| qui probit sponsor_female_l1 i.v2 `districtchars' `indivchars' absMV_l1 `if`k'' & tag_sponsor==1 |
| predict pscore |
| gen wt = 1/pscore if sponsor_female_l1==1 |
| replace wt =1/(1-pscore) if sponsor_female_l1==0 |
| di "reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor)" |
| reg pct_cosponsors_opposite sponsor_female_l1 `controls`j'' `billchars' [aw=wt] `if`k'', robust cluster(group_sponsor) |
| drop pscore wt |
| } |
|
|
| if `j'~=2 & `j'~=3 { |
| scalar b_col`j'_row`k' = _b[sponsor_female_l1] |
| scalar se_col`j'_row`k' = _se[sponsor_female_l1] |
| scalar n_col`j'_row`k' = e(N) |
| sum tag_congressmen if tag_congressmen==1 & e(sample) |
| scalar ni_col`j'_row`k' = e(N_clust) |
| scalar ob_col`j'_row`k' = . |
| } |
| else if `j'==2 | `j'==3 { |
| scalar b_col`j'_row`k' = _b[sponsor_female_l1] |
| scalar se_col`j'_row`k' = _se[sponsor_female_l1] |
| scalar n_col`j'_row`k' = e(N) |
| sum tag_congressmen if tag_congressmen==1 & e(sample) |
| scalar ni_col`j'_row`k' = e(N_clust) |
| scalar ob_col`j'_row`k' = round(`band') |
| } |
|
|
| drop sample |
| |
| } |
| } |
|
|
| preserve |
|
|
| |
|
|
| forvalues i = 1/5 { |
| gen var`i' =. |
| } |
| gen str20 var6 = "" |
| |
| forvalues j=1/5 { |
| forvalues k = 1/3 { |
| replace var`j' = b_col`j'_row`k' if _n==6*(`k'-1)+1 |
| replace var`j' = se_col`j'_row`k' if _n==6*(`k'-1)+2 |
| replace var`j' = n_col`j'_row`k' if _n==6*(`k'-1)+3 |
| replace var`j' = ni_col`j'_row`k' if _n==6*(`k'-1)+4 |
| replace var`j' = ob_col`j'_row`k' if _n==6*(`k'-1)+5 |
| } |
| } |
|
|
| keep var1-var6 |
| keep if _n<=18 |
|
|
| order var6 var1-var5 |
|
|
| ren var6 sampletype |
| ren var1 OLS_all |
| ren var2 RD_bwidth |
| ren var3 RD_match_bw |
| ren var4 PS_match |
| ren var5 PS_match_indiv |
|
|
| foreach var of varlist OLS_all RD_bwidth RD_match_bw PS_match PS_match_indiv { |
| gen str3 `var'_stars ="*" if abs(`var'/`var'[_n+1])>=1.645 & mod(_n,6)==1 |
| replace `var'_stars ="**" if abs(`var'/`var'[_n+1])>=1.96 & mod(_n,6)==1 |
| replace `var'_stars="***" if abs(`var'/`var'[_n+1])>=2.58 & mod(_n,6)==1 |
| } |
|
|
| replace sampletype = "All" if _n>=1 & _n<=5 |
| replace sampletype = "Democrats" if _n>=7 & _n<=11 |
| replace sampletype = "Republicans" if _n>=13 & _n<=17 |
|
|
| order sampletype OLS_all OLS_all_stars RD_bwidth RD_bwidth_stars RD_match_bw RD_match_bw_stars PS_match PS_match_stars PS_match_indiv PS_match_indiv_stars |
| export excel using "$Output/TableD2_Placebo_CosponsorsOpposite", firstrow(var) replace |
|
|
| restore |
|
|
| log close |
|
|