| |
| |
| |
| |
|
|
| |
| |
| |
|
|
| clear all |
|
|
| |
| global dir "/Users/armandomiano/Dropbox/AMS_Redistribution/Data/Survey_Data/Replication RESTUD sharing" |
| cd "$dir" |
|
|
| |
| global outdir "Out/Tables" |
|
|
| |
| use "Data/survey_analysis.dta", clear |
|
|
| |
| global countries "US UK DE FR IT SE" |
|
|
| |
| global videos t1 t2 t3 |
|
|
| gen flag_1=0 |
| gen flag_2=0 |
|
|
| bysort country treatment_recod: egen min_duration = pctile(duration), p(2) |
| bysort country treatment_recod: egen max_duration = pctile(duration), p(98) |
|
|
| replace flag_1=1 if duration<min_duration |
| replace flag_2=1 if duration>max_duration |
|
|
|
|
| |
|
|
| |
| foreach q in $videos{ |
|
|
| bysort country: egen max_time_`q'= pctile(time_`q'), p(98) |
| } |
|
|
| foreach q in $videos{ |
|
|
| gen flag_time_max_`q'=(time_`q'> max_time_`q') |
| replace flag_time_max_`q'=. if time_`q'==. |
|
|
| } |
|
|
| |
| keep if flag_1==0 & flag_2==0 |
|
|
|
|
| |
| foreach q in $videos{ |
|
|
| drop if flag_time_max_`q'==1 |
|
|
| } |
|
|
| |
| drop flag_1 flag_2 min_duration max_duration max_time_t1 max_time_t2 max_time_t3 flag_time_max_t1 flag_time_max_t2 flag_time_max_t3 |
|
|
|
|
| |
| do "Do/misperceptions.do" |
|
|
| |
| replace share_foreign=13.5 if country=="US" |
|
|
| |
| replace mis_share_foreign=perc_share_foreign-share_foreign if country=="US" |
|
|
| |
|
|
| gen accurate_share_foreign=0 |
| replace accurate_share_foreign=1 if mis_share_foreign>-1 & mis_share_foreign<1 |
| replace accurate_share_foreign=. if mis_share_foreign==. |
| label var accurate_share_foreign "Accurate perception of the share of immigrants" |
| label val accurate_share_foreign binary |
|
|
| |
|
|
| |
| gen imm_not_problem=(q_imm_problem==16 | q_imm_problem==17) |
| replace imm_not_problem=. if q_imm_problem==. |
| la var imm_not_problem "Immigration is not a problem" |
| label val imm_not_problem binary |
|
|
| |
| gen imm_benefits_soon=(q_imm_benefits==1 | q_imm_benefits==2 | q_imm_benefits==4) |
| replace imm_benefits_soon=. if q_imm_benefits==. |
| la var imm_benefits_soon "Immigrants should get benefits in less than 3 years" |
| label val imm_benefits_soon binary |
|
|
| |
| gen imm_citizenship_soon=(q_imm_citizenship==1 | q_imm_citizenship==2) |
| replace imm_citizenship_soon=. if q_imm_citizenship==. |
| la var imm_citizenship_soon "Immigrants should get citizenship in 2 or 5 years" |
| label val imm_citizenship_soon binary |
|
|
| |
| gen trully_american_cit=(q_imm_american==7 | q_imm_american==1 | q_imm_american==4) |
| replace trully_american_cit=. if q_imm_american==. |
| la var trully_american_cit "Consider American at citizenship or sooner" |
| label val trully_american_cit binary |
|
|
| |
| winsor2 budget_safetynet budget_health budget_education, s(_w) c(5 95) by(country) |
| la var budget_safetynet_w "% of the budget assigned to Income Support Program (winsorized)" |
| la var budget_health_w "% of the budget assigned to Public Spending on Health (winsorized)" |
| la var budget_education_w "% of the budget assigned to Spending on Schooling (winsorized)" |
|
|
| gen budget_social_w = budget_health_w + budget_safetynet_w |
| la var budget_social_w "% of the budget assigned to Income Support Program and Health (winsorized)" |
|
|
| |
| gen ineq_problem_ser=(q_inequality_problem==4 | q_inequality_problem==5) |
| replace ineq_problem_ser=. if q_inequality_problem==. |
| la var ineq_problem_ser "Inequality is a serious problem" |
| label val ineq_problem_ser binary |
|
|
| |
| gen total_donation_d=0 |
| foreach x in $countries { |
| su total_donation if country=="`x'", d |
| replace total_donation_d=1 if total_donation>r(p50) & country=="`x'" |
| } |
| replace total_donation_d=. if total_donation==. |
|
|
| la var total_donation_d "Donated more than the median of the country of reference" |
| label val total_donation_d binary |
|
|
|
|
| |
| |
| |
|
|
| |
| gen left=(party_voted==4 | party_voted==5) |
| replace left=. if party_voted==. | party_voted==6 | party_voted==0 |
| gen right=(party_voted==1 | party_voted==2) |
| replace right=. if party_voted==. | party_voted==6 | party_voted==0 |
| gen center=(party_voted==3) |
| replace center=. if party_voted==. | party_voted==6 | party_voted==0 |
|
|
| label var left "Left-wing" |
| label var right "Right-wing" |
| label var center "Center" |
|
|
| foreach i in left right center{ |
| label val `i' binary |
| } |
|
|
| |
| gen young=(age<45) |
| label var young "Is less than 45" |
| label val young binary |
|
|
| |
| gen male=(sex==1) |
| label var male "Male" |
| label val male binary |
|
|
| |
| gen children=(number_children>1) |
| replace children=. if number_children==. |
| label var children "Has children" |
| label val children binary |
|
|
| |
| gen immigrant_parent=(q_parent_same==2) |
| replace immigrant_parent=. if q_parent_same==. |
| label var immigrant_parent "At least one of the parents is an immigrant" |
| label val immigrant_parent binary |
|
|
| |
| gen top_income=0 |
| foreach x in $countries{ |
| su household_income if country=="`x'", d |
| replace top_income=1 if household_income>r(p75) & country=="`x'" |
| } |
| label var top_income "High Income" |
| label val top_income binary |
|
|
| |
| label var immigfirst "Order/Salience T" |
|
|
| |
| gen treatment1_if = treatment1*immigfirst |
| gen treatment2_if = treatment2*immigfirst |
| gen treatment3_if = treatment3*immigfirst |
| label var treatment1_if "Share of Immigrants Treatment and saw first the Immigration Block" |
| label var treatment2_if "Origin of Immigrants Treatment and saw first the Immigration Block" |
| label var treatment3_if "Hard Work Treatment and saw first the Immigration Block" |
|
|
| foreach i in 1 2 3{ |
| label val treatment`i'_if binary |
| } |
|
|
|
|
| |
| |
| |
|
|
|
|
| global controls right left male young immigrant_parent children university_degree top_income sector_dummy |
|
|
|
|
| |
| |
| |
|
|
| global treatments_int treatment1 treatment2 treatment3 treatment1_if treatment2_if treatment3_if |
|
|
| global treatments treatment1 treatment2 treatment3 |
|
|
| global X $treatments $controls i.country |
|
|
| global X_int immigfirst $treatments_int $controls i.country |
|
|
|
|
| |
| |
| |
|
|
| global table_name "$outdir/table_2stage_redistribution" |
| |
| |
|
|
| |
| file open holder using $table_name.tex, write replace text |
| file write holder "\begin{tabular}{lcccccc} " _n |
| file write holder "& Tax & Tax & Social & Education & Inequality & Donation \\" _n |
| file write holder "& Top 1 & Bottom 50 & Budget & Budget & Serious Problem & Above Median \\" _n |
| file write holder "& (1) & (2) & (3) & (4) & (5) & (6) \\ \hline" _n |
| file close holder |
| |
| file open holder using temp_end.tex, write replace text |
| file write holder "\hline \end{tabular}" _n |
| file close holder |
|
|
|
|
| eststo clear |
|
|
| foreach var in tax_top1 tax_bottom50 budget_social_w budget_education_w ineq_problem_ser total_donation_d{ |
| eststo: xi: reg `var' $X_int, robust |
| su `var' if e(sample)==1 & control==1 & immigfirst==0 |
| local `var'mc: display %5.2f `r(mean)' |
| } |
| esttab using temp_all_2.tex, replace fragment booktabs keep(immigfirst $treatments) order(immigfirst $treatments) noconst label |
| star(* .1 ** .05 *** .01) se nonumbers nomtitles nolines nocon compress |
|
|
| |
| file open holder using temp_mid3.tex, write replace text |
| file write holder "Control mean & `tax_top1mc' & `tax_bottom50mc' & `budget_social_wmc' & `budget_education_wmc' & `ineq_problem_sermc' & `total_donation_dmc' \\" _n |
| file close holder |
|
|
|
|
| appendfile temp_all_2.tex $table_name.tex |
| appendfile temp_mid3.tex $table_name.tex |
| appendfile temp_end.tex $table_name.tex |
|
|
|
|
|
|
| erase temp_all_2.tex |
| erase temp_mid3.tex |
| erase temp_end.tex |
|
|
|
|
| |
| |
| |
|
|
| global table_name "$outdir/table_1stage" |
|
|
| |
| file open holder using $table_name.tex, write replace text |
| file write holder "\begin{tabular}{lccccccc} " _n |
| file write holder "& All & Accurate Perception & M. East and & N. America, W. and & Muslim & Christian & Lack of Effort \\" _n |
| file write holder "& Immigrants & All Immigrants & N. Africa & E. Europe & & & Reason Poor \\" _n |
| file write holder "& (misp.) & & (misp.) & (misp.) & (misp.) & (misp.) & \\" _n |
| file write holder "& (1) & (2) & (3) & (4) & (5) & (6) & (7) \\ \hline" _n |
| file close holder |
| |
| file open holder using temp_end.tex, write replace text |
| file write holder "\hline \end{tabular}" _n |
| file close holder |
|
|
|
|
| eststo clear |
| foreach var in mis_share_foreign accurate_share_foreign mis_share_ME_NAF mis_share_NA_WE_EE mis_share_mu mis_share_ch effort_poor{ |
| eststo: xi: reg `var' $X, robust |
| su `var' if e(sample)==1 & control==1 |
| local `var'mc: display %5.2f `r(mean)' |
| } |
| esttab using temp_all.tex, replace fragment booktabs keep($treatments) noconst label |
| star(* .1 ** .05 *** .01) se nonumbers nomtitles nolines nocon compress |
|
|
| |
| file open holder using temp_mid1.tex, write replace text |
| file write holder "Control mean & `mis_share_foreignmc' & `accurate_share_foreignmc' & `mis_share_ME_NAFmc' & `mis_share_NA_WE_EEmc' & `mis_share_mumc' & `mis_share_chmc' & `effort_poormc' \\" _n |
| file close holder |
|
|
|
|
| appendfile temp_all.tex $table_name.tex |
| appendfile temp_mid1.tex $table_name.tex |
| appendfile temp_end.tex $table_name.tex |
|
|
|
|
| erase temp_all.tex |
| erase temp_end.tex |
| erase temp_mid1.tex |
|
|
|
|
| |
| |
| |
|
|
| global table_name "$outdir/table_2stage_immigration" |
|
|
|
|
| |
|
|
| foreach var in imm_not_problem imm_benefits_soon imm_citizenship_soon |
| trully_american_cit q_govt_imm { |
| xi: reg `var' $X |
| su `var' if e(sample)==1 & control==1 |
| local `var'mc: display %5.3f `r(mean)' |
| su `var' if e(sample)==1 & control==1 |
| local `var'sdc: display %5.3f `r(sd)' |
| su `var' if e(sample)==1 & treatment1==1 |
| local `var'mt1: display %5.3f `r(mean)' |
| su `var' if e(sample)==1 & treatment2==1 |
| local `var'mt2: display %5.3f `r(mean)' |
| su `var' if e(sample)==1 & treatment3==1 |
| local `var'mt3: display %5.3f `r(mean)' |
| gen `var'_ind=(`var'-``var'mc')/``var'sdc' |
| replace `var'_ind=(``var'mc'-``var'mc')/``var'sdc' if `var'==. & control==1 |
| replace `var'_ind=(``var'mt1'-``var'mc')/``var'sdc' if `var'==. & treatment1==1 |
| replace `var'_ind=(``var'mt2'-``var'mc')/``var'sdc' if `var'==. & treatment2==1 |
| replace `var'_ind=(``var'mt3'-``var'mc')/``var'sdc' if `var'==. & treatment3==1 |
| } |
|
|
| gen index_imm_support=(imm_benefits_soon_ind + imm_citizenship_soon_ind |
| +trully_american_cit_ind + q_govt_imm_ind +imm_not_problem_ind)/5 |
|
|
| |
| drop imm_not_problem_ind imm_benefits_soon_ind imm_citizenship_soon_ind |
| trully_american_cit_ind q_govt_imm_ind |
|
|
| |
| xi: reg index_imm_support $X |
| su index_imm_support if e(sample)==1 & control==1 |
| local index_imm_supportmc: display %5.3f `r(mean)' |
| local index_imm_supportsdc: display %5.3f `r(sd)' |
| replace index_imm_support = (index_imm_support - `index_imm_supportmc')/`index_imm_supportsdc' |
|
|
| |
| file open holder using $table_name.tex, write replace text |
| file write holder "\begin{tabular}{lcccccc} " _n |
| file write holder "& Imm. Not & Imm. Benefits & Imm. Citizenship & American & Govt. Should care & Imm Support \\" _n |
| file write holder "& A Problem & Soon & Soon & Upon Citizenship/Before & About Everyone & Index \\" _n |
| file write holder "& (1) & (2) & (3) & (4) & (5) & (6) \\ \hline" _n |
| file close holder |
| |
| file open holder using temp_end.tex, write replace text |
| file write holder "\hline \end{tabular}" _n |
| file close holder |
|
|
| eststo clear |
| foreach var in imm_not_problem imm_benefits_soon imm_citizenship_soon |
| trully_american_cit q_govt_imm index_imm_support{ |
| eststo: xi: reg `var' $X, robust |
| su `var' if e(sample)==1 & control==1 |
| local `var'mc: display %5.2f `r(mean)' |
| } |
| esttab using temp_all.tex, replace fragment booktabs keep($treatments) noconst label |
| star(* .1 ** .05 *** .01) se nonumbers nomtitles nolines nocon compress |
|
|
| |
| file open holder using temp_mid1.tex, write replace text |
| file write holder "Control mean & `imm_not_problemmc' & `imm_benefits_soonmc' & `imm_citizenship_soonmc' & `trully_american_citmc' & `q_govt_immmc' & `index_imm_supportmc' \\" _n |
| file close holder |
|
|
|
|
| appendfile temp_all.tex $table_name.tex |
| appendfile temp_mid1.tex $table_name.tex |
| appendfile temp_end.tex $table_name.tex |
|
|
|
|
| erase temp_all.tex |
| erase temp_mid1.tex |
| erase temp_end.tex |
|
|