**** simulate the effects of immigration on wages using the data 1990-2006**** ** import and merge the files with wage and hours worked *** clear cd H:\Giovanni\MyPapers\Peri_Ottaviano_aggregate\REDUX_2008\empirics\simulations capture log close set mem 2g set matsize 800 use supply_groups_60_06_specification_1.dta sort year edu exp save employment, replace clear use supply_wage_60_06_specification_1 sort year edu exp merge year edu exp using employment ** keep only 1990 and 2006 drop if year<1990 drop if year==2000 ** define the new broad and fine education indices ** broad 1 for HS or less and broad=2 for some college or more ** fine is now a sub-index going from 1 to 2 and defines the low and hig education subgroup in each broad group. gen broad=1 if edu<3 replace broad=2 if edu>=3 gen fine=1 if edu==1|edu==3 replace fine=2 if edu==2|edu==4 *generate hours worked and wages by group gen howo_for=howo_ma_for+howo_fe_for gen howo_us=howo_ma_us+howo_fe_us gen weekly_for=(howo_ma_for*weekly_ma_for+howo_fe_for*weekly_fe_for)/(howo_ma_for+howo_fe_for) gen weekly_us=(howo_ma_us*weekly_ma_us+howo_fe_us*weekly_fe_us)/(howo_ma_us+howo_fe_us) sort broad fine exp year *** create wage shares in 1990 and 2006 egen wagebill_us=sum(howo_us*weekly_us), by(year) egen wagebill_for=sum(howo_for*weekly_for), by(year) gen share_wage_us=(howo_us*weekly_us)/(wagebill_us+wagebill_for) gen share_wage_for=(howo_for*weekly_for)/(wagebill_us+wagebill_for) * percentage increases in the group of foreign-born, 1990-2006 * gen dperc_for_90_06=(howo_for[_n+1]-howo_for)/howo_for if year==1990 gen dperc_for_90_06_oftotal=(howo_for[_n+1]-howo_for)/(howo_for+howo_us) if year==1990 gen dweekly_us_90_06=(weekly_us[_n+1]-weekly_us)/weekly_us drop if year==2006 ** now we have a cross section **** complementarity effect from immigration in all groups egen effect1_90_06=sum(share_wage_for*dperc_for_90_06) sort broad **** complementarity effect from immigration in groups with same broad education egen effect2_90_06=sum(share_wage_for*dperc_for_90_06), by(broad) sort edu ***substitution effect from group with same broad and fine education egen effect3_90_06=sum(share_wage_for*dperc_for_90_06), by(edu) ***substitution effect from group with same broad and fine education and experience gen effect4_90_06=share_wage_for*dperc_for_90_06 *** share in wage of group with same education gen share_wage_ksjt=share_wage_for+ share_wage_us sort broad egen share_wage_kt=sum(share_wage_ksjt), by (broad) sort edu egen share_wage_kst=sum(share_wage_ksjt), by (edu) *** combining all effects, into effect on US born and foreign-born wages *** parameters, allowing different elast between some HS-HSG and someCO-COG, asn also different sigma_immi in H and L ** change the parameter value here to obtain simulations reported in table 7 ** we allow different elast of subst native-immigrant depending on H or L, ** in the paper we only use simulations with same sigma_immi for H and L. *** the current one is our preferred parameter combination gen sigma_HL=2 gen sigma_sub_L=20 gen sigma_sub_H=10 gen sigma_exp=7 gen sigma_immi_L=20 gen sigma_immi_H=20 /** the variables dperc_wage_us_90_06 and dperc_wage_for_90_06 are the percentage wage changes 1990-2006 due to immigrants for natives and foreign-born respectively. They are produced by the lines of program below and can be put in the corresponding columns of the excel progam "averaging effects" to obtain also the percentage wage changes for aggregate education groups by nationality **/ gen dperc_wage_us_90_06=(1/sigma_HL)*(effect1_90_06)+((1/sigma_sub_L)*(broad==1)+(1/sigma_sub_H)*(broad==2) -(1/sigma_HL))*(1/share_wage_kt)*(effect2_90_06)+((1/sigma_exp)-(1/sigma_sub_L)*(broad==1)-(1/sigma_sub_H)*(broad==2))*(1/share_wage_kst)*(effect3_90_06)+((1/sigma_immi_L)*(broad==1)+(1/sigma_immi_H)*(broad==2)-(1/sigma_exp))*(1/share_wage_ksjt)*(effect4_90_06) gen dperc_wage_for_90_06=(1/sigma_HL)*(effect1_90_06)+((1/sigma_sub_L)*(broad==1)+(1/sigma_sub_H)*(broad==2) -(1/sigma_HL))*(1/share_wage_kt)*(effect2_90_06)+((1/sigma_exp)-(1/1/sigma_sub_L)*(broad==1)-(1/sigma_sub_H)*(broad==2))*(1/share_wage_kst)*(effect3_90_06)+((1/sigma_immi_L)*(broad==1)+(1/sigma_immi_H)*(broad==2)-(1/sigma_exp))*(1/share_wage_ksjt)*(effect4_90_06)-((1/sigma_immi_L)*(broad==1)+(1/sigma_immi_H)*(broad==2))*(dperc_for_90_06)