********************************************************* ******* Replication Code for "TBD" (JIEL) ******* Margaret Peters ******* Run with Stata/SE version 13.1 version 13.1 ***Open data for this chapter use "crossnational_data_ch3_ch6_ch7_appendA.dta", clear set scheme plotplain ** Create the Immigration measure*** set more off factor natcode skillcode qcode reccode labcode famcode refcode asylcode citcode rightscode decode encode, pcf factors(2) /*Note - this generates the factor loadings found in table A15 */ predict immipol imrights label var immipol "Immigration Policy" label var imrights "Rights of Immigrants" ****Figure 3.1-3.3 tabulate countrynm, generate(state_) rename state_1 ARG rename state_2 AUS rename state_3 BRA rename state_4 CAN rename state_5 FRA rename state_6 GER rename state_7 HKN rename state_8 JPN rename state_9 KWT rename state_10 NLD rename state_11 NZL rename state_12 SAU rename state_13 SGP rename state_14 ZAF rename state_15 KOR rename state_16 CHE rename state_17 TWN rename state_18 GBR rename state_19 USA ****Figure 1 foreach dv in AUS CAN FRA GER JPN KOR NLD NZL CHE TWN GBR { twoway (line immipol year, lcolor(black)) (line imports_free year, lcolor(black) lpattern(dash) yaxis(2)) if year>=1783 & `dv'==1, ytitle("") ytitle("", axis(2)) name(`dv'_immitrpol, replace) //// legend(off) yscale(range(-3 3)) ylabel(-3(1)3) ylabel(0(.25)1, axis(2)) //// xlabel(, nolabels noticks) l2title(`dv') l1title("Immigration" "Policy", size(small)) r1title("Trade Policy", size(small)) //// xtitle("") } twoway (line immipol year, lcolor(black)) (line imports_free year, lcolor(black) lpattern(dash) yaxis(2)) if year>=1783 & USA==1, //// ytitle("") ytitle("", axis(2)) name(USA_immitrpol, replace) //// legend(off) yscale(range(-3 3)) ylabel(-3(1)3) ylabel(0(.25)1, axis(2)) //// l2title("USA") l1title("Immigration" "Policy", size(small)) r1title("Trade Policy", size(small)) //// fysize(10) //// text(2 1950 "Trade Policy", size(vsmall)) //// text(-2 1950 "Immigration Policy", size(vsmall)) graph combine AUS_immitrpol CAN_immitrpol FRA_immitrpol GER_immitrpol JPN_immitrpol KOR_immitrpol //// NLD_immitrpol NZL_immitrpol CHE_immitrpol TWN_immitrpol GBR_immitrpol USA_immitrpol, cols(1) ysize(8) saving(immitrpol_jiel, replace) gr export immitrpol_jiel.pdf, replace gr export immitrpol_jiel.tif, replace width(7200) ***Figure 2 drop if ARG==1 | BRA==1 | HKN==1 | KWT==1 | SAU==1 | SGP==1 | ZAF==1 twoway scatter immipol imports_free if year>1946 & year<=1973 || lfit immipol imports_free if year>1946 & year<=1973, //// graphregion(margin(tiny) fcolor(white) lcolor(white)) legend(off) //// ytitle("Immigration Policy") xtitle("Trade Policy") title("Restricted Capital, 1946-1973") graph export immi_trad_lowcap2.tif, replace width(7200) graph export immi_trad_lowcap2.pdf, replace twoway scatter immipol imports_free if year>1973 || lfit immipol imports_free if year>1973, //// graphregion(margin(tiny) fcolor(white) lcolor(white)) legend(off) //// ytitle("Immigration Policy") xtitle("Trade Policy") title("Unrestricted Capital, 1973-2010") graph export immi_trad_highcap2.tif, replace width(7200) graph export immi_trad_highcap2.pdf, replace **Figure 3 use "sensum1.dta", clear gen dvmean=DV1/count *republicans dummy gen rep = 0 if party==100 replace rep=1 if party==200 tsset id year lowess dvmean year if party==200, bwidth(0.5) generate (loessvotesrep) lowess dvmean year if party==100, bwidth(0.5) generate (loessvotesdem) drop if year<1850 collapse (mean) loessvotesrep loessvotesdem, by(party year) twoway (line loessvotesrep year, lcolor(black)) (line loessvotesdem year, lcolor(black) lpattern(dash)) if year>=1850, //// legend(off) ytitle("Proportion of Votes for Open Immigration") //// xscale(range(1850 2010)) xlabel(1850(20)2010) xtitle("Year") //// text(.445 1930 "Republicans", size(small) ) //// text(.26 1910 "Democrats", size(small) ) gr export partygraph.pdf, replace gr export partygraph.tif, replace width(7200) ******FIGURE 4 and Table 1 use "independent_vars_post_1945_v4.dta", clear merge m:m icpsrcode year using "sensumpost1945_july2010.dta" drop _merge duplicates drop id year, force tsset id year gen south=0 replace south=1 if icpsrcode>=40 & icpsrcode<=48 replace south=1 if icpsrcode==11 | icpsrcode==51 | icpsrcode==53 | icpsrcode==54 | icpsrcode==34 | icpsrcode==56 | icpsrcode==52 *republicans dummy gen rep = 0 if party==100 replace rep=1 if party==200 *republicans and southern democrats gen rep2=0 if party==100 & south==0 replace rep2=1 if party==200 replace rep2=1 if party==100 & south==1 *southern democrats gen sodem=0 replace sodem=1 if party==100 & south==1 *create DV gen dvmean=DV1/count gen timetrend=year-1789 sort id year eststo clear set more off eststo: xtreg dvmean c.cw_free##i.rep c.lnvaladdedworkerreal##i.rep c.un_entryres_lang##i.rep c.lnagrireal##i.rep c.lnequipvalreal##i.rep c.forbornper_approx##i.rep c.union_approx##i.rep c.lnwelfpercap##i.rep c.gdpgrowth##i.rep timetrend, cluster(congress) /*1970-2000*/ preserve margins, at(rep=(0 (1) 1) cw_free=(.85(0.01)1.0)) saving(predictions, replace) use predictions, clear twoway line _margin _at1 if _at2==0, lcolor(black) || line _margin _at1 if _at2==1, lcolor(black) lpattern(dash) //// legend(off) xtitle("1-National Tariff Rate") ytitle("Predicted Position on Immigration") //// text(2.25 0.8625 "Democrats", size(small) ) text(1.8 0.92 "Republicans", size(small) ) graph export reps_dems_trade.tif, replace width(7200) restore preserve margins, at(rep=(0 (1) 1) un_entryres_lang=(0(0.05)1)) saving(predictions, replace) use predictions, clear twoway line _margin _at4 if _at2==0, lcolor(black) || line _margin _at4 if _at2==1, lcolor(black) lpattern(dash) //// legend(off) xtitle("FDI Openness Abroad") ytitle("Predicted Position on Immigration") //// text(1.1 0.15 "Democrats", size(small) ) text(1.25 0.28 "Republicans", size(small) ) graph export reps_dems_fdi.tif, replace width(7200) restore esttab using Table_senate_jiel.tex, b(2) se(2) r2 label star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps replace //// booktabs title(Partisan Shifts on Immigration \label{tab:senvote}) wide