diff --git a/32/paper.pdf b/32/paper.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2131375e0373885a2e385ca639950f6d1ab406d5 --- /dev/null +++ b/32/paper.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcf5bb75e799ab4e1e3711ba7844a57acaa2d088d432e5da697abba065bb4d3f +size 411956 diff --git a/32/replication_package/1-ReadMe.txt b/32/replication_package/1-ReadMe.txt new file mode 100644 index 0000000000000000000000000000000000000000..a8f64acf0c9a6b7605674040d9105127763bd5b1 --- /dev/null +++ b/32/replication_package/1-ReadMe.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d5234931ac466ad3e769724309900ec8438f8fe1481002da79633f1fbca043a +size 7074 diff --git a/32/replication_package/ContextAnalysis_Appendix.R b/32/replication_package/ContextAnalysis_Appendix.R new file mode 100644 index 0000000000000000000000000000000000000000..60d950a1bec0b543ac1d0c3506fcfad662b8e84d --- /dev/null +++ b/32/replication_package/ContextAnalysis_Appendix.R @@ -0,0 +1,719 @@ +# Replication File for Appendix Survey Analyses +# Table C1 in Appendix C1: The Effect of Excess Males on the Probability of Observing at least One Hate Crime +# Table C2 in Appendix C2: The Effect of Excess Males on the Probability of Observing at least One Hate Crime (Different Definition of “Excess Males”) +# Table C3 in Appendix C3: The Effect of Excess Males on the Probability of Observing at least One Hate Crime (linear probability model) +# Table C4 in Appendix C4: The Effect of Excess Males on the Probability of Observing at least One Physical Attack +# Table C5 in Appendix C5: Negative Binomial Regression +# Table C6 in Appendix C6: Interaction between Excess Males and East/West Germany +# Table C7 in Appendix C7: Interaction between Excess Males and Refugee Inflow +# Table C9 in Appendix C9: Placebo Analysis +# Appendix C10: Descriptive Statistics + +# R version 4.0.2 (2020-06-22) + +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("stargazer") # stargazer_5.2.2 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(stargazer) # stargazer_5.2.2 +source("Help.R") + +dat <- read.dta13("context.dta") + +dat_2015 <- dat[dat$year == 2015, ] +dat_2016 <- dat[dat$year == 2016, ] +dat_2017 <- dat[dat$year == 2017, ] +dat_2015$Hate_all_muni_1517 <- dat_2015$Hate_all_muni + dat_2016$Hate_all_muni + dat_2017$Hate_all_muni +dat_2015$Hate_all_muni_1517_bin <- ifelse(dat_2015$Hate_all_muni_1517 > 0, 1, 0) + +# Remove Extreme Value of Excess Males +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +# ########################################## +# Main Table (Table C1 in Appendix C1) +# ########################################## +bin_1_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county), # county fixed effects + id = "ags_county", data = dat_2015_s) + +bin_1_p <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county) + as.factor(year), # county + year fixed effects + id = "ags_county", data = dat_s) + +bin_2_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county), # county fixed effects + id = "ags_county", data = dat_2015_s) + +bin_2_p <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county) + as.factor(year), # county + year fixed effects + id = "ags_county", data = dat_s) + +bin_3_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state), # state fixed effects + id = "ags_county", data = dat_2015_s) + +bin_3_p <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state) + as.factor(year), # state + year fixed effects + id = "ags_county", data = dat_s) + +fit_list <- list(bin_1_sum$fit, bin_1_p$fit, + bin_2_sum$fit, bin_2_p$fit, + bin_3_sum$fit, bin_3_p$fit) +se_list <- list(sqrt(diag(bin_1_sum$vcov)), sqrt(diag(bin_1_p$vcov)), + sqrt(diag(bin_2_sum$vcov)), sqrt(diag(bin_2_p$vcov)), + sqrt(diag(bin_3_sum$vcov)), sqrt(diag(bin_3_p$vcov))) + +star_out(stargazer(fit_list, se = se_list, + covariate.labels = c("Excess Males (Age 15 - 44)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage"), + keep=c("pop_15_44_muni_gendergap_2015", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015")), + name = "table_C1.tex") + +# ############################################### +# Replicate Table with 25-44 (Table C2 in C2) +# ############################################### +range_x2 <- quantile(dat_2015$pop_25_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s2 <- dat_2015[dat_2015$pop_25_44_muni_gendergap_2015 >= range_x2[1] & + dat_2015$pop_25_44_muni_gendergap_2015 <= range_x2[2], ] +dat_s2 <- dat[dat$pop_25_44_muni_gendergap_2015 >= range_x2[1] & + dat$pop_25_44_muni_gendergap_2015 <= range_x2[2], ] + + +bin_r_1_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s2) + +bin_r_1_p <- bin.summary(Hate_all_muni_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s2) + +bin_r_2_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s2) + +bin_r_2_p <- bin.summary(Hate_all_muni_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s2) + +bin_r_3_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state), + id = "ags_county", data = dat_2015_s2) + +bin_r_3_p <- bin.summary(Hate_all_muni_bin ~ + pop_25_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s2) + + +## Table C2 in Appendix C2 +fit_list2 <- list(bin_r_1_sum$fit, bin_r_1_p$fit, + bin_r_2_sum$fit, bin_r_2_p$fit, + bin_r_3_sum$fit, bin_r_3_p$fit) +se_list2 <- list(sqrt(diag(bin_r_1_sum$vcov)), sqrt(diag(bin_r_1_p$vcov)), + sqrt(diag(bin_r_2_sum$vcov)), sqrt(diag(bin_r_2_p$vcov)), + sqrt(diag(bin_r_3_sum$vcov)), sqrt(diag(bin_r_3_p$vcov))) + +star_out(stargazer(fit_list2, se = se_list2, + covariate.labels = c("Excess Males (Age 25 - 44)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage"), + keep=c("pop_25_44_muni_gendergap_2015", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015")), + name = "table_C2.tex") + +# ##################################### +# Linear Probability Model (Table C3 in Appendix C3) +# ##################################### +lm_1_sum <- lm.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s) + +lm_1_p <- lm.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s) + +lm_2_sum <- lm.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s) + +lm_2_p <- lm.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s) + +lm_3_sum <- lm.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state), + id = "ags_county", data = dat_2015_s) + +lm_3_p <- lm.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s) + + +fit_list_lm <- list(lm_1_sum$fit, lm_1_p$fit, + lm_2_sum$fit, lm_2_p$fit, + lm_3_sum$fit, lm_3_p$fit) +se_list_lm <- list(sqrt(diag(lm_1_sum$vcov)), sqrt(diag(lm_1_p$vcov)), + sqrt(diag(lm_2_sum$vcov)), sqrt(diag(lm_2_p$vcov)), + sqrt(diag(lm_3_sum$vcov)), sqrt(diag(lm_3_p$vcov))) + +star_out(stargazer(fit_list_lm, se = se_list_lm, + covariate.labels = c("Excess Males (Age 15 - 44)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage"), + keep=c("pop_15_44_muni_gendergap_2015", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015")), + name = "table_C3.tex") + + +## ############################################ +## Physical Attacks (Table C4 in Appendix C4) +## ############################################ +dat_2015$Physical_muni_1517 <- dat_2015$Physical_muni + dat_2016$Physical_muni + dat_2017$Physical_muni +dat_2015$Physical_muni_1517_bin <- ifelse(dat_2015$Physical_muni_1517 > 0, 1, 0) +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +bin_phys_1_sum <- bin.summary(Physical_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s) + +bin_phys_1_p <- bin.summary(Physical_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s) + +bin_phys_2_sum <- bin.summary(Physical_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county), + id = "ags_county", data = dat_2015_s) + +bin_phys_2_p <- bin.summary(Physical_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + as.factor(ags_county) + as.factor(year), + id = "ags_county", data = dat_s) + +bin_phys_3_sum <- bin.summary(Physical_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state), + id = "ags_county", data = dat_2015_s) + +bin_phys_3_p <- bin.summary(Physical_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s) + +## Table C4 in Appendix C4 +fit_list_bin_phys <- list(bin_phys_1_sum$fit, bin_phys_1_p$fit, + bin_phys_2_sum$fit, bin_phys_2_p$fit, + bin_phys_3_sum$fit, bin_phys_3_p$fit) +se_list_bin_phys <- list(sqrt(diag(bin_phys_1_sum$vcov)), sqrt(diag(bin_phys_1_p$vcov)), + sqrt(diag(bin_phys_2_sum$vcov)), sqrt(diag(bin_phys_2_p$vcov)), + sqrt(diag(bin_phys_3_sum$vcov)), sqrt(diag(bin_phys_3_p$vcov))) + +star_out(stargazer(fit_list_bin_phys, se = se_list_bin_phys, + covariate.labels = c("Excess Males (Age 15 - 44)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage"), + keep=c("pop_15_44_muni_gendergap_2015", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015")), + name = "table_C4.tex") + +## ######################################## +## Appendix C5: Count Model +## ######################################## +rm(list=ls()) + +dat <- read.dta13("context.dta") +source("Help.R") + +dat_2015 <- dat[dat$year == 2015, ] +dat_2016 <- dat[dat$year == 2016, ] +dat_2017 <- dat[dat$year == 2017, ] +dat_2015$Hate_all_muni_1517 <- dat_2015$Hate_all_muni + dat_2016$Hate_all_muni + dat_2017$Hate_all_muni + +# Remove Extreme Value of Excess Males +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +for_s <- as.formula(Hate_all_muni_1517 ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state)) # state fixed effects + +for_p <- as.formula(Hate_all_muni ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(ags_state) + as.factor(year)) # state + year fixed effects + +## Use boostrap to compute standard errors (Use the "out_count.rdata" to get the exact same estimates) +## Note: the following codes take a while to run +full_run <- FALSE +if(full_run == TRUE){ + # Sum + nb_1_sum_b <- glm.boot(for_s, family = "negative-binomial", + data = dat_2015_s, + cluster_id = dat_2015_s$ags_county) + + # Panel + nb_1_p_b <- glm.boot(for_p, family = "negative-binomial", + data = dat_s, + cluster_id = dat_s$ags_county) + + fit_list_nb <- list(nb_1_sum_b$fit, nb_1_p_b$fit) + se_list_nb <- list(nb_1_sum_b$se, nb_1_p_b$se) + + out_count_table <- list(fit_list_nb, se_list_nb) + save(out_count_table, file = "out_count_table.rdata") +} + +load(file = "out_count_table.rdata") +fit_list_nb <- out_count_table[[1]] +se_list_nb <- out_count_table[[2]] + +star_out(stargazer(fit_list_nb, se = se_list_nb, + covariate.labels = c("Excess Males (Age 15 - 44)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage"), + keep=c("pop_15_44_muni_gendergap_2015", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015")), + name = "table_C5.tex") + + + +## ######################################################################## +## Replicate Tables with East/West Interaction (Table C6 in Appendix C6) +## ######################################################################## +rm(list=ls()) + +dat <- read.dta13("context.dta") +source("Help.R") + +dat_2015 <- dat[dat$year == 2015, ] +dat_2016 <- dat[dat$year == 2016, ] +dat_2017 <- dat[dat$year == 2017, ] +dat_2015$Hate_all_muni_1517 <- dat_2015$Hate_all_muni + dat_2016$Hate_all_muni + dat_2017$Hate_all_muni +dat_2015$Hate_all_muni_1517_bin <- as.numeric(dat_2015$Hate_all_muni_1517 > 0) + +# Remove Extreme Value of Excess Males +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +dat_2015_s$west <- 1 - dat_2015_s$east +dat_s$west <- 1 - dat_s$east + +bin_2_sum_ew <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + west + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015, + id = "ags_county", data = dat_2015_s) + +bin_2_p_ew <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + west + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(year), + id = "ags_county", data = dat_s) + +bin_3_sum_ew <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015*west + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015, + id = "ags_county", data = dat_2015_s) + +bin_3_p_ew <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015*west + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(year), + id = "ags_county", data = dat_s) + +fit_list_ew <- list(bin_2_sum_ew$fit, bin_2_p_ew$fit, + bin_3_sum_ew$fit, bin_3_p_ew$fit) +se_list_ew <- list(sqrt(diag(bin_2_sum_ew$vcov)), sqrt(diag(bin_2_p_ew$vcov)), + sqrt(diag(bin_3_sum_ew$vcov)), sqrt(diag(bin_3_p_ew$vcov))) + +star_out(stargazer(fit_list_ew, se = se_list_ew, + covariate.labels = c("Excess Males (Age 15 - 44)", "West", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Inflow) (2014 vs 2015)", + "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage", + "Excess Males x West"), + keep=c("pop_15_44_muni_gendergap_2015", "west", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_ref_inflow_1514", + "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015", + "pop_15_44_muni_gendergap_2015:west")), + name = "table_C6.tex") + + +## ############################################################## +## Interaction with Refugee Inflow (Table C7 in Appendix C7) +## ############################################################## +bin_sum_int <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015*log_ref_inflow_1514 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state), + id = "ags_county", data = dat_2015_s) + +bin_p_int <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015*log_ref_inflow_1514 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s) + +## Table C7 in Appendix C7 +fit_list_int <- list(bin_sum_int$fit, bin_p_int$fit) +se_list_int <- list(sqrt(diag(bin_sum_int$vcov)), sqrt(diag(bin_p_int$vcov))) + +star_out(stargazer(fit_list_int, se = se_list_int, + covariate.labels = c("Excess Males (Age 15 - 44)", + "Log (Refugee Inflow) (2014 vs 2015)", + "Log (Population)","Log (Population Density)", + "Log (Unemployment Rate)", + "% of population change (2011 vs 2015)", + "Vote share for AfD (2013)", + "Log (Refugee Size) (2014)", + "Log (General Violence per capita)", + "% of High Education", + "Change in Manufacturing Share (2011 vs 2015)", + "Share of Manufacturing", "Male Disadvantage", + "Excess Males × Log (Refugee Inflow)"), + keep=c("pop_15_44_muni_gendergap_2015", "log_ref_inflow_1514", + "log_population_muni_2015", + "log_popdens_muni_2015", "log_unemp_all_muni_2015", + "d_pop1511_muni", "vote_afd_2013_muni", + "log_pop_ref_2014", + "log_violence_percap_2015", + "pc_hidegree_all2011", "d_manuf1115", "pc_manufacturing_2015", "unemp_gendergap_2015", + "pop_15_44_muni_gendergap_2015:log_ref_inflow_1514")), + name = "table_C7.tex") + +# ################################################################ +# Appendix C9. Placebo Analysis +# ############################################################### +rm(list=ls()) + +dat_pl <- read.dta13("context_placebo.dta") # data for placebo analysis +source("Help.R") + +dat_2015_s <- dat_pl[dat_pl$year == 2015, ] +dat_2016_s <- dat_pl[dat_pl$year == 2016, ] +dat_2017_s <- dat_pl[dat_pl$year == 2017, ] + +# ########################################## +# 2015 +# ########################################## +# main model + Placebo Treatment +bin_15_sum_pl <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_future + + pop_15_44_muni_gendergap_anu + + log(population_muni_anu) + log(popdens_muni_anu) + + log_unemp_all_muni_anu + d_pop_muni_anu + vote_afd_2013_muni + + log_ref_inflow_anu + log(pop_ref_anu) + log(violence_percap_anu) + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_anu + + as.factor(ags_state), # state fixed effects + id = "ags_county", data = dat_2015_s) + +# ########################################## +# 2016 +# ########################################## +# Main model + Placebo +bin_16_sum_pl <- bin.summary(Hate_all_muni_bin ~ pop_15_44_muni_gendergap_future + + pop_15_44_muni_gendergap_anu + + log(population_muni_anu) + log(popdens_muni_anu) + + log_unemp_all_muni_anu + d_pop_muni_anu + vote_afd_2013_muni + + log_ref_inflow_anu + log(pop_ref_anu) + log(violence_percap_anu) + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_anu + + as.factor(ags_state), # state fixed effects + id = "ags_county", data = dat_2016_s) + +# ########################## +# 2017 +# ######################### +# Main model + Placebo +bin_17_sum_pl <- bin.summary(Hate_all_muni_bin ~ pop_15_44_muni_gendergap_future + + pop_15_44_muni_gendergap_anu + + log(population_muni_anu) + log(popdens_muni_anu) + + log_unemp_all_muni_anu + d_pop_muni_anu + vote_afd_2013_muni + + log_ref_inflow_anu + log(pop_ref_anu) + log(violence_percap_anu) + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_anu + + as.factor(ags_state), # state fixed effects + id = "ags_county", data = dat_2017_s) + +## #################### +## Pooled Analysis +## #################### +# Final model + Placebo +bin_pool_sum_pl <- bin.summary(Hate_all_muni_bin ~ pop_15_44_muni_gendergap_future + + pop_15_44_muni_gendergap_anu + + log(population_muni_anu) + log(popdens_muni_anu) + + log_unemp_all_muni_anu + d_pop_muni_anu + vote_afd_2013_muni + + log_ref_inflow_anu + log(pop_ref_anu) + log(violence_percap_anu) + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_anu + + as.factor(ags_state) + as.factor(year), # state + year fixed effects + id = "ags_county", data = dat_pl) + +# Repeat the analysis for Large Counties +dat_pool_s_l <- dat_pl[dat_pl$population_muni_anu > + quantile(dat_pl$population_muni_anu, prob = 0.5), ] + +# Main model + Placebo +bin_pool_sum_pl_l <- bin.summary(Hate_all_muni_bin ~ pop_15_44_muni_gendergap_future + + pop_15_44_muni_gendergap_anu + + log(population_muni_anu) + log(popdens_muni_anu) + + log_unemp_all_muni_anu + d_pop_muni_anu + vote_afd_2013_muni + + log_ref_inflow_anu + log(pop_ref_anu) + log(violence_percap_anu) + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_anu + + as.factor(ags_state) + as.factor(year), # state + year fixed effects + id = "ags_county", data = dat_pool_s_l) + +# Table +pl_fit_list_m <- list(bin_15_sum_pl$fit, + bin_16_sum_pl$fit, + bin_17_sum_pl$fit, + bin_pool_sum_pl$fit, + bin_pool_sum_pl_l$fit) +pl_se_list_m <- list(sqrt(diag(bin_15_sum_pl$vcov)), + sqrt(diag(bin_16_sum_pl$vcov)), + sqrt(diag(bin_17_sum_pl$vcov)), + sqrt(diag(bin_pool_sum_pl$vcov)), + sqrt(diag(bin_pool_sum_pl_l$vcov))) + +star_out(stargazer(pl_fit_list_m, se = pl_se_list_m, + covariate.labels = c("Future-Treatment"), + keep=c("pop_15_44_muni_gendergap_future")), + name = "table_C9.tex") + + +# ############################## +# Appendix C10. Descriptive Statistics +# ############################## +rm(list=ls()) + +dat <- read.dta13("context.dta") + +min15 <- round(min(dat$pc_ref_male[dat$year == 2015], na.rm = TRUE),2) +min16 <- round(min(dat$pc_ref_male[dat$year == 2016], na.rm = TRUE),2) + +pdf("figure_C10.pdf", height = 5, width = 10) +par(mfrow = c(1, 2)) +plot(density(dat$pc_ref_male[dat$year == 2015], na.rm = TRUE), + main = "Proportion of Male Refugees (2015)", + xlim = c(50, 100), xlab = "Percent of Male Refugees Among Refugees (county)") +text(x = 90, y = 0.08, paste0("min = ", min15), font = 2) +polygon(density(dat$pc_ref_male[dat$year == 2015], na.rm = TRUE)$x, + density(dat$pc_ref_male[dat$year == 2015], na.rm = TRUE)$y,col='grey80') + +plot(density(dat$pc_ref_male[dat$year == 2016], na.rm = TRUE), + main = "Proportion of Male Refugees (2016)", xlim = c(50, 100), + xlab = "Percent of Male Refugees Among Refugees (county)") +text(x = 90, y = 0.12, paste0("min = ", min16), font = 2) +polygon(density(dat$pc_ref_male[dat$year == 2016], na.rm = TRUE)$x, + density(dat$pc_ref_male[dat$year == 2016], na.rm = TRUE)$y,col='grey80') +dev.off() + diff --git a/32/replication_package/ContextAnalysis_Main.R b/32/replication_package/ContextAnalysis_Main.R new file mode 100644 index 0000000000000000000000000000000000000000..6469fdd4259d8ce91fce4257fb1e6ff80f2ee733 --- /dev/null +++ b/32/replication_package/ContextAnalysis_Main.R @@ -0,0 +1,214 @@ +# Replication File for +# Figure 1 (Effects of Excess Males on Prob of Hate Crime) +# Appendix: Figure C8 (Effects of Male Diadvantage on Prob of Hate Crime) + +# R version 4.0.2 (2020-06-22) + +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +source("Help.R") + +dat <- read.dta13("context.dta") + +dat_2015 <- dat[dat$year == 2015, ] +dat_2016 <- dat[dat$year == 2016, ] +dat_2017 <- dat[dat$year == 2017, ] +dat_2015$Hate_all_muni_1517 <- dat_2015$Hate_all_muni + dat_2016$Hate_all_muni + dat_2017$Hate_all_muni +dat_2015$Hate_all_muni_1517_bin <- ifelse(dat_2015$Hate_all_muni_1517 > 0, 1, 0) + +## ######################### +## Main Figure (Figure 1) +## ######################### +# Remove Extreme Value of Excess Males +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +# sum +bin_1_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(ags_state), + id = "ags_county", data = dat_2015_s) + +# annual +bin_1_p <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s) + +# Excess Males +# Effect Estimation +bin_1_sum_effect <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.2)) + +bin_1_p_effect <- marginal_effect(bin_1_p, + newdata = dat_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.2)) + +# Dose function +bin_1_sum_dose <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015") + +bin_1_p_dose <- marginal_effect(bin_1_p, + newdata = dat_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015") + + +# Male Diadvantage +# Effect Estimation +bin_1_sum_gap <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "unemp_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.15)) + +bin_1_p_gap <- marginal_effect(bin_1_p, + newdata = dat_s, family = "logit", + main_var = "unemp_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.15)) + +# Dose Function +bin_1_sum_gap_dose <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "unemp_gendergap_2015") + +bin_1_p_gap_dose <- marginal_effect(bin_1_p, + newdata = dat_s, family = "logit", + main_var = "unemp_gendergap_2015") + +# ##################### +# Plot Effects (Figure 1) +# ##################### +point <- c(bin_1_sum_effect$out_main[2], bin_1_p_effect$out_main[2]) +high <- c(bin_1_sum_effect$out_main[3], bin_1_p_effect$out_main[3]) +low <- c(bin_1_sum_effect$out_main[1], bin_1_p_effect$out_main[1]) + +## Short Panel +marginal_list <- list() +marginal_list[[1]] <- bin_1_sum_dose +marginal_list[[2]] <- bin_1_p_dose + +title_c <- c("Predicted Probability: Sum", "Predicted Probability: Annual") + +# Plot Dose function + +pdf("figure_1.pdf", height = 4, width = 11) +par(mfrow = c(1,3), mar = c(4.5, 2, 4, 1), oma = c(0, 2, 0, 0)) +for(i in 1:2){ + plot_coef_all <- do.call("rbind", marginal_list[[i]]$out_main) + plot_x <- marginal_list[[i]]$treat_range + if(i == 1){ + ylim_u <- c(0.14, 0.23) + ylab_u <- "" + } + if(i == 2){ + ylim_u <- c(0.06, 0.11) + ylab_u <- "" + } + + plot(plot_x, plot_coef_all[ ,2], pch = 19, + main = paste("", title_c[i], sep = ""), + ylim = ylim_u, + xlab = "Excess Males", + ylab = ylab_u, + col = "black", cex = 2, type = "l", lwd = 3, cex.lab = 1.5, cex.main = 1.5, cex.axis = 1.5) + lines(plot_x, plot_coef_all[ ,1], col = "black", lty = 2) + lines(plot_x, plot_coef_all[ ,3], col = "black", lty = 2) + abline(h = marginal_list[[i]]$sample, lty = 2, col = "red", lwd = 2) + polygon(c(plot_x, rev(plot_x)), c(plot_coef_all[ ,1], rev(plot_coef_all[ ,3])), + col = adjustcolor("black", 0.2), border = NA) + par(new=TRUE) + hist(dat_2015_s$pop_15_44_muni_gendergap_2015, freq = FALSE, + breaks = seq(from = 0, to = 6, by = 0.01), xlim = c(min(plot_x), max(plot_x)), + xaxt = "n", yaxt = "n", xlab = "", ylab = "", ylim = c(0, 40), main ="") +} +par(mar = c(4.5, 5, 4, 1)) +plot(seq(1:2), point, ylim = c(-0.005, 0.045), + ylab = "Effects on Prob (hate crime)", + main = "Effects of Excess Males", + xlim = c(0.5, 2.5), xlab = "Outcome Types", xaxt = "n", pch = c(19, 15), + cex.lab = 1.5, cex.axis = 1.5, cex.main = 1.5) +segments(seq(1:6), low, seq(1:6), high, lwd = 2, c(rep("black",2), rep("black",2), rep("black",2))) +Axis(side = 1, at = c(1, 2), labels = c("Sum", "Annual"), cex.axis = 1.5) +abline(h = 0, lty = 2) +mtext(side = 2, at = 0.5, "Prob (hate crime)", outer = TRUE, line = 0.5) +dev.off() + +# ######################## +# Figure C.8 in Appendix +# ######################## + +# Plot Effects +point_g <- c(bin_1_sum_gap$out_main[2], bin_1_p_gap$out_main[2]) +high_g <- c(bin_1_sum_gap$out_main[3], bin_1_p_gap$out_main[3]) +low_g <- c(bin_1_sum_gap$out_main[1], bin_1_p_gap$out_main[1]) + +## Short Panel +marginal_list_g <- list() +marginal_list_g[[1]] <- bin_1_sum_gap_dose +marginal_list_g[[2]] <- bin_1_p_gap_dose + +title_c <- c("Predicted Probability: Sum", "Predicted Probability: Annual") + +# Plot Dose function + +pdf("figure_C8.pdf", height = 4, width = 11) +par(mfrow = c(1,3), mar = c(4.5, 2, 4, 1), oma = c(0, 2, 0, 0)) +for(i in 1:2){ + plot_coef_all <- do.call("rbind", marginal_list_g[[i]]$out_main) + plot_x <- marginal_list_g[[i]]$treat_range + if(i <=1) ylim_u <- c(0.14, 0.22) + if(i > 1) ylim_u <- c(0.06, 0.11) + + plot(plot_x, plot_coef_all[ ,2], pch = 19, + main = paste("", title_c[i], sep = ""), + ylim = ylim_u, + xlab = "Male Disadvantage", + ylab = "", + col = "black", cex = 2, type = "l", lwd = 3, cex.lab = 1.5, cex.axis = 1.5, cex.main = 1.5) + lines(plot_x, plot_coef_all[ ,1], col = "black", lty = 2) + lines(plot_x, plot_coef_all[ ,3], col = "black", lty = 2) + abline(h = marginal_list_g[[i]]$sample, lty = 2, col = "red", lwd = 2) + polygon(c(plot_x, rev(plot_x)), c(plot_coef_all[ ,1], rev(plot_coef_all[ ,3])), + col = adjustcolor("black", 0.2), border = NA) + par(new=TRUE) + hist(dat_2015_s$unemp_gendergap_2015, freq = FALSE, + breaks = seq(from = 0, to = 6, by = 0.01), xlim = c(min(plot_x), max(plot_x)), + xaxt = "n", yaxt = "n", xlab = "", ylab = "", ylim = c(0, 40), main ="") +} +par(mar = c(4.5, 5, 4, 1)) +plot(seq(1:2), point_g, ylim = c(-0.01, 0.035), + ylab = "Effects on Prob (hate crime)", + main = "Effects of Male Disadvantage", + xlim = c(0.5, 2.5), xlab = "Outcome Types", xaxt = "n", pch = c(19, 15), + cex.lab = 1.5, cex.axis = 1.5, cex.main = 1.5) +segments(seq(1:6), low_g, seq(1:6), high_g, lwd = 2, c(rep("black",2), rep("black",2), rep("black",2))) +Axis(side = 1, at = c(1, 2), labels = c("Sum", "Annual"), cex.axis = 1.25) +abline(h = 0, lty = 2) +mtext(side = 2, at = 0.5, "Prob (hate crime)", outer = TRUE, line = 0.5) +dev.off() \ No newline at end of file diff --git a/32/replication_package/Help.R b/32/replication_package/Help.R new file mode 100644 index 0000000000000000000000000000000000000000..52e5c5b0fa132a993c1e49c04d774edd17c17fdc --- /dev/null +++ b/32/replication_package/Help.R @@ -0,0 +1,177 @@ +# Help functions + +marginal_effect <- function(out, + newdata=NULL, + main_var, family = "logit", + treat_range, difference = FALSE, + seed=1234){ + + fit <- out$fit + # Coef and VCOV + coef_mar <- coef(out$fit)[is.na(coef(out$fit)) == FALSE] + vcov_mar <- out$vcov + + # Sample Mean of Outcomes + y_orig <- model.frame(formula(fit), data = newdata)[ ,1] + sample_mean_outcome <- mean(y_orig, na.rm = TRUE) + + # Prepare model.frame and treat_range + newdata_use_b <- model.frame(formula(fit), data = newdata) + if(missing(treat_range)){ + treat_range <- quantile(newdata_use_b[, main_var], + c(0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95), + na.rm = TRUE) + } + + # Create new_treat and new_control automatically + newdata_use_l <- list() + for(i in 1:length(treat_range)){ + newdata_use_l_b <- newdata_use_b + newdata_use_l_b[ , main_var] <- treat_range[i] + newdata_use_l_exp <- model.matrix(formula(fit), data = newdata_use_l_b) + newdata_use_l_exp <- newdata_use_l_exp[, names(coef_mar)] + newdata_use_l[[i]] <- newdata_use_l_exp + } + + set.seed(seed) + sim_coef <- mvrnorm(n = 1000, mu=coef_mar, Sigma=vcov_mar) + + # Linear Part + linear_out <- lapply(newdata_use_l, + FUN = function(x) as.matrix(sim_coef) %*% as.matrix(t(x))) + + + if(family %in% c("nb", "poisson")){ + out <- lapply(linear_out, FUN = function(x) apply(exp(x), 1, mean)) + }else if(family %in% c("ols")){ + out <- lapply(linear_out, FUN = function(x) apply(x, 1, mean)) + }else if(family %in% c("logit")){ + out <- lapply(linear_out, FUN = function(x) apply((exp(x)/(1 + exp(x))), 1, mean)) + }else{ + warning("family should be one of 'nb', 'poisson', 'logit', and 'ols'") + } + + if(difference == FALSE){ + out_main <- lapply(out, FUN = function(x) c(quantile(x, c(0.025)), mean(x), quantile(x, c(0.975)))) + names(out_main) <- treat_range + out_main_percent <- lapply(out, + FUN = function(x) + c(quantile(x, c(0.025)), mean(x), quantile(x, c(0.975)))/sample_mean_outcome) + names(out_main_percent) <- treat_range + }else if(difference == TRUE){ + out_b <- out[[2]] - out[[1]] + out_main <- c(quantile(out_b, c(0.025)), mean(out_b), quantile(out_b, c(0.975)), + quantile(out_b, c(0.05)), quantile(out_b, c(0.95))) + out_main_percent <- out_main/sample_mean_outcome + } + + output <- list("out" = out, + "out_main" = out_main, + "out_main_percent" = out_main_percent, + "sample_mean" = sample_mean_outcome, + "treat_range" = treat_range) +} + +bin.summary <- function(formula, print_var, id, data, digits = 3, type = "logit"){ + var <- all.vars(formula) + data_use <- model.frame( ~ ., data = data[, c(var, id)]) + + if(type == "logit") fit <- glm(formula, data = data_use, family = "binomial") + if(type == "probit") fit <- glm(formula, data = data_use, family = binomial(link="probit")) + tab_p <- coeftest(fit, vcov = vcovCL(fit, cluster = data_use[, id])) + + if(missing(print_var)) print_var <- seq(1:min(20, nrow(tab_p))) + + mat <- tab_p[print_var, ] + + sig <- rep("", length(mat[,4])) + sig[mat[ , 4] < 0.001] <- "***" + sig[mat[ , 4] >= 0.001 & mat[ , 4] < 0.01] <- "**" + sig[mat[ , 4] >= 0.01 & mat[ , 4] < 0.05] <- "*" + sig[mat[ , 4] >= 0.05 & mat[ , 4] < 0.1] <- "." + mat <- as.data.frame(mat) + mat <- round(mat, digits = digits) + mat$Sig <- sig + + sample_size <- length(fit$residuals) + + cat("Coefficients:\n") + print(mat[, c(1, 2, 4, 5)], row.names=TRUE) + cat(paste("(Sample Size:", sample_size, ")\n", sep = "")) + + output <- list("fit" = fit, "vcov" = vcovCL(fit, cluster = data_use[, id]), + "sample" = sample_size) + + return(output) +} + +lm.summary <- function(formula, print_var, id, data, digits = 3){ + var <- all.vars(formula) + data_use <- model.frame( ~ ., data = data[, c(var, id)]) + + fit <- lm(formula, data = data_use) + tab_p <- coeftest(fit, vcov = vcovCL(fit, cluster = data_use[, id])) + + if(missing(print_var)) print_var <- seq(1:min(20, nrow(tab_p))) + + mat <- tab_p[print_var, ] + + sig <- rep("", length(mat[,4])) + sig[mat[ , 4] < 0.001] <- "***" + sig[mat[ , 4] >= 0.001 & mat[ , 4] < 0.01] <- "**" + sig[mat[ , 4] >= 0.01 & mat[ , 4] < 0.05] <- "*" + sig[mat[ , 4] >= 0.05 & mat[ , 4] < 0.1] <- "." + mat <- as.data.frame(mat) + mat <- round(mat, digits = digits) + mat$Sig <- sig + + sample_size <- length(fit$residuals) + + cat("Coefficients:\n") + print(mat[, c(1, 2, 4, 5)], row.names=TRUE) + cat(paste("(Sample Size:", sample_size, ")\n", sep = "")) + + output <- list("fit" = fit, "vcov" = vcovCL(fit, cluster = data_use[, id]), + "sample" = sample_size) + + return(output) +} + + +glm.boot <- function(formula, data, family, cluster_id, boot = 1000, seed = 1234){ + + set.seed(seed) + data$cluster_id <- cluster_id + + data_u <- data[is.na(data$cluster_id) == FALSE, ] + coef_boot <- c() + for(b in 1:boot){ + boot_id <- sample(unique(data_u$cluster_id), size = length(unique(data_u$cluster_id)), replace=TRUE) + # create bootstap sample with sapply + boot_which <- sapply(boot_id, function(x) which(data_u$cluster_id == x)) + data_boot <- data_u[unlist(boot_which),] + if(family == "poisson"){ + glm_boot <- glm(formula, family = "poisson", data = data_boot) + coef_boot <- cbind(coef_boot, summary(glm_boot)$coef[,1]) + }else if(family == "negative-binomial"){ + glm_nb_boot <- glm.nb(formula, data = data_boot) + coef_boot <- cbind(coef_boot, summary(glm_nb_boot)$coef[,1]) + } + if((b%%100) == 0) cat(paste(b, "...")) + } + if(family == "poisson"){ + glm_boot_final <- glm(formula, family = "poisson", data = data) + }else if(family == "negative-binomial"){ + glm_boot_final <- glm.nb(formula, data = data) + } + se <- apply(coef_boot, 1, sd) # bootstrap SE + coef <- glm_boot_final$coefficients + + output <- list("fit" = glm_boot_final, "coef" = coef, "se" = se) + + return(output) +} + +star_out <- function(out, name){ + writeLines(capture.output(out), name) +} diff --git a/32/replication_package/SurveyAnalysis_Appendix.R b/32/replication_package/SurveyAnalysis_Appendix.R new file mode 100644 index 0000000000000000000000000000000000000000..48216fe8c5eb162caf1dc030400a88b899ebe8d5 --- /dev/null +++ b/32/replication_package/SurveyAnalysis_Appendix.R @@ -0,0 +1,810 @@ +# Replication File for Appendix: Survey Analysis +# Appendix D2 Figure D2: Replicate Figure 3 with only among anti-refugees +# Appendix D3 Figure D3: Variables Predicting Mate Competition vs. Other Views About Refugees +# Appendix D4 Figures D.4.1 and D.4.2: Replicate Figure 4 with wave 1 +# Appendix D5 Table D.5: Table representation of Figure 5 +# Appendix D6 Table D.6.1, Figure.6.2, Table.D.6.3, Table.D.6.4 +# Appendix D8 Table D.8.1: Robustness Check with YouGov Survey Data + +# R version 4.0.2 (2020-06-22) + +# ################## +# Data Preparation +# ################## +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("stargazer") # stargazer_5.2.2 +# install.packages("foreign") # foreign_0.8-80 +# install.packages("list") # list_9.2 + + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(stargazer) # stargazer_5.2.2 +require(foreign) # foreign_0.8-80 +require(list) # list_9.2 +source("Help.R") + +dat <- read.dta13(file = "survey.dta") + +# Subset to people who pass the check +dat_use <- dat[dat$wave == 4, ] + +## ############################### +## 1: Appendix D2 Figure D2 +## ############################### +# Replicate only among anti-refugee +quantile(dat_use$refugee_ind, probs = 0.75) + +dat_use_r <- dat_use[dat_use$refugee_ind > 0.875, ] +dat_use_r$MateComp.cont_bin <- ifelse(dat_use_r$MateComp.cont >= 3, 1, 0) +dat_use_r$excess_c <- ifelse(dat_use_r$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_use_r$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +dat_male_r <- dat_use_r[dat_use_r$gender == "Male" & dat_use_r$age <= 44 & dat_use_r$age >= 18, ] +dat_male_y_r <- dat_use_r[dat_use_r$gender == "Male" & dat_use_r$age <= 40 & dat_use_r$age >= 30, ] + +mean_all_r <- tapply(dat_use_r$MateComp.cont_bin, dat_use_r$excess_c, mean) +se_all_r <- tapply(dat_use_r$MateComp.cont_bin, dat_use_r$excess_c, sd)/sqrt(table(dat_use_r$excess_c)) + +mean_all_m_r <- tapply(dat_male_r$MateComp.cont_bin, dat_male_r$excess_c, mean) +se_all_m_r <- tapply(dat_male_r$MateComp.cont_bin, dat_male_r$excess_c, sd)/sqrt(table(dat_male_r$excess_c)) + +mean_all_y_r <- tapply(dat_male_y_r$MateComp.cont_bin, dat_male_y_r$excess_c, mean) +se_all_y_r <- tapply(dat_male_y_r$MateComp.cont_bin, dat_male_y_r$excess_c, sd)/sqrt(table(dat_male_y_r$excess_c)) + +pdf("figure_D2.pdf", height= 6, width = 17.5) +par(mfrow = c(1, 3), mar = c(2,2,3,2), oma = c(4,4,0,0)) +plot(seq(1:3), mean_all_r, pch = 19, ylim = c(0, 1), + xlim = c(0.5, 3.5), + main = "All", xaxt = "n", xlab = "", ylab = "", cex.axis = 2.25, cex.main = 2.5, + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all_r - 1.96*se_all_r, + seq(1:3), mean_all_r + 1.96*se_all_r, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) + +plot(seq(1:3), mean_all_m_r, pch = 19, ylim = c(0, 1), + xlim = c(0.5, 3.5), + main = "Male (18-44)", xaxt = "n", xlab = "", ylab = "", cex.axis = 2.25, cex.main = 2.5, + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all_m_r - 1.96*se_all_m_r, + seq(1:3), mean_all_m_r + 1.96*se_all_m_r, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) + +plot(seq(1:3), mean_all_y_r, pch = 19, ylim = c(0, 1), + xlim = c(0.5, 3.5), + main = "Male (30 - 40)", xaxt = "n", xlab = "", ylab = "", cex.axis = 2.25, cex.main = 2.5, + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all_y_r - 1.96*se_all_y_r, + seq(1:3), mean_all_y_r + 1.96*se_all_y_r, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) +mtext("Proportion Perceiving Mate Competition", side = 2, outer = TRUE, at = 0.5, + cex = 1.5, line = 1.75) +mtext("Excess Males", side = 1, outer = TRUE, at = 0.175, + cex = 1.5, line = 1.75) +mtext("Excess Males", side = 1, outer = TRUE, at = 0.5, + cex = 1.5, line = 1.75) +mtext("Excess Males", side = 1, outer = TRUE, at = 0.825, + cex = 1.5, line = 1.75) +dev.off() + + +## ############################### +## 2: Appendix D3 Figure D3 +## ############################### +# Coefficients of Male x Single on Refugee Variables + +rm(list=ls()) +dat <- read.dta13(file = "survey.dta") +dat_use <- dat[dat$wave == 4, ] +source("Help.R") +dat_use$male <- as.numeric(dat_use$gender == "Male") + +# outcomes we want to analyze +outcome_ref <- c("MateComp.cont", "JobComp.cont", "ref_integrating", + "ref_citizenship","ref_reduce","ref_moredone", "ref_cultgiveup", + "ref_economy", "ref_crime", "ref_terror", "ref_loc_services", + "ref_loc_economy", "ref_loc_crime", "ref_loc_culture", + "ref_loc_islam", "ref_loc_schools", "ref_loc_housing", "ref_loc_wayoflife") + +outcome_ref_name <- c("Mate competition", "Job competition", "Integration", + "Citizenship for refugees","Number of refugees","More for refugees", + "Culture", + "Economy", "Crime", "Terrorism", "Local social services", + "Local economy", "Local crime", "Local culture", + "Islam", "Local school", "Housing", "Living") + +# Fit Ordered Logit +lm_l <- list() +lm_out <- list() +male_mat <- sing_mat <- int_mat <- matrix(NA, nrow = 18, ncol = 2) +for(i in 1:18){ + control <- paste(outcome_ref[-i], collapse = "+") + for_i <- paste("as.factor(", outcome_ref[i],")", "~ male*singdivsep + ", control, sep = "") + lm_l[[i]] <- polr(for_i, data = dat_use, Hess = TRUE) + lm_out[[i]] <- summary(lm_l[[i]])$coef + male_mat[i, 1:2] <- summary(lm_l[[i]])$coef["male", 1:2] + sing_mat[i, 1:2] <- summary(lm_l[[i]])$coef["singdivsep", 1:2] + int_mat[i, 1:2] <- summary(lm_l[[i]])$coef["male:singdivsep", 1:2] +} +rownames(int_mat) <- outcome_ref + +# Fit linear regression +lm2_l <- list() +lm2_out <- list() +male_mat2 <- sing_mat2 <- int_mat2 <- matrix(NA, nrow = 18, ncol = 2) +for(i in 1:18){ + control <- paste(outcome_ref[-i], collapse = "+") + for_i <- paste(outcome_ref[i], "~ male*singdivsep + ", control, sep = "") + lm2_l[[i]] <- lm(for_i, data = dat_use) + lm2_out[[i]] <- summary(lm2_l[[i]])$coef + male_mat2[i, 1:2] <- summary(lm2_l[[i]])$coef["male", 1:2] + sing_mat2[i, 1:2] <- summary(lm2_l[[i]])$coef["singdivsep", 1:2] + int_mat2[i, 1:2] <- summary(lm2_l[[i]])$coef["male:singdivsep", 1:2] +} +rownames(int_mat2) <- outcome_ref + + +# Show Coefficients for Male x Single Interaction (after controlling for other refugee variables) +# Both Ordered Logit and Linear regression +col_p <- rev(c("red", rep("black", 17))) + +pdf("figure_D3_1.pdf", height = 6, width = 8) +par(mfrow = c(1, 2), mar = c(4, 2, 4, 1), oma = c(1, 10, 2, 2)) +plot(rev(int_mat[,1]), seq(1:18), pch = 19, xlim = c(-0.6, 1.0), ylim = c(1, 18), + xlab = "Coefficients", ylab = "", yaxt = "n", + main = "Ordered logit", col = col_p) +segments(rev(int_mat[,1]) - 1.96*rev(int_mat[,2]), seq(1:18), + rev(int_mat[,1]) + 1.96*rev(int_mat[,2]), seq(1:18), col = col_p) +abline(v = 0, lty = 2) + +plot(rev(int_mat2[,1]), seq(1:18), pch = 19, xlim = c(-0.3, 0.3), ylim = c(1, 18), + xlab = "Coefficients", ylab = "", yaxt = "n", + main = "Linear regression", col = col_p) +segments(rev(int_mat2[,1]) - 1.96*rev(int_mat2[,2]), seq(1:18), + rev(int_mat2[,1]) + 1.96*rev(int_mat2[,2]), seq(1:18), col = col_p) +abline(v = 0, lty = 2) + +Axis(side = 2, at = seq(1:18), labels = rev(outcome_ref_name), las = 1, tick = 0, + outer = TRUE, hadj = 0, line = 7.5) +mtext(side = 3, at = 0.5, text = "Coefficients of Male x Single", cex = 1.5, font = 2, outer = TRUE) +dev.off() + +# ###################################### +# Coefficients of Women's Role on Mate Competition +# ###################################### +# Ordered Logit +lm_l <- list() +lm_out <- list() +role_mat <- matrix(NA, nrow = 18, ncol = 2) +for(i in 1:18){ + control <- paste(outcome_ref[-i], collapse = "+") + for_i <- paste("as.factor(", outcome_ref[i], ")", "~ women_role + ", control, sep = "") + lm_l[[i]] <- polr(for_i, data = dat_use, Hess = TRUE) + lm_out[[i]] <- summary(lm_l[[i]])$coef + role_mat[i, 1:2] <- summary(lm_l[[i]])$coef["women_role", 1:2] +} +rownames(role_mat) <- outcome_ref + +# OLS +lm_l2 <- list() +lm_out2 <- list() +role_mat2 <- matrix(NA, nrow = 18, ncol = 2) +for(i in 1:18){ + control <- paste(outcome_ref[-i], collapse = "+") + for_i <- paste(outcome_ref[i], "~ women_role + ", control, sep = "") + lm_l2[[i]] <- lm(for_i, data = dat_use) + lm_out2[[i]] <- summary(lm_l2[[i]])$coef + role_mat2[i, 1:2] <- summary(lm_l2[[i]])$coef["women_role", 1:2] +} +rownames(role_mat2) <- outcome_ref + +pdf("figure_D3_2.pdf", height = 6, width = 8) +par(mfrow = c(1, 2), mar = c(4, 2, 4, 1), oma = c(1, 10, 2, 2)) + +plot(rev(role_mat[,1]), seq(1:18), pch = 19, xlim = c(-0.3, 0.6), ylim = c(1, 18), + xlab = "Coefficients", ylab = "", yaxt = "n", + main = "Ordered logit", col = col_p) +segments(rev(role_mat[,1]) - 1.96*rev(role_mat[,2]), seq(1:18), + rev(role_mat[,1]) + 1.96*rev(role_mat[,2]), seq(1:18), col = col_p) +abline(v = 0, lty = 2) + +plot(rev(role_mat2[,1]), seq(1:18), pch = 19, xlim = c(-0.1, 0.15), ylim = c(1, 18), + xlab = "Coefficients", ylab = "", yaxt = "n", + main = "Linear regression", col = col_p) +segments(rev(role_mat2[,1]) - 1.96*rev(role_mat2[,2]), seq(1:18), + rev(role_mat2[,1]) + 1.96*rev(role_mat2[,2]), seq(1:18), col = col_p) +abline(v = 0, lty = 2) + +Axis(side = 2, at = seq(1:18), labels = rev(outcome_ref_name), las = 1, tick = 0, + outer = TRUE, hadj = 0, line = 7.5) + +mtext(side = 3, at = 0.5, text = "Coefficients of Women's Role", + cex = 1.5, font = 2, outer = TRUE) +dev.off() + + +## ################################### +## Appendix D4: Figure D.4.1 & D.4.2 +## ################################### +# Replicate Figure 3 with Wave 1 +data.u1 <- dat[dat$wave == 1, ] + +data.u1$List.treat <- ifelse(data.u1$treatment_list == "Scenario 2", 1, 0) + +# Difference-in-Means (0.12618) +# Message (hate_pol_message): +# Attacks against refugee homes are sometimes necessary to make it clear to politicians that we have a refugee problem +diff.in.means.results <- ictreg(outcome_list ~ 1, data = data.u1, + treat = "List.treat", J = 3, method = "lm") +summary(diff.in.means.results) + +data.u1$means_bin <- ifelse(data.u1$hate_violence_means >= 3, 1, 0) +data.u1$condemn_bin <- ifelse(data.u1$hate_polcondemn >= 3, 1, 0) +data.u1$justified_bin <- ifelse(data.u1$hate_justified >= 3, 1, 0) + +only.mean <- mean(data.u1$means_bin) +condemn.mean <- mean(data.u1$condemn_bin) +justified.mean <- mean(data.u1$justified_bin) + +only.se <- sd(data.u1$means_bin)/sqrt(length(data.u1$means_bin)) +condemn.se <- sd(data.u1$condemn_bin)/sqrt(length(data.u1$condemn_bin)) +justified.se <- sd(data.u1$justified_bin)/sqrt(length(data.u1$justified_bin)) + +# plot different questions within the same wave +point <- c(summary(diff.in.means.results)$par.treat, only.mean, condemn.mean, justified.mean) +se_p <- c(summary(diff.in.means.results)$se.treat, only.se, condemn.se, justified.se) +base <- barplot(point, ylim = c(0, 0.20)) +bar_name_u <- c("Message (List)", "Only Means", "Condemn", "Justified") +bar_name <- rep("",4) + +# Figure D.4.1 +pdf("figure_D4_1.pdf", height = 4.5, width = 8) +par(mar = c(4, 5, 2, 1)) +barplot(point, ylim = c(0, 0.3), names.arg = bar_name, + col = c(adjustcolor("red", 0.4), "gray", "gray", "gray"), cex.axis = 1.3) +arrows(base[,1], point - 1.96*se_p, base[,1], point + 1.96*se_p, + lwd = 3, angle = 90, length = 0.05, code = 3, + col = c("red", "black", "black", "black")) +mtext(bar_name_u[1], outer = FALSE, side = 1, at = base[1], cex = 1.2, line = 2.4) +mtext(bar_name_u[2], outer = FALSE, side = 1, at = base[2], cex = 1.2, line = 2.4) +mtext(bar_name_u[3], outer = FALSE, side = 1, at = base[3], cex = 1.2, line = 2.4) +mtext(bar_name_u[4], outer = FALSE, side = 1, at = base[4], cex = 1.2, line = 2.4) +text(x = base[1], y = 0.28, "Estimate from \nList Experiment", col = "red", font = 2) +text(x = base[3], y = 0.28, "Direct Questions", font = 2) +dev.off() + +## "Message" across Waves +data.u1 <- dat[dat$wave == 1, ] +data.u2 <- dat[dat$wave == 2, ] +data.u3 <- dat[dat$wave == 3, ] +data.u4 <- dat[dat$wave == 4, ] +dat_all <- rbind(data.u1, data.u2, data.u3, data.u4) + +dat_all$hate_pol_message_bin <- ifelse(dat_all$hate_pol_message >=3, 1, 0) +message_direct <- tapply(dat_all$hate_pol_message_bin, dat_all$wave, mean, na.rm = TRUE)[c(2,3,4)] +message_direct_num <- tapply(dat_all$hate_pol_message_bin, dat_all$wave, function(x) sum(is.na(x)==FALSE))[c(2,3,4)] +message_direct_se <- tapply(dat_all$hate_pol_message_bin, dat_all$wave, sd, na.rm = TRUE)[c(2,3,4)]/sqrt(message_direct_num) + +# plot The same question over time +point <- c(summary(diff.in.means.results)$par.treat, message_direct) +se_p <- c(summary(diff.in.means.results)$se.treat, message_direct_se) +base <- barplot(point, ylim = c(0, 0.20)) +bar_name_u <- c("Message \n(List)", "Message \n(Direct, Wave 2)", + "Message \n(Direct, Wave 3)", "Message \n(Direct, Wave 4)") +bar_name <- rep("",4) + +# Figure D.4.2 +pdf("figure_D4_2.pdf", height = 4.5, width = 8) +par(mar = c(4, 5, 2, 1)) +barplot(point, ylim = c(0, 0.25), names.arg = bar_name, + col = c(adjustcolor("red", 0.4), "gray", "gray", "gray"), cex.axis = 1.3, + ylab = "Proportion of respondents", cex.lab = 1.45) +arrows(base[,1], point - 1.96*se_p, base[,1], point + 1.96*se_p, + lwd = 3, angle = 90, length = 0.05, code = 3, + col = c("red", "black", "black", "black")) +mtext(bar_name_u[1], outer = FALSE, side = 1, at = base[1], cex = 1.2, line = 2.4) +mtext(bar_name_u[2], outer = FALSE, side = 1, at = base[2], cex = 1.2, line = 2.4) +mtext(bar_name_u[3], outer = FALSE, side = 1, at = base[3], cex = 1.2, line = 2.4) +mtext(bar_name_u[4], outer = FALSE, side = 1, at = base[4], cex = 1.2, line = 2.4) +text(x = base[1], y = 0.225, "Estimate from \nList Experiment", col = "red", font = 2) +text(x = base[3], y = 0.225, "Direct Questions", font = 2) +dev.off() + + +# ############################# +# Appendix D5 Table D5 +# ############################# +formula.5 <- + as.character("hate_violence_means ~ MateComp.cont + JobComp.cont + + LifeSatis.cont + factor(age_group) + factor(gender) + + factor(state) + factor(citizenship) + factor(marital) + + factor(religion) + eduyrs + factor(occupation) + + factor(income) + factor(household_size) + factor(self_econ) + + factor(ref_integrating) + factor(ref_citizenship) + factor(ref_reduce) + + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + factor(ref_loc_economy) + factor(ref_loc_crime) + + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife)") + +formula.6 <- paste(formula.5, "factor(distance_ref) + factor(settle_ref)", + "lrscale + afd + muslim_ind + afd_ind + contact_ind", + sep="+", collapse="+") + +# with Difference Outcomes +# hate_pol_message : "82. Support for Hate Crime_Attacks against refugee homes are somet" +# hate_prevent_settlement : "82. Support for Hate Crime_Racist violence is defensible if it lea" +# hate_polcondemn : "82. Support for Hate Crime_Politicians should condemn attacks agai" +# hate_justified: "82. Support for Hate Crime_Hostility against foreigners is sometimes justified" + +formula.7.means <- paste("hate_violence_means ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.message <- paste("hate_pol_message ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.prevent <- paste("hate_prevent_settlement ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.condemn <- paste("hate_polcondemn ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.justified <- paste("hate_justified ~ ", as.character(as.formula(formula.6))[3], sep = "") + +# output +lm7.means <- lm(as.formula(formula.7.means), data=dat_use) +lm7.justified <- lm(as.formula(formula.7.justified), data=dat_use) +lm7.message <- lm(as.formula(formula.7.message), data=dat_use) +lm7.prevent <- lm(as.formula(formula.7.prevent), data=dat_use) +lm7.condemn <- lm(as.formula(formula.7.condemn), data=dat_use) + +## Table D.5 (in Appendix D.5) +lm.list_d <- list(lm7.means, lm7.justified, lm7.message, lm7.prevent, lm7.condemn) +star_out(stargazer(lm.list_d, + covariate.labels = c("Mate Competition","Job Competition","Life Satisfaction"), + keep=c("MateComp.cont","JobComp.cont","LifeSatis.cont")), + name = "table_D5_1.tex") + +## ################################## +## Table D.5.2 (appendix) with East/West +## ################################## +rm(list=ls()) +# Set the directly appropriately + +dat <- read.dta13(file = "survey.dta") +source("Help.R") + +# Subset to wave 4 +dat_use <- dat[dat$wave == 4, ] +{ + dat_use$west <- 1 - dat_use$east + + # remove state + formula.5_int <- + as.character("hate_violence_means ~ MateComp.cont*west + JobComp.cont + + LifeSatis.cont + factor(age_group) + factor(gender) + + factor(citizenship) + factor(marital) + + factor(religion) + eduyrs + factor(occupation) + + factor(income) + factor(household_size) + factor(self_econ) + + factor(ref_integrating) + factor(ref_citizenship) + factor(ref_reduce) + + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + factor(ref_loc_economy) + factor(ref_loc_crime) + + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife)") + + formula.6_int <- paste(formula.5_int, "factor(distance_ref) + factor(settle_ref)", + "lrscale + afd + muslim_ind + afd_ind + contact_ind", + sep="+", collapse="+") + + ## Interaction with East/West + # with Difference Outcomes + # hate_pol_message: "82. Support for Hate Crime_Attacks against refugee homes are somet" + # hate_prevent_settlement: "82. Support for Hate Crime_Racist violence is defensible if it lea" + # hate_polcondemn: "82. Support for Hate Crime_Politicians should condemn attacks agai" + # hate_justified: "82. Support for Hate Crime_Hostility against foreigners is sometimes justified" + + formula.7_int.means <- paste("hate_violence_means ~ ", + as.character(as.formula(formula.6_int))[3], sep = "") + formula.7_int.message <- paste("hate_pol_message ~", + as.character(as.formula(formula.6_int))[3], sep = "") + formula.7_int.prevent <- paste("hate_prevent_settlement ~", + as.character(as.formula(formula.6_int))[3], sep = "") + formula.7_int.condemn <- paste("hate_polcondemn ~ ", + as.character(as.formula(formula.6_int))[3], sep = "") + formula.7_int.justified <- paste("hate_justified ~ ", + as.character(as.formula(formula.6_int))[3], sep = "") + + # output + lm7_int.means <- lm(as.formula(formula.7_int.means), data = dat_use) + lm7_int.justified <- lm(as.formula(formula.7_int.justified), data=dat_use) + lm7_int.message <- lm(as.formula(formula.7_int.message), data=dat_use) + lm7_int.prevent <- lm(as.formula(formula.7_int.prevent), data=dat_use) + lm7_int.condemn <- lm(as.formula(formula.7_int.condemn), data=dat_use) + + ## Table D.5.2 (in Appendix D.5) + lm.list_int <- list(lm7_int.means, lm7_int.justified, lm7_int.message, lm7_int.prevent, lm7_int.condemn) + star_out(stargazer(lm.list_int, + covariate.labels = c("Mate Competition", + "West", + "Job Competition","Life Satisfaction", + "Mate Competition x West"), + keep=c("MateComp.cont", "west", + "JobComp.cont","LifeSatis.cont", + "MateComp.cont:west")), + name = "table_D5_2.tex") +} + +# ########################################## +# Appendix D6: Replcate Results with Men +# ########################################## +rm(list=ls()) +# Set the directly appropriately + +dat <- read.dta13(file = "survey.dta") +source("Help.R") + +# Subset to wave 4 +dat_use <- dat[dat$wave == 4, ] +dat_male <- dat_use[dat_use$gender == "Male",] +dat_female <- dat_use[dat_use$gender == "Female",] + +# ########################################## +# Table D.6.1: Replicate Main Models +# ########################################## +{ + + lm1 <- lm(hate_violence_means ~ MateComp.cont, data=dat_male) + + lm2 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont, data=dat_male) + + lm3 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ), # subjective social status + data=dat_male) + + lm4 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ) + # subjective social status + factor(ref_integrating) + # Refugee Index (National-level; Q73) 8 in total + factor(ref_citizenship) + factor(ref_reduce) + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror), + data=dat_male) + + lm5 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ) + # subjective social status + factor(ref_integrating) + # Refugee Index (National-level; Q73) 8 in total + factor(ref_citizenship) + factor(ref_reduce) + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + # Refugee Index (Local, Q75) + factor(ref_loc_economy) + factor(ref_loc_crime) + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife), ## end + data=dat_male) + + + # Add More Variables + # lrscale Q21 Left-Right Scale + # afd, Q23 Closeness to AfD + # muslim_ind, afd_ind, contact_ind + # distance_ref Q71. Distance to refugee reception centers + # settle_ref Q72. Settlement of refugees living in area + + formula.5 <- + as.character("hate_violence_means ~ MateComp.cont + JobComp.cont + + LifeSatis.cont + factor(age_group) + + factor(state) + factor(citizenship) + factor(marital) + + factor(religion) + eduyrs + factor(occupation) + + factor(income) + factor(household_size) + factor(self_econ) + + factor(ref_integrating) + factor(ref_citizenship) + factor(ref_reduce) + + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + factor(ref_loc_economy) + factor(ref_loc_crime) + + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife)") + + formula.6 <- paste(formula.5, "factor(distance_ref) + factor(settle_ref)", + "lrscale + afd + muslim_ind + afd_ind + contact_ind", + sep="+", collapse="+") + + lm6 <- lm(as.formula(formula.6), data=dat_male) +} +lm.list.table1 <- list(lm1, lm2, lm3, lm4, lm5, lm6) + +# Table D.6.1 +star_out(stargazer(lm.list.table1, + covariate.labels = c("Mate Competition","Job Competition","Life Satisfaction"), + keep=c("MateComp.cont","JobComp.cont","LifeSatis.cont")), + name = "table_D6_1.tex") + +## ############################################### +## Figure D.6.2: Replicating Figure 4 (with Male) +## ############################################### +# with Difference Outcomes +# hate_pol_message: "82. Support for Hate Crime_Attacks against refugee homes are somet" +# hate_prevent_settlement: "82. Support for Hate Crime_Racist violence is defensible if it lea" +# hate_polcondemn: "82. Support for Hate Crime_Politicians should condemn attacks agai" +# hate_justified: "82. Support for Hate Crime_Hostility against foreigners is sometimes justified" + +# without gender +formula.5 <- + as.character("hate_violence_means ~ MateComp.cont + JobComp.cont + + LifeSatis.cont + factor(age_group) + + factor(state) + factor(citizenship) + factor(marital) + + factor(religion) + eduyrs + factor(occupation) + + factor(income) + factor(household_size) + factor(self_econ) + + factor(ref_integrating) + factor(ref_citizenship) + factor(ref_reduce) + + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + factor(ref_loc_economy) + factor(ref_loc_crime) + + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife)") + +formula.6 <- paste(formula.5, "factor(distance_ref) + factor(settle_ref)", + "lrscale + afd + muslim_ind + afd_ind + contact_ind", + sep="+", collapse="+") + +formula.7.means <- paste("hate_violence_means ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.message <- paste("hate_pol_message ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.prevent <- paste("hate_prevent_settlement ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.condemn <- paste("hate_polcondemn ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.justified <- paste("hate_justified ~ ", as.character(as.formula(formula.6))[3], sep = "") + +# output +lm7.means <- lm(as.formula(formula.7.means), data=dat_male) +lm7.justified <- lm(as.formula(formula.7.justified), data=dat_male) +lm7.message <- lm(as.formula(formula.7.message), data=dat_male) +lm7.prevent <- lm(as.formula(formula.7.prevent), data=dat_male) +lm7.condemn <- lm(as.formula(formula.7.condemn), data=dat_male) + +point <- c(coef(lm7.means)["MateComp.cont"], + coef(lm7.justified)["MateComp.cont"], coef(lm7.message)["MateComp.cont"], + coef(lm7.prevent)["MateComp.cont"], coef(lm7.condemn)["MateComp.cont"]) + +se <- c(summary(lm7.means)$coef["MateComp.cont", 2], + summary(lm7.justified)$coef["MateComp.cont", 2], summary(lm7.message)$coef["MateComp.cont", 2], + summary(lm7.prevent)$coef["MateComp.cont", 2], summary(lm7.condemn)$coef["MateComp.cont", 2]) + + +pdf("figure_D6_2.pdf", height = 4, width = 8) +par(mar = c(2,4,4,1)) +plot(seq(1:5), point, pch = 19, ylim = c(-0.05, 0.25), xlim = c(0.5, 5.5), + xlab = "", xaxt = "n", ylab = "Estimated Effects", + main = "Estimated Effects of Mate Competition (among male)", cex.lab = 1.25, cex.axis = 1.25, cex.main = 1.5) +segments(seq(1:5), point - 1.96*se, + seq(1:5), point + 1.96*se, lwd = 2) +Axis(side=1, at = seq(1:5), labels = c("Only Means", "Justified", "Message", + "Prevent", "Condemn"), cex.axis = 1.25) +abline(h =0, lty = 2) +dev.off() + +## Table D.6.3 +lm.list_d_m <- list(lm7.means, lm7.justified, lm7.message, lm7.prevent, lm7.condemn) +star_out(stargazer(lm.list_d_m, + covariate.labels = c("Mate Competition","Job Competition","Life Satisfaction"), + keep=c("MateComp.cont","JobComp.cont","LifeSatis.cont")), + name = "table_D6_3.tex") + +# ########################################## +# Appendix D8, Table D8: YouGov analysis +# ########################################## +rm(list=ls()) +you_data <- read.dta13(file = "YouGov.dta") +source("Help.R") + +## (1) Main Regression +lm1 <- lm(hate_cont ~ mate_compete + + age + # age + gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright, # leftright scale + data = you_data) +summary(lm1) + +## (2) + Aggression Score +lm2 <- lm(hate_cont ~ + mate_compete + + age + # age + gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean, # aggression score + data = you_data) +summary(lm2) + +## (3) + Refugee Index +lm3 <- lm(hate_cont ~ + mate_compete + + age + # age + gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife, + data = you_data) +summary(lm3) + +## (4) + Refugee Contact +lm4 <- lm(hate_cont ~ + mate_compete + + age + # age + gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife + + see_ref_road + see_ref_store + see_ref_center + ## Refugee Contact (5 Questions) + see_ref_school + see_ref_work, + data = you_data) +summary(lm4) + +## (5) + AfD Score +lm5 <- lm(hate_cont ~ + mate_compete + + age + # age + gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife + + see_ref_road + see_ref_store + see_ref_center + ## Refugee Contact (5 Questions) + see_ref_school + see_ref_work + + afd.score, # Closeness to AfD + data = you_data) +summary(lm5) + +star_out(stargazer(list(lm1, lm2, lm3, lm4, lm5), + covariate.labels = c("Mate Competition", "Aggressiveness"), keep=c("mate_compete", "angry_mean")), + name = "table_D8_1.tex") + + +rm(list=ls()) +you_data <- read.dta13(file = "YouGov.dta") +you_male <- you_data[you_data$gender == levels(you_data$gender)[1], ] +source("Help.R") + +{ + ## (1) Main Regression + lm1 <- lm(hate_cont ~ mate_compete + + age + # age + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright, # leftright scale + data = you_male) + + ## (2) + Aggression Score + lm2 <- lm(hate_cont ~ + mate_compete + + age + # age + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean, # aggression score + data = you_male) + + ## (3) + Refugee Index + lm3 <- lm(hate_cont ~ + mate_compete + + age + # age + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife, + data = you_male) + summary(lm3) + + ## (4) + Refugee Contact + lm4 <- lm(hate_cont ~ + mate_compete + + age + # age + # gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife + + see_ref_road + see_ref_store + see_ref_center + ## Refugee Contact (5 Questions) + see_ref_school + see_ref_work, + data = you_male) + summary(lm4) + + ## (5) + AfD Score + lm5 <- lm(hate_cont ~ + mate_compete + + age + # age + # gender + # gender + factor(sta) + #state + factor(mstat) + # Marital Status + reli + # religion + educ_aggr_rec + # education + hinc + # income + housz + # household size + pol_leftright + # leftright scale + angry_mean + # aggression score + ref_loc_services + ref_loc_economy + ref_loc_crime + ## Refugee Questions (9 Questions) + ref_loc_culture + ref_loc_islam + ref_local_job + + ref_loc_schools + ref_loc_housing + ref_loc_wayoflife + + see_ref_road + see_ref_store + see_ref_center + ## Refugee Contact (5 Questions) + see_ref_school + see_ref_work + + afd.score, # Closeness to AfD + data = you_male) + summary(lm5) +} + +star_out(stargazer(list(lm1, lm2, lm3, lm4, lm5), + covariate.labels = c("Mate Competition", "Aggressiveness"), + keep=c("mate_compete", "angry_mean")), + name = "table_D8_2.tex") diff --git a/32/replication_package/SurveyAnalysis_Main.R b/32/replication_package/SurveyAnalysis_Main.R new file mode 100644 index 0000000000000000000000000000000000000000..d2e035c7190f0c48877fc8e14bfcf8e4a8868477 --- /dev/null +++ b/32/replication_package/SurveyAnalysis_Main.R @@ -0,0 +1,378 @@ +# Replication File for Survey Analysis +# Figure 2: Individuals Living in Municipalities with a Higher Degree ofExcess MalesPerceiveMore Mate Competition +# Figure 3: List Experiment +# Table 1: Mate Competition Predicts Support for Hate Crime +# Figure 4: Estimated Effects of Mate Competition on Support for Hate Crimes + +# R version 4.0.2 (2020-06-22) + +# ################## +# Data Preparation +# ################## +rm(list=ls()) +# Set the directly appropriately + +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("pBrackets") # pBrackets_1.0 +# install.packages("stargazer") # stargazer_5.2.2 + + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(pBrackets) # pBrackets_1.0 +require(stargazer) # stargazer_5.2.2 +source("Help.R") + +dat <- read.dta13(file = "survey.dta") + +# Subset to people in the wave 4 +dat_use <- dat[dat$wave == 4, ] + +# ####################### +# Figure 2 +# ####################### +# Prepare Two data sets +dat_male <- dat_use[dat_use$gender == "Male" & dat_use$age <= 44 & dat_use$age >= 18, ] +dat_male_y <- dat_use[dat_use$gender == "Male" & dat_use$age <= 40 & dat_use$age >= 30, ] + +# Overall Samples +dat_use$MateComp.cont_bin <- ifelse(dat_use$MateComp.cont >= 3, 1, 0) +dat_use$excess_c <- ifelse(dat_use$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_use$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all <- tapply(dat_use$MateComp.cont_bin, dat_use$excess_c, mean) +se_all <- tapply(dat_use$MateComp.cont_bin, dat_use$excess_c, sd)/sqrt(table(dat_use$excess_c)) + +# Male (18 - 44) +dat_male$MateComp.cont_bin <- ifelse(dat_male$MateComp.cont >= 3, 1, 0) +dat_male$excess_c <- ifelse(dat_male$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_male$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all_m <- tapply(dat_male$MateComp.cont_bin, dat_male$excess_c, mean) +se_all_m <- tapply(dat_male$MateComp.cont_bin, dat_male$excess_c, sd)/sqrt(table(dat_male$excess_c)) + +# Male (30 - 40) +dat_male_y$MateComp.cont_bin <- ifelse(dat_male_y$MateComp.cont >= 3, 1, 0) +dat_male_y$excess_c <- ifelse(dat_male_y$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_male_y$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all_y <- tapply(dat_male_y$MateComp.cont_bin, dat_male_y$excess_c, mean) +se_all_y <- tapply(dat_male_y$MateComp.cont_bin, dat_male_y$excess_c, sd)/sqrt(table(dat_male_y$excess_c)) + + +mean_all ## 0.1835004 0.1970803 0.2244489 +mean_all_m ## 0.2282609 0.2745902 0.3750000 +mean_all_y ## 0.1743119 0.2818182 0.4705882 + +{ + diff <- c(mean_all[2] - mean_all[1], + mean_all[3] - mean_all[2], + mean_all[3] - mean_all[1]) + sd_d <- c(sqrt(se_all[2]^2 + se_all[1]^2), + sqrt(se_all[3]^2 + se_all[2]^2), + sqrt(se_all[3]^2 + se_all[1]^2)) + diff_m <- c(mean_all_m[2] - mean_all_m[1], + mean_all_m[3] - mean_all_m[2], + mean_all_m[3] - mean_all_m[1]) + sd_d_m <- c(sqrt(se_all_m[2]^2 + se_all_m[1]^2), + sqrt(se_all_m[3]^2 + se_all_m[2]^2), + sqrt(se_all_m[3]^2 + se_all_m[1]^2)) + diff_y <- c(mean_all_y[2] - mean_all_y[1], + mean_all_y[3] - mean_all_y[2], + mean_all_y[3] - mean_all_y[1]) + sd_d_y <- c(sqrt(se_all_y[2]^2 + se_all_y[1]^2), + sqrt(se_all_y[3]^2 + se_all_y[2]^2), + sqrt(se_all_y[3]^2 + se_all_y[1]^2)) + + + diff_l <- c(diff, diff_m, diff_y) + se_l <- c(sd_d, sd_d_m, sd_d_y) + p_value <- 2*(1 - pnorm(abs(diff_l/se_l))) + diff_table <- cbind(diff_l, se_l, p_value) +} + +pdf("figure_2.pdf", height= 15.5, width = 6.5) +par(mfrow = c(3, 1), mar = c(6,5,5,2), oma = c(0,4,0,0)) +plot(seq(1:3), mean_all, pch = 19, ylim = c(0.1,0.4), + xlim = c(0.5, 3.5), + main = "All", xaxt = "n", xlab = "", ylab = "", + cex.axis = 2.25, cex.main = 2.5, yaxt = "n", + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all - 1.96*se_all, + seq(1:3), mean_all + 1.96*se_all, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) +Axis(side = 2, at = c(0.1,0.2,0.3, 0.4), labels = c("0.1", "0.2", "0.3", "0.4"), cex.axis = 2.25) +brackets(x1 = 1.1, y1 = 0.3, x2 = 1.9, y2 = 0.3, h = 0.01, type = 4) +brackets(x1 = 2.1, y1 = 0.3, x2 = 2.9, y2 = 0.3, h = 0.01, type = 4) +brackets(x1 = 1, y1 = 0.37, x2 = 3, y2 = 0.37, h = 0.01, type = 4) +# text(x = 1.5, y = 0.33, paste0("pv = ", round(p_value[1],digits=3)), cex = 1.95) +text(x = 1.5, y = 0.33, paste0("pv = 0.40"), cex = 1.95) +text(x = 2.5, y = 0.33, paste0("pv = ", round(p_value[2],2)), cex = 1.95) +text(x = 2, y = 0.40, paste0("pv = ", round(p_value[3],2)), cex = 1.95) +mtext("Excess Males", side = 1, cex = 1.75, line = 3.75) +mtext("Proportion Perceiving\nMate Competition", side = 2, cex = 1.75, line = 3.75) + +plot(seq(1:3), mean_all_m, pch = 19, ylim = c(0.1,0.6), + xlim = c(0.5, 3.5), + main = "Male (18-44)", xaxt = "n", xlab = "", ylab = "", cex.axis = 2.25, cex.main = 2.5, + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all_m - 1.96*se_all_m, + seq(1:3), mean_all_m + 1.96*se_all_m, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) +brackets(x1 = 1.1, y1 = 0.48, x2 = 1.9, y2 = 0.48, h = 0.01, type = 4) +brackets(x1 = 2.1, y1 = 0.48, x2 = 2.9, y2 = 0.48, h = 0.01, type = 4) +brackets(x1 = 1, y1 = 0.53, x2 = 3, y2 = 0.53, h = 0.03, type = 4) +text(x = 1.5, y = 0.51, paste0("pv = ", round(p_value[4],2)), cex = 1.95) +text(x = 2.5, y = 0.51, paste0("pv = ", round(p_value[5],2)), cex = 1.95) +# text(x = 2, y = 0.58, paste0("pv = ", round(p_value[6],2)), cex = 1.95) +text(x = 2, y = 0.58, paste0("pv = 0.00"), cex = 1.95) +mtext("Excess Males", side = 1, cex = 1.75, line = 3.75) +mtext("Proportion Perceiving\nMate Competition", side = 2, cex = 1.75, line = 3.75) + + +plot(seq(1:3), mean_all_y, pch = 19, ylim = c(0.1,0.75), + xlim = c(0.5, 3.5), + main = "Male (30 - 40)", xaxt = "n", xlab = "", ylab = "", cex.axis = 2.25, cex.main = 2.5, + cex = 2.25, cex.lab = 2.5) +segments(seq(1:3), mean_all_y - 1.96*se_all_y, + seq(1:3), mean_all_y + 1.96*se_all_y, pch = 19, lwd = 3) +Axis(side = 1, at = c(1,2,3), labels = c("1st tercile", "2nd tercile", "3rd tercile"), cex.axis = 2.25) +brackets(x1 = 1.1, y1 = 0.62, x2 = 1.9, y2 = 0.62, h = 0.03, type = 4) +brackets(x1 = 2.1, y1 = 0.62, x2 = 2.9, y2 = 0.62, h = 0.03, type = 4) +brackets(x1 = 1, y1 = 0.7, x2 = 3, y2 = 0.7, h = 0.03, type = 4) +text(x = 1.5, y = 0.67, paste0("pv = ", round(p_value[7],2)),cex = 1.95) +text(x = 2.5, y = 0.67, paste0("pv = ", round(p_value[8],2)), cex = 1.95) +text(x = 2, y = 0.75, paste0("pv = 0.00"), cex = 1.95) +# text(x = 2, y = 0.75, paste0("pv = ", round(p_value[9],3))) +mtext("Excess Males", side = 1, cex = 1.75, line = 3.75) +mtext("Proportion Perceiving\nMate Competition", side = 2, cex = 1.75, line = 3.75) + +dev.off() + +# ############################ +# Main Models (Table 1) +# ############################ +lm1 <- lm(hate_violence_means ~ MateComp.cont, data=dat_use) +summary(lm1) + +lm2 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont, data=dat_use) +summary(lm2) + +lm3 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(gender) + # gender + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ), # subjective social status + data=dat_use) +summary(lm3) + +lm4 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(gender) + # gender + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ) + # subjective social status + factor(ref_integrating) + # Refugee Index (National-level; Q73) 8 in total + factor(ref_citizenship) + factor(ref_reduce) + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror), + data=dat_use) +summary(lm4) + +lm5 <- lm(hate_violence_means ~ MateComp.cont + JobComp.cont + LifeSatis.cont + + factor(age_group) + # age group + factor(gender) + # gender + factor(state) + # state + factor(citizenship) + # german citizen + factor(marital) + # marital status + factor(religion) + # religious affiliation + eduyrs + # education + factor(occupation) + # main activity + factor(income) + # income + factor(household_size) + # household size + factor(self_econ) + # subjective social status + factor(ref_integrating) + # Refugee Index (National-level; Q73) 8 in total + factor(ref_citizenship) + factor(ref_reduce) + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + # Refugee Index (Local, Q75) + factor(ref_loc_economy) + factor(ref_loc_crime) + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife), ## end + data=dat_use) +summary(lm5) + + +# Add More Variables +# lrscale Q21 Left-Right Scale +# afd, Q23 Closeness to AfD +# muslim_ind, afd_ind, contact_ind +# distance_ref Q71. Distance to refugee reception centers +# settle_ref Q72. Settlement of refugees living in area + +formula.5 <- + as.character("hate_violence_means ~ MateComp.cont + JobComp.cont + + LifeSatis.cont + factor(age_group) + factor(gender) + + factor(state) + factor(citizenship) + factor(marital) + + factor(religion) + eduyrs + factor(occupation) + + factor(income) + factor(household_size) + factor(self_econ) + + factor(ref_integrating) + factor(ref_citizenship) + factor(ref_reduce) + + factor(ref_moredone) + factor(ref_cultgiveup) + + factor(ref_economy) + factor(ref_crime) + factor(ref_terror) + + factor(ref_loc_services) + factor(ref_loc_economy) + factor(ref_loc_crime) + + factor(ref_loc_culture) + factor(ref_loc_islam) + + factor(ref_loc_schools) + factor(ref_loc_housing) + factor(ref_loc_wayoflife)") + +formula.6 <- paste(formula.5, "factor(distance_ref) + factor(settle_ref)", + "lrscale + afd + muslim_ind + afd_ind + contact_ind", + sep="+", collapse="+") + +lm6 <- lm(as.formula(formula.6), data=dat_use) +summary(lm6) + +lm.list.table1 <- list(lm1, lm2, lm3, lm4, lm5, lm6) + +# Table 1 +star_out(stargazer(lm.list.table1, + covariate.labels = c("Mate Competition","Job Competition","Life Satisfaction"), + keep=c("MateComp.cont","JobComp.cont","LifeSatis.cont"), + star.char = c("\\dagger", "*", "**"), + notes = c("$^{\\dagger}$ p$<$0.1; $^{*}$ p$<$0.05; $^{**}$ p$<$0.01"), notes.append = FALSE), + name = "table1.tex") + +## ################# +## Figure 4 +## ################# +# with Difference Outcomes +# hate_pol_message (v_320): "82. Support for Hate Crime_Attacks against refugee homes are somet" +# hate_prevent_settlement (v_319): "82. Support for Hate Crime_Racist violence is defensible if it lea" +# hate_polcondemn (v_316): "82. Support for Hate Crime_Politicians should condemn attacks agai" +# hate_justified (v_315): "82. Support for Hate Crime_Hostility against foreigners is sometimes justified" + +formula.7.means <- paste("hate_violence_means ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.message <- paste("hate_pol_message ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.prevent <- paste("hate_prevent_settlement ~", as.character(as.formula(formula.6))[3], sep = "") +formula.7.condemn <- paste("hate_polcondemn ~ ", as.character(as.formula(formula.6))[3], sep = "") +formula.7.justified <- paste("hate_justified ~ ", as.character(as.formula(formula.6))[3], sep = "") + +# output +lm7.means <- lm(as.formula(formula.7.means), data=dat_use) +lm7.justified <- lm(as.formula(formula.7.justified), data=dat_use) +lm7.message <- lm(as.formula(formula.7.message), data=dat_use) +lm7.prevent <- lm(as.formula(formula.7.prevent), data=dat_use) +lm7.condemn <- lm(as.formula(formula.7.condemn), data=dat_use) + +# Figure 5 +point <- c(coef(lm7.means)["MateComp.cont"], + coef(lm7.justified)["MateComp.cont"], coef(lm7.message)["MateComp.cont"], + coef(lm7.prevent)["MateComp.cont"], coef(lm7.condemn)["MateComp.cont"]) + +se <- c(summary(lm7.means)$coef["MateComp.cont", 2], + summary(lm7.justified)$coef["MateComp.cont", 2], summary(lm7.message)$coef["MateComp.cont", 2], + summary(lm7.prevent)$coef["MateComp.cont", 2], summary(lm7.condemn)$coef["MateComp.cont", 2]) + + +pdf("figure_4.pdf", height = 4, width = 8) +par(mar = c(2,4,4,1)) +plot(seq(1:5), point, pch = 19, ylim = c(-0.05, 0.25), xlim = c(0.5, 5.5), + xlab = "", xaxt = "n", ylab = "Estimated Effects", + main = "Estimated Effects of Mate Competition", cex.lab = 1.25, cex.axis = 1.25, cex.main = 1.5) +segments(seq(1:5), point - 1.96*se, + seq(1:5), point + 1.96*se, lwd = 2) +Axis(side=1, at = seq(1:5), labels = c("Only Means", "Justified", "Message", + "Prevent", "Condemn"), cex.axis = 1.25) +abline(h =0, lty = 2) +dev.off() + +## Table C.5 (in Appendix C.5) +# lm.list_d <- list(lm7.means, lm7.justified, lm7.message, lm7.prevent, lm7.condemn) +# stargazer(lm.list_d, +# covariate.labels = c("Mate Competition","Job Competition","Life Satisfaction"), +# keep=c("MateComp.cont","JobComp.cont","LifeSatis.cont")) + + +## ############################# +## Figure 3: List Experiment +## ############################# +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("list") # list_9.2 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(list) # list_9.2 + +dat <- read.dta13(file = "survey.dta") +data.u2 <- dat[dat$wave == 2, ] + +# Means: When it comes to the refugee problem, violence is sometimes the only means that citizens have to get the attention of German politicians +data.list.u2 <- data.u2[data.u2$list == "1",] +data.direct.u2 <- data.u2[data.u2$list == "2",] +data.list.u2 <- data.list.u2[is.na(data.list.u2$treatment_list)==FALSE,] +data.list.u2$List.treat <- ifelse(data.list.u2$treatment_list == "Scenario 2", 1, 0) + +## Difference-in-Means +## with Mean = 0.15401 sd = 0.03358 +diff.in.means.results2 <- ictreg(outcome_list ~ 1, data = data.list.u2, + treat = "List.treat", J=3, method = "lm") +summary(diff.in.means.results2) + +## Compare to All People who answered Direct Question (n = 2170) +data.u2.all.direct <- data.u2[is.na(data.u2$hate_violence_means) == FALSE, ] +data.u2.all.direct$hate.direct.bin <- ifelse(data.u2.all.direct$hate_violence_means >=3, 1, 0) +point_dir2 <- mean(data.u2.all.direct$hate.direct.bin) ## 0.181 +se_dir2 <- sd(data.u2.all.direct$hate.direct.bin)/sqrt(length(data.u2.all.direct$hate.direct.bin)) # 0.0083 + +# Compare Questions within Wave 2 +# Direct Questions +data.u2$message.bin <- ifelse(data.u2$hate_pol_message >= 3, 1, 0) +data.u2$condemn.bin <- ifelse(data.u2$hate_polcondemn >= 3, 1, 0) +data.u2$justified.bin <- ifelse(data.u2$hate_justified >= 3, 1, 0) + +message.mean2 <- mean(data.u2$message.bin) +condemn.mean2 <- mean(data.u2$condemn.bin) +justified.mean2 <- mean(data.u2$justified.bin) +message.se2 <- sd(data.u2$message.bin)/sqrt(length(data.u2$message.bin)) # 0.0070 +condemn.se2 <- sd(data.u2$condemn.bin)/sqrt(length(data.u2$condemn.bin)) # 0.0079 +justified.se2 <- sd(data.u2$justified.bin)/sqrt(length(data.u2$justified.bin)) # 0.0074 + +# plot +point <- c(summary(diff.in.means.results2)$par.treat, point_dir2, justified.mean2, message.mean2, condemn.mean2) +se_p <- c(summary(diff.in.means.results2)$se.treat, se_dir2, justified.se2, message.se2, condemn.se2) +base <- barplot(point, ylim = c(0, 0.20)) +bar_name_u <- c("Only Means\n(List)","Only Means\n(Direct)", "Justified", "Message", "Condemn") +bar_name <- rep("",5) + +pdf("figure_3.pdf", height = 4.5, width = 8) +par(mar = c(4, 5, 2, 1)) +barplot(point, ylim = c(0, 0.3), names.arg = bar_name, + col = c(adjustcolor("red", 0.4), "gray", "gray", "gray", "gray"), cex.axis = 1.3, + ylab = "Proportion of respondents", cex.lab = 1.45) +arrows(base[,1], point - 1.96*se_p, base[,1], point + 1.96*se_p, + lwd = 3, angle = 90, length = 0.05, code = 3, + col = c("red", "black", "black", "black", "black")) +mtext(bar_name_u[1], outer = FALSE, side = 1, at = base[1], cex = 1.2, line = 2.4) +mtext(bar_name_u[2], outer = FALSE, side = 1, at = base[2], cex = 1.2, line = 2.4) +mtext(bar_name_u[3], outer = FALSE, side = 1, at = base[3], cex = 1.2, line = 2.4) +mtext(bar_name_u[4], outer = FALSE, side = 1, at = base[4], cex = 1.2, line = 2.4) +mtext(bar_name_u[5], outer = FALSE, side = 1, at = base[5], cex = 1.2, line = 2.4) +text(x = base[1], y = 0.275, "Estimate from \nList Experiment", col = "red", font = 2) +text(x = (base[3] + base[4])/2, y = 0.275, "Direct Questions", font = 2) +dev.off() \ No newline at end of file diff --git a/32/replication_package/YouGov.dta b/32/replication_package/YouGov.dta new file mode 100644 index 0000000000000000000000000000000000000000..d441dd43d30b5243fc2871d90a26059ca8037216 --- /dev/null +++ b/32/replication_package/YouGov.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68bc13dffdedff3ad30211644a050d0e85e24693ecaf6b2e8c95f6e37cfa9f5d +size 212090 diff --git a/32/replication_package/codebook_YouGov.pdf b/32/replication_package/codebook_YouGov.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9ed0d8257060e2e04c4cd64ba26147b12c3d97f0 --- /dev/null +++ b/32/replication_package/codebook_YouGov.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97b900343580543bff2743c8a158d93e1d6a9aedc0c8215911fe84c02c27c2d1 +size 139433 diff --git a/32/replication_package/codebook_context.pdf b/32/replication_package/codebook_context.pdf new file mode 100644 index 0000000000000000000000000000000000000000..80518e211e324120bff4848ac59b201bf05c8d07 --- /dev/null +++ b/32/replication_package/codebook_context.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ca51e10c3186ba504bf83bcea63385813cfb51ce1e354d47832e9cbb916d60a +size 140823 diff --git a/32/replication_package/codebook_context_placebo.pdf b/32/replication_package/codebook_context_placebo.pdf new file mode 100644 index 0000000000000000000000000000000000000000..170d87ce27d6101bae1827139d307b22266d1999 --- /dev/null +++ b/32/replication_package/codebook_context_placebo.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e04f05c86b1ad29b2e004537221a1ec4d610285d84a539227473f84dd938e7d9 +size 164836 diff --git a/32/replication_package/codebook_survey.pdf b/32/replication_package/codebook_survey.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f8c03fd2e7f5b42f7afae4743cc2bbb2184bb44b --- /dev/null +++ b/32/replication_package/codebook_survey.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99bb13e7d6936c4f57eaba442ae1d453db5368b1984dd8ec4e47023d732ae542 +size 146756 diff --git a/32/replication_package/context.dta b/32/replication_package/context.dta new file mode 100644 index 0000000000000000000000000000000000000000..7fbffe50f573b61ac903845c71f5ab1f8ffb34b6 --- /dev/null +++ b/32/replication_package/context.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe201f5a75c7d014e63a155ddbf44a8a144e0b93c366d1d58c7898bf411c6009 +size 7408421 diff --git a/32/replication_package/context_placebo.dta b/32/replication_package/context_placebo.dta new file mode 100644 index 0000000000000000000000000000000000000000..53cb01220e0239c178b386605a4246bcce0d9df8 --- /dev/null +++ b/32/replication_package/context_placebo.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c300be8df5d3bf094c2cfe4fa5e7c70d55dd9902cd3369d789b434704a7abfc0 +size 4064170 diff --git a/32/replication_package/master.R b/32/replication_package/master.R new file mode 100644 index 0000000000000000000000000000000000000000..3184fbfd8cbfcd85656bf533c7e2caf47c32ea4e --- /dev/null +++ b/32/replication_package/master.R @@ -0,0 +1,10 @@ +# Main Analysis in the paper +source("ContextAnalysis_Main.R") +source("SurveyAnalysis_Main.R") + +# Numbers we report in the paper +source("number_in_texts.R") + +# Results in Appendix +source("ContextAnalysis_Appendix.R") +source("SurveyAnalysis_Appendix.R") diff --git a/32/replication_package/merge_context.R b/32/replication_package/merge_context.R new file mode 100644 index 0000000000000000000000000000000000000000..07d6439b038785033f4f215d3f1e6fe9d68690b1 --- /dev/null +++ b/32/replication_package/merge_context.R @@ -0,0 +1,217 @@ +# Internal File for Merging datasets for producing "context.dta" +# R version 4.0.2 (2020-06-22) + +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 + +require(readstata13) # readstata13_0.9.2 + +setwd("source_data") + +# 0. Base data that contains AGS identifies and Year +base <- read.dta13("base.dta") + +# Note: +# Every data source we use below is fully described in "source_context.pdf" + +# 1. Hate Crime Data +hate <- read.dta13("hate.dta") +hate$Housing_all_muni <- hate$Arson_muni + hate$Other_muni +hate$Hate_all_muni <- hate$Housing_all_muni + hate$Physical_muni + +context0 <- merge(base, hate[, c("ags_muni", "year", + "Hate_all_muni", + "Physical_muni")], by = c("ags_muni", "year"), all.x = TRUE) + +# 2. Population Data +pop_dat <- read.dta13("pop_gemeinde_2008_2018.dta") +colnames(pop_dat)[colnames(pop_dat) == "ags"] <- "ags_muni" + +pop_dat$pop_m_25_44 <- pop_dat$pop_m_25_29 + pop_dat$pop_m_30_34 + pop_dat$pop_m_35_39 + pop_dat$pop_m_40_44 +pop_dat$pop_f_25_44 <- pop_dat$pop_f_25_29 + pop_dat$pop_f_30_34 + pop_dat$pop_f_35_39 + pop_dat$pop_f_40_44 + +pop_dat$pop_m_15_44 <- pop_dat$pop_m_15_17 + pop_dat$pop_m_18_19 + pop_dat$pop_m_20_24 + pop_dat$pop_m_25_44 +pop_dat$pop_f_15_44 <- pop_dat$pop_f_15_17 + pop_dat$pop_f_18_19 + pop_dat$pop_f_20_24 + pop_dat$pop_f_25_44 + +pop_dat$population_muni <- pop_dat$pop_mf_total + +pop_dat$pop_25_44_muni_gendergap <- pop_dat$pop_m_25_44/pop_dat$pop_f_25_44 +pop_dat$pop_15_44_muni_gendergap <- pop_dat$pop_m_15_44/pop_dat$pop_f_15_44 +pop_dat$pop_25_44_muni_gendergap[is.infinite(pop_dat$pop_25_44_muni_gendergap)] <- NA +pop_dat$pop_15_44_muni_gendergap[is.infinite(pop_dat$pop_15_44_muni_gendergap)] <- NA + +pop_dat_2015 <- subset(pop_dat, year == 2015) +pop_dat_2015$pop_25_44_muni_gendergap_2015 <- pop_dat_2015$pop_m_25_44/pop_dat_2015$pop_f_25_44 +pop_dat_2015$pop_15_44_muni_gendergap_2015 <- pop_dat_2015$pop_m_15_44/pop_dat_2015$pop_f_15_44 +pop_dat_2015$pop_25_44_muni_gendergap_2015[is.infinite(pop_dat_2015$pop_25_44_muni_gendergap_2015)] <- NA +pop_dat_2015$pop_15_44_muni_gendergap_2015[is.infinite(pop_dat_2015$pop_15_44_muni_gendergap_2015)] <- NA + +pop_dat_2015$population_muni_2015 <- pop_dat_2015$pop_mf_total + + +# 3. area +area <- read.dta13("area_mun.dta") +area_use <- area[area$ags %in% context0$ags_muni, ] +colnames(area_use)[colnames(area_use) == "ags"] <- "ags_muni" + +pop_dat_2015 <- merge(pop_dat_2015, area_use[,c("ags_muni", "area_sqk")], all.x = TRUE) +pop_dat_2015$popdens_muni_2015 <- pop_dat_2015$population_muni_2015/pop_dat_2015$area_sqk + +pop_dat <- merge(pop_dat, area_use[,c("ags_muni", "area_sqk")], all.x = TRUE) +pop_dat$popdens_muni <- pop_dat$population_muni/pop_dat$area_sqk + +context0 <- merge(context0, pop_dat_2015[, c("ags_muni", + "pop_25_44_muni_gendergap_2015", + "pop_15_44_muni_gendergap_2015", + "population_muni_2015", + "popdens_muni_2015")], by = c("ags_muni"), all.x = TRUE) + +# 4. Unemployment +pop_dat <- read.dta13("pop_gemeinde_2008_2018.dta") +colnames(pop_dat)[colnames(pop_dat) == "ags"] <- "ags_muni" +pop_dat$pop_m_25_44 <- pop_dat$pop_m_25_29 + pop_dat$pop_m_30_34 + pop_dat$pop_m_35_39 + pop_dat$pop_m_40_44 +pop_dat$pop_f_25_44 <- pop_dat$pop_f_25_29 + pop_dat$pop_f_30_34 + pop_dat$pop_f_35_39 + pop_dat$pop_f_40_44 +pop_dat$pop_m_15_44 <- pop_dat$pop_m_15_17 + pop_dat$pop_m_18_19 + pop_dat$pop_m_20_24 + pop_dat$pop_m_25_44 +pop_dat$pop_f_15_44 <- pop_dat$pop_f_15_17 + pop_dat$pop_f_18_19 + pop_dat$pop_f_20_24 + pop_dat$pop_f_25_44 +unemp_dat <- read.dta13("unempl_gemeinde_2008_2017.dta") +colnames(unemp_dat)[colnames(unemp_dat) == "ags"] <- "ags_muni" +colnames(unemp_dat)[colnames(unemp_dat) == "ags_dist"] <- "ags_county" + +## unemployed as share of working age population (age 15-64) +pop_dat$pop_mf_15_64 <- pop_dat$pop_mf_15_17 + pop_dat$pop_mf_18_19 + pop_dat$pop_mf_20_24 + + pop_dat$pop_mf_25_29 + pop_dat$pop_mf_30_34 + pop_dat$pop_mf_35_39 + pop_dat$pop_mf_40_44 + + pop_dat$pop_mf_45_49 + pop_dat$pop_mf_50_54 + pop_dat$pop_mf_55_59 + pop_dat$pop_mf_60_64 + +pop_dat$pop_m_15_64 <- pop_dat$pop_m_15_44 + pop_dat$pop_m_45_49 + pop_dat$pop_m_50_54 + + pop_dat$pop_m_55_59 + pop_dat$pop_m_60_64 + +pop_dat$pop_f_15_64 <- pop_dat$pop_f_15_44 + pop_dat$pop_f_45_49 + pop_dat$pop_f_50_54 + + pop_dat$pop_f_55_59 + pop_dat$pop_f_60_64 + +unemp_dat_use <- unemp_dat[, c("ags_muni", "ags_county", + "year", + "unempl_all_total", + "unempl_all_male_total", + "unempl_all_fem_total")] +pop_dat_m <- pop_dat[pop_dat$year >= 2011, c("ags_muni", "year", "pop_mf_15_64", "pop_m_15_64", "pop_f_15_64")] +unemp_merge <- merge(pop_dat_m, unemp_dat_use, by = c("ags_muni", "year"), all.x = TRUE, all.y = FALSE) +unemp_merge$unemp_all_muni <- (unemp_merge$unempl_all_total/unemp_merge$pop_mf_15_64)*100 + +unemp_2015 <- unemp_merge[unemp_merge$year == 2015, ] +unemp_2015$unemp_all_muni_2015 <- unemp_2015$unemp_all_muni +unemp_2015$log_unemp_all_muni_2015 <- log(unemp_2015$unemp_all_muni_2015 + 1) + +context0 <- merge(context0, unemp_2015[, c("ags_muni", + "log_unemp_all_muni_2015")], by = c("ags_muni"), + all.x = TRUE, all.y = FALSE) + +# 5. Unemployment Gender Gap +d2 <- read.dta13("merged_context_2.dta") # we created this data set in "produce_context_data.do" +d2_15 <- d2[d2$year == 2015, ] +d2_15$unemp_gendergap_2015 <- round(d2_15$unemp_gendergap, 6) + +context0 <- merge(context0, d2_15[, c("ags_county", "unemp_gendergap_2015")], + all.x = TRUE, all.y = FALSE, by = "ags_county") + +# 6. Population Change +pop_dat <- read.dta13("pop_gemeinde_2008_2018.dta") +colnames(pop_dat)[colnames(pop_dat) == "ags"] <- "ags_muni" +pop_dat$population_muni <- pop_dat$pop_mf_total +pop_dat_2015 <- subset(pop_dat, year == 2015) +pop_dat_2011 <- subset(pop_dat, year == 2011) +pop_dat_2015$d_pop1511_muni <- + (pop_dat_2015$population_muni - pop_dat_2011$population_muni)/pop_dat_2011$population_muni + +context0 <- merge(context0, pop_dat_2015[, c("ags_muni", + "d_pop1511_muni")], by = c("ags_muni"), all.x = TRUE) + +# 7. Voting +voting <- read.dta13("voting.dta") + +context0 <- merge(context0, voting[, c("ags_muni", + "vote_afd_2013_muni")], by = c("ags_muni"), all.x = TRUE) + +# 8. Refugee Data +ref_dat <- read.dta13("refugees_2008_2017.dta") +ref_2014 <- subset(ref_dat, year == 2014) +ref_2015 <- subset(ref_dat, year == 2015) +table(ref_2014$ags_county == ref_2015$ags_county) + +ref_2014$ref_inflow_1514 <- ref_2015$pop_ref - ref_2014$pop_ref +ref_2014$log_ref_inflow_1514 <- log(1500 + ref_2014$ref_inflow_1514) + +ref_2014$pop_ref_2014 <- ref_2014$pop_ref +ref_2014$pop_ref_2015 <- ref_2015$pop_ref + +# Proportion of male refugees +ref_prop <- read.dta13("merged_context_2.dta") # we created this data set in "produce_context_data.do" + +context0 <- merge(context0, ref_2014[, c("ags_county", + "log_ref_inflow_1514", + "pop_ref_2014")], by = c("ags_county"), all.x = TRUE) +context0 <- merge(context0, ref_prop[, c("year", "ags_county", + "pc_ref_male")], by = c("year", "ags_county"), all.x = TRUE) + +# 9. Violence +crime <- read.dta13("crime.dta") +crime <- crime[crime$year == 2015, ] + +pop_county <- read.dta13("pop_kreise_2015_2017.dta") +pop_county1 <- subset(pop_county, year == 2015) + +crime2 <- merge(crime[, c("ags_county", "violence_num_cases")], + pop_county1[, c("ags_county", "population")], + by = "ags_county", all.x = TRUE, all.y = FALSE) +crime2$violence_percap_2015 <- crime2$violence_num_cases/crime2$population + +context0 <- merge(context0, crime2[, c("ags_county", + "violence_percap_2015")], by = c("ags_county"), all.x = TRUE) + +# 10. Education +edu <- read.dta13("merged_context_2.dta") # we created this data set in "produce_context_data.do" +edu <- edu[edu$year == 2011, ] +edu <- edu[, c("ags_county", "pc_hidegree_all2011")] + +context0 <- merge(context0, edu[, c("ags_county", + "pc_hidegree_all2011")], by = c("ags_county"), all.x = TRUE) + + +# 10. Industry +manu0 <- read.dta13("merged_context_2.dta") # we created this data set in "produce_context_data.do" +manu0 <- manu0[, c("year", "ags_county", "pc_manufacturing")] +manu <- manu0[manu0$year >= 2011 & manu0$year <= 2015, ] +rownames(manu) <- NULL +manu_orig <- manu + +manu <- manu_orig[manu_orig$year == 2015, ] +manu <- manu[, c("ags_county", "pc_manufacturing")] +manu <- manu[is.element(manu$ags_county, unique(context0$ags_county)),] +manu$pc_manufacturing_2015 <- manu$pc_manufacturing + +manu2011 <- manu_orig[manu_orig$year == 2011, ] +manu2011 <- manu2011[, c("ags_county", "pc_manufacturing")] +manu2011 <- manu2011[is.element(manu2011$ags_county, unique(context0$ags_county)),] +manu2011$pc_manufacturing_2011 <- manu2011$pc_manufacturing + +# d_manuf1115 +manu$d_manuf1115 <- manu$pc_manufacturing_2015 - manu2011$pc_manufacturing_2011 + +context0 <- merge(context0, manu[, c("ags_county", + "pc_manufacturing_2015", + "d_manuf1115")], by = c("ags_county"), all.x = TRUE) + +# 11. East +context0$east <- 0 +context0$east[context0$ags_state %in% c("11","12","13","14","15","16")] <- 1 + +# 12. Create additional variables +context0$Hate_all_muni_bin <- as.numeric(context0$Hate_all_muni > 0) +context0$Physical_muni_bin <- as.numeric(context0$Physical_muni > 0) + +context0$log_population_muni_2015 <- log(context0$population_muni_2015) +context0$log_popdens_muni_2015 <- log(context0$popdens_muni_2015) +context0$log_pop_ref_2014 <- log(context0$pop_ref_2014) +context0$log_violence_percap_2015 <- log(context0$violence_percap_2015) + +context0 <- context0[order(context0$year, context0$ags_muni), ] +save.dta13(context0, file = "context.dta") \ No newline at end of file diff --git a/32/replication_package/merge_context_placebo.R b/32/replication_package/merge_context_placebo.R new file mode 100644 index 0000000000000000000000000000000000000000..4faaeb4eb6da5198fd7026fb83ba92c7071ea08c --- /dev/null +++ b/32/replication_package/merge_context_placebo.R @@ -0,0 +1,231 @@ +rm(list = ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("plm") # plm_2.2-3 + +library(readstata13) # readstata13_0.9.2 +library(plm) # plm_2.2-3 + +setwd("source_data") + +# 0. Base data that contains AGS identifies and Year +base_pl <- read.dta13("base_pl.dta") + +# Note: +# Every data source we use below is fully described in "source_context.pdf" + +# 1. Hate Crime Data +hate <- read.dta13("hate.dta") +hate$Housing_all_muni <- hate$Arson_muni + hate$Other_muni +hate$Hate_all_muni <- hate$Housing_all_muni + hate$Physical_muni + + +context0 <- merge(base_pl, hate[, c("ags_muni", "year", + "Hate_all_muni")], by = c("ags_muni", "year"), all.x = TRUE) + +# 2. Population Data +pop_dat <- read.dta13("pop_gemeinde_2008_2018.dta") +pop_dat <- pop_dat[pop_dat$year >= 2011, ] + +pop_dat$pop_m_25_44 <- pop_dat$pop_m_25_29 + pop_dat$pop_m_30_34 + pop_dat$pop_m_35_39 + pop_dat$pop_m_40_44 +pop_dat$pop_f_25_44 <- pop_dat$pop_f_25_29 + pop_dat$pop_f_30_34 + pop_dat$pop_f_35_39 + pop_dat$pop_f_40_44 + +pop_dat$pop_m_15_44 <- pop_dat$pop_m_15_17 + pop_dat$pop_m_18_19 + pop_dat$pop_m_20_24 + pop_dat$pop_m_25_44 +pop_dat$pop_f_15_44 <- pop_dat$pop_f_15_17 + pop_dat$pop_f_18_19 + pop_dat$pop_f_20_24 + pop_dat$pop_f_25_44 + +pop_dat$population_muni_anu <- pop_dat$pop_mf_total + +pop_dat$pop_25_44_muni_gendergap_anu <- pop_dat$pop_m_25_44/pop_dat$pop_f_25_44 +pop_dat$pop_15_44_muni_gendergap_anu <- pop_dat$pop_m_15_44/pop_dat$pop_f_15_44 +pop_dat$pop_25_44_muni_gendergap_anu[is.infinite(pop_dat$pop_25_44_muni_gendergap_anu)] <- NA +pop_dat$pop_15_44_muni_gendergap_anu[is.infinite(pop_dat$pop_15_44_muni_gendergap_anu)] <- NA + +pop_dat_pl <- pop_dat[, c("year", "ags_muni","ags_county", "ags_state", + "population_muni_anu", "pop_15_44_muni_gendergap_anu")] + +# creating pop_15_44_muni_gendergap_future +pop_dat_pl_p <- pdata.frame(pop_dat_pl, index = c("ags_muni", "year")) +pop_dat_pl_p$pop_15_44_muni_gendergap_future <- as.numeric(lead(pop_dat_pl_p$pop_15_44_muni_gendergap_anu, k = 1)) +class(pop_dat_pl_p) <- "data.frame" +pop_dat_pl <- pop_dat_pl_p +rownames(pop_dat_pl) <- NULL + +# 3. area +area <- read.dta13("area_mun.dta") +area_use <- area[area$ags %in% base_pl$ags_muni, ] +colnames(area_use)[colnames(area_use) == "ags"] <- "ags_muni" + +pop_dat_pl <- merge(pop_dat_pl, area_use[,c("ags_muni", "area_sqk")], all.x = TRUE, all.y = FALSE) +pop_dat_pl$popdens_muni_anu <- pop_dat_pl$population_muni_anu/pop_dat_pl$area_sqk + +pop_dat_2015 <- subset(pop_dat_pl, year == 2015) +pop_dat_2011 <- subset(pop_dat_pl, year == 2011) +pop_dat_2011 <- pop_dat_2011[match(pop_dat_2015$ags_muni, pop_dat_2011$ags_muni),] +pop_dat_2015$d_pop_muni_anu <- + (pop_dat_2015$population_muni - pop_dat_2011$population_muni)/pop_dat_2011$population_muni + +pop_dat_2016 <- subset(pop_dat_pl, year == 2016) +pop_dat_2012 <- subset(pop_dat_pl, year == 2012) +pop_dat_2012 <- pop_dat_2012[match(pop_dat_2016$ags_muni, pop_dat_2012$ags_muni),] +pop_dat_2016$d_pop_muni_anu <- + (pop_dat_2016$population_muni - pop_dat_2012$population_muni)/pop_dat_2012$population_muni + +pop_dat_2017 <- subset(pop_dat_pl, year == 2017) +pop_dat_2013 <- subset(pop_dat_pl, year == 2013) +pop_dat_2013 <- pop_dat_2013[match(pop_dat_2017$ags_muni, pop_dat_2013$ags_muni),] +pop_dat_2017$d_pop_muni_anu <- + (pop_dat_2017$population_muni - pop_dat_2013$population_muni)/pop_dat_2013$population_muni + +pop_dat_d <- rbind(pop_dat_2015, pop_dat_2016, pop_dat_2017) + +context0 <- merge(context0, pop_dat_d[, c("year", "ags_muni", + "pop_15_44_muni_gendergap_anu", + "pop_15_44_muni_gendergap_future", + "population_muni_anu", + "popdens_muni_anu", + "d_pop_muni_anu")], by = c("year", "ags_muni"), + all.x = TRUE, all.y = FALSE) + +# 4. Unemployment +pop_dat <- read.dta13("pop_gemeinde_2008_2018.dta") +colnames(pop_dat)[colnames(pop_dat) == "ags"] <- "ags_muni" +pop_dat$pop_m_25_44 <- pop_dat$pop_m_25_29 + pop_dat$pop_m_30_34 + pop_dat$pop_m_35_39 + pop_dat$pop_m_40_44 +pop_dat$pop_f_25_44 <- pop_dat$pop_f_25_29 + pop_dat$pop_f_30_34 + pop_dat$pop_f_35_39 + pop_dat$pop_f_40_44 +pop_dat$pop_m_15_44 <- pop_dat$pop_m_15_17 + pop_dat$pop_m_18_19 + pop_dat$pop_m_20_24 + pop_dat$pop_m_25_44 +pop_dat$pop_f_15_44 <- pop_dat$pop_f_15_17 + pop_dat$pop_f_18_19 + pop_dat$pop_f_20_24 + pop_dat$pop_f_25_44 +unemp_dat <- read.dta13("unempl_gemeinde_2008_2017.dta") +colnames(unemp_dat)[colnames(unemp_dat) == "ags"] <- "ags_muni" +colnames(unemp_dat)[colnames(unemp_dat) == "ags_dist"] <- "ags_county" + +## unemployed as share of working age population (age 15-64) +pop_dat$pop_mf_15_64 <- pop_dat$pop_mf_15_17 + pop_dat$pop_mf_18_19 + pop_dat$pop_mf_20_24 + + pop_dat$pop_mf_25_29 + pop_dat$pop_mf_30_34 + pop_dat$pop_mf_35_39 + pop_dat$pop_mf_40_44 + + pop_dat$pop_mf_45_49 + pop_dat$pop_mf_50_54 + pop_dat$pop_mf_55_59 + pop_dat$pop_mf_60_64 + +pop_dat$pop_m_15_64 <- pop_dat$pop_m_15_44 + pop_dat$pop_m_45_49 + pop_dat$pop_m_50_54 + + pop_dat$pop_m_55_59 + pop_dat$pop_m_60_64 + +pop_dat$pop_f_15_64 <- pop_dat$pop_f_15_44 + pop_dat$pop_f_45_49 + pop_dat$pop_f_50_54 + + pop_dat$pop_f_55_59 + pop_dat$pop_f_60_64 + +unemp_dat_use <- unemp_dat[, c("ags_muni", "ags_county", + "year", + "unempl_all_total", + "unempl_all_male_total", "unempl_all_fem_total")] +pop_dat_m <- pop_dat[pop_dat$year >= 2011, c("ags_muni", "year", "pop_mf_15_64", "pop_m_15_64", "pop_f_15_64")] +unemp_merge <- merge(pop_dat_m, unemp_dat_use, by = c("ags_muni", "year"), all.x = TRUE, all.y = FALSE) + +unemp_merge$unemp_all_muni <- (unemp_merge$unempl_all_total/unemp_merge$pop_mf_15_64)*100 + +dat_2015 <- unemp_merge[unemp_merge$year == 2015, ] +dat_2016 <- unemp_merge[unemp_merge$year == 2016, ] +dat_2017 <- unemp_merge[unemp_merge$year == 2017, ] + +dat_2015$log_unemp_all_muni_anu <- log(dat_2015$unemp_all_muni + 1) # constants are chosen to make sure all values are positive +dat_2016$log_unemp_all_muni_anu <- log(dat_2016$unemp_all_muni + 0.3) +dat_2017$log_unemp_all_muni_anu <- log(dat_2017$unemp_all_muni + 0.3) +unemp_u <- rbind(dat_2015, dat_2016, dat_2017) + +context0 <- merge(context0, unemp_u[, c("ags_muni", "year", + "log_unemp_all_muni_anu")], + by = c("ags_muni", "year"), all.x = TRUE, all.y = FALSE) + +# 5 Unemployment Rate Gap +d20 <- read.dta13("merged_context_2.dta") +d2 <- unique(d20[, c("year", "ags_county", "unemp_gendergap")]) +d2$unemp_gendergap_anu <- d2$unemp_gendergap + +context0 <- merge(context0, d2[, c("year", "ags_county", "unemp_gendergap_anu")], + all.x = TRUE, all.y = FALSE, by = c("year", "ags_county")) + +# 6. Voting +voting <- read.dta13("voting.dta") + +context0 <- merge(context0, voting[, c("ags_muni", + "vote_afd_2013_muni")], by = c("ags_muni"), + all.x = TRUE, all.y = FALSE) + +# 7. Refugee Data +ref_dat <- read.dta13("refugees_2008_2017.dta") +ref_dat <- ref_dat[ref_dat$year >= 2011, ] + +# Creating pop_ref_anu +ref_dat_p <- pdata.frame(ref_dat, index = c("ags_county", "year")) +ref_dat_p$pop_ref_anu <- as.numeric(lag(ref_dat_p$pop_ref, k = 1)) +class(ref_dat_p) <- "data.frame" +ref_dat <- ref_dat_p + +ref_dat <- ref_dat[ref_dat$ags_county %in% unique(ref_dat$ags_county[ref_dat$year == 2014]),] +ref_2014 <- ref_dat[ref_dat$year == 2014, ] +ref_2015 <- ref_dat[ref_dat$year == 2015, ] +ref_2016 <- ref_dat[ref_dat$year == 2016, ] +ref_2017 <- ref_dat[ref_dat$year == 2017, ] + +ref_2015$ref_inflow_1514 <- ref_2015$pop_ref - ref_2014$pop_ref +ref_2016$ref_inflow_1615 <- ref_2016$pop_ref - ref_2015$pop_ref +ref_2017$ref_inflow_1716 <- ref_2017$pop_ref - ref_2016$pop_ref + +ref_2015$log_ref_inflow_anu <- log(1500 + ref_2015$ref_inflow_1514) # constants are chosen such that all values are positive +suppressWarnings(ref_2016$log_ref_inflow_anu <- log(ref_2016$ref_inflow_1615 + 649)) +suppressWarnings(ref_2017$log_ref_inflow_anu <- log(ref_2017$ref_inflow_1716 + 1261)) + +ref_2015 <- ref_2015[, c("year", "ags_county", "pop_ref_anu", "log_ref_inflow_anu")] +ref_2016 <- ref_2016[, c("year", "ags_county", "pop_ref_anu", "log_ref_inflow_anu")] +ref_2017 <- ref_2017[, c("year", "ags_county", "pop_ref_anu", "log_ref_inflow_anu")] +ref_data_c <- rbind(ref_2015, ref_2016, ref_2017) + +context0 <- merge(context0, ref_data_c[, c("year", "ags_county", + "pop_ref_anu", + "log_ref_inflow_anu")], + by = c("year", "ags_county"), all.x = TRUE, all.y = FALSE) + +# 8. Violence +crime <- read.dta13("crime.dta") +pop <- read.dta13("pop_kreise_2015_2017.dta") + +crime2 <- merge(crime[, c("year", "ags_county", "violence_num_cases")], + pop[, c("year", "ags_county", "population")], + by = c("year", "ags_county"), all.x = TRUE, all.y = FALSE) +crime2$violence_percap_anu <- crime2$violence_num_cases/crime2$population + +context0 <- merge(context0, crime2[, c("year", "ags_county", + "violence_percap_anu")], by = c("year", "ags_county"), + all.x = TRUE, all.y = FALSE) + +# 9. Education +edu <- read.dta13("merged_context_2.dta") +edu <- edu[edu$year == 2011, ] +edu <- edu[, c("ags_county", "pc_hidegree_all2011")] + + +context0 <- merge(context0, edu[, c("ags_county", "pc_hidegree_all2011")], by = c("ags_county"), all.x = TRUE) + +# 10. Industry +manu0 <- read.dta13("merged_context_2.dta") +manu0 <- manu0[, c("year", "ags_county", "pc_manufacturing")] +manu <- manu0[manu0$year >= 2011 & manu0$year <= 2015, ] +rownames(manu) <- NULL +manu_orig <- manu + +manu <- manu_orig[manu_orig$year == 2015, ] +manu <- manu[, c("ags_county", "pc_manufacturing")] +manu <- manu[is.element(manu$ags_county, unique(base_pl$ags_county)),] +manu$pc_manufacturing_2015 <- manu$pc_manufacturing + +manu2011 <- manu_orig[manu_orig$year == 2011, ] +manu2011 <- manu2011[, c("ags_county", "pc_manufacturing")] +manu2011 <- manu2011[is.element(manu2011$ags_county, unique(base_pl$ags_county)),] +manu2011$pc_manufacturing_2011 <- manu2011$pc_manufacturing + +# d_manuf1115 +manu$d_manuf1115 <- manu$pc_manufacturing_2015 - manu2011$pc_manufacturing_2011 + +context0 <- merge(context0, manu[, c("ags_county", + "pc_manufacturing_2015", + "d_manuf1115")], by = c("ags_county"), all.x = TRUE) + + +# 11. Create additional variables +context0$Hate_all_muni_bin <- as.numeric(context0$Hate_all_muni > 0) + +context0 <- context0[order(context0$year, context0$ags_muni), ] +save.dta13(context0, file = "context_placebo.dta") \ No newline at end of file diff --git a/32/replication_package/number_in_texts.R b/32/replication_package/number_in_texts.R new file mode 100644 index 0000000000000000000000000000000000000000..a792aa37776f6447d4d93470e6511fa5d1f0f487 --- /dev/null +++ b/32/replication_package/number_in_texts.R @@ -0,0 +1,223 @@ +# Replication File for numbers we mention in the main text of the paper. +# Please see "ContextAnalysis_Main.R", "SurveyAnalysis_Main.R", "ContextAnalysis_Appendix.R", and "SurveyAnalysis_Appendix.R" +# to reproduce Tables and Figures in the paper and in the appendix. + +# R version 4.0.2 (2020-06-22) + +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +source("Help.R") + +# ############### +# Section: Existing Explanations and Mate Competition +# ############### +you_data <- read.dta13(file = "YouGov.dta") + +# The number of people who think marriages between a German woman and a non-German man is common and very common +prop.table(table(you_data$int_marriage))[3:4] + +# ############### +# Section: Refugees and Mate Competition: A Topic of Debate +# ############### +# The number of hate crimes in 2015 and 2016 +dat <- read.dta13("context.dta") +tapply(dat$Hate_all_muni, dat$year, sum)[1:2] + + +# ############### +# Section: Empirical Analyses +# ############### +# ############### +# Sub Section: Mate Competition and the Incidence of Anti-Refugee Hate Crime +# ############### +# The proportion of municipalities that witnessed at least one hate crime in each year +round(tapply(dat$Hate_all_muni_bin, dat$year, mean)*100, 1) + +# The proportion of municipalities that witnessed at least one hate crime in three years +dat_2015 <- dat[dat$year == 2015, ] +dat_2016 <- dat[dat$year == 2016, ] +dat_2017 <- dat[dat$year == 2017, ] +dat_2015$Hate_all_muni_1517 <- dat_2015$Hate_all_muni + dat_2016$Hate_all_muni + dat_2017$Hate_all_muni +dat_2015$Hate_all_muni_1517_bin <- ifelse(dat_2015$Hate_all_muni_1517 > 0, 1, 0) +round(mean(dat_2015$Hate_all_muni_1517_bin)*100) + +# Point Estimates that we mention when discussing Figure 1 +# Remove Extreme Value of Excess Males +range_x <- quantile(dat_2015$pop_15_44_muni_gendergap_2015, c(0.025, 0.975), na.rm = TRUE) +dat_2015_s <- dat_2015[dat_2015$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat_2015$pop_15_44_muni_gendergap_2015 <= range_x[2], ] +dat_s <- dat[dat$pop_15_44_muni_gendergap_2015 >= range_x[1] & + dat$pop_15_44_muni_gendergap_2015 <= range_x[2], ] + +# The size of population for exxluded municipalities +dat_exc <- dat[dat$pop_15_44_muni_gendergap_2015 < range_x[1] | + dat$pop_15_44_muni_gendergap_2015 > range_x[2], ] + +ceiling(median(dat_exc$population_muni_2015, na.rm = TRUE)) # 247 + +# sum +bin_1_sum <- bin.summary(Hate_all_muni_1517_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(ags_state), + id = "ags_county", data = dat_2015_s) + +# annual +bin_1_p <- bin.summary(Hate_all_muni_bin ~ + pop_15_44_muni_gendergap_2015 + + log_population_muni_2015 + log_popdens_muni_2015 + + log_unemp_all_muni_2015 + d_pop1511_muni + vote_afd_2013_muni + + log_ref_inflow_1514 + log_pop_ref_2014 + log_violence_percap_2015 + ## county level + pc_hidegree_all2011 + d_manuf1115 + pc_manufacturing_2015 + ## county level + unemp_gendergap_2015 + as.factor(ags_state) + as.factor(year), + id = "ags_county", data = dat_s) + +# Excess Males +# Effect Estimation +bin_1_sum_effect <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.2)) + +bin_1_p_effect <- marginal_effect(bin_1_p, + newdata = dat_s, family = "logit", + main_var = "pop_15_44_muni_gendergap_2015", + difference = TRUE, + treat_range = c(1, 1.2)) + +# Point estimate +round(bin_1_sum_effect$out_main[1:3]*100, 2) +# 2.5% 97.5% +# 0.88 2.60 4.19 +round(bin_1_p_effect$out_main[1:3]*100, 2) +# 2.5% 97.5% +# 0.76 1.71 2.55 + + +## Comparing to round(bin_1_sum_effect$out_main[1:3]*100, 2) +## The Effect of Unemployment +effect_unemp <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "log_unemp_all_muni_2015", + difference = TRUE, + treat_range = quantile(dat_2015_s$log_unemp_all_muni_2015, prob = c(0.2, 0.8), + na.rm = TRUE)) +round(effect_unemp$out_main[1:3]*100, 2) # 2.60 is more than half of 4.24 + +## The Effect of Education +effect_educ <- marginal_effect(bin_1_sum, + newdata = dat_2015_s, family = "logit", + main_var = "pc_hidegree_all2011", + difference = TRUE, + treat_range = quantile(dat_2015_s$pc_hidegree_all2011, prob = c(0.8, 0.2), + na.rm = TRUE)) +round(effect_educ$out_main[1:3]*100, 2) +# 2.60 is more than twice of 1.20 + + +# Correlation between Excess Males and Male Disadvantage +round(cor(dat_2015_s$pop_15_44_muni_gendergap_2015, dat_2015_s$unemp_gendergap_2015, use = "complete.obs"), 3) + + +# ############### +# Sub Section: Mate Competition and Support for Anti-Refugee Hate Crime +# ############### +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("pBrackets") # pBrackets_1.0 +# install.packages("stargazer") # stargazer_5.2.2 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(pBrackets) # pBrackets_1.0 +require(stargazer) # stargazer_5.2.2 +source("Help.R") + +dat <- read.dta13(file = "survey.dta") + +# Subset to people in the wave 4 +dat_use <- dat[dat$wave == 4, ] + +# Prepare Two data sets +dat_male <- dat_use[dat_use$gender == "Male" & dat_use$age <= 44 & dat_use$age >= 18, ] +dat_male_y <- dat_use[dat_use$gender == "Male" & dat_use$age <= 40 & dat_use$age >= 30, ] + +# Overall Samples +dat_use$MateComp.cont_bin <- ifelse(dat_use$MateComp.cont >= 3, 1, 0) +dat_use$excess_c <- ifelse(dat_use$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_use$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all <- tapply(dat_use$MateComp.cont_bin, dat_use$excess_c, mean) +se_all <- tapply(dat_use$MateComp.cont_bin, dat_use$excess_c, sd)/sqrt(table(dat_use$excess_c)) + +# Male (18 - 44) +dat_male$MateComp.cont_bin <- ifelse(dat_male$MateComp.cont >= 3, 1, 0) +dat_male$excess_c <- ifelse(dat_male$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_male$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all_m <- tapply(dat_male$MateComp.cont_bin, dat_male$excess_c, mean) +se_all_m <- tapply(dat_male$MateComp.cont_bin, dat_male$excess_c, sd)/sqrt(table(dat_male$excess_c)) + +# Male (30 - 40) +dat_male_y$MateComp.cont_bin <- ifelse(dat_male_y$MateComp.cont >= 3, 1, 0) +dat_male_y$excess_c <- ifelse(dat_male_y$pop_15_44_muni_gendergap_2015 < 1.04, "1", + ifelse(dat_male_y$pop_15_44_muni_gendergap_2015 < 1.12, "2", "3")) +mean_all_y <- tapply(dat_male_y$MateComp.cont_bin, dat_male_y$excess_c, mean) +se_all_y <- tapply(dat_male_y$MateComp.cont_bin, dat_male_y$excess_c, sd)/sqrt(table(dat_male_y$excess_c)) + + +round(mean_all,2)[c(1,3)] ## 0.18 0.22 +round(mean_all_m,2)[c(1,3)] ## 0.23 0.38 +round(mean_all_y,2)[c(1,3)] ## 0.17 0.47 + +# ################ +# List Experiment +# ############### +rm(list=ls()) +# install.packages("readstata13") # readstata13_0.9.2 +# install.packages("MASS") # MASS_7.3-51.6 +# install.packages("sandwich") # sandwich_2.5-1 +# install.packages("lmtest") # lmtest_0.9-37 +# install.packages("list") # list_9.2 + +require(readstata13) # readstata13_0.9.2 +require(MASS) # MASS_7.3-51.6 +require(sandwich) # sandwich_2.5-1 +require(lmtest) # lmtest_0.9-37 +require(list) # list_9.2 + +dat <- read.dta13(file = "survey.dta") +data.u2 <- dat[dat$wave == 2, ] + +# Means: When it comes to the refugee problem, violence is sometimes the only means that citizens have to get the attention of German politicians +data.list.u2 <- data.u2[data.u2$list == "1",] +data.direct.u2 <- data.u2[data.u2$list == "2",] +data.list.u2 <- data.list.u2[is.na(data.list.u2$treatment_list)==FALSE,] +data.list.u2$List.treat <- ifelse(data.list.u2$treatment_list == "Scenario 2", 1, 0) + +# The mean for Control Group +round(mean(data.list.u2$outcome_list[data.list.u2$List.treat == 0]), 2) +# The mean for Treatment Group +round(mean(data.list.u2$outcome_list[data.list.u2$List.treat == 1]), 2) +# Please see "SurveyAnalysis_Main.R" for complete analysis, which was used to create Figure 3. +# Here, we only reproduce the code for numbers we mention in the paper. + +## Compare to All People who answered Direct Question (n = 2170) +data.u2.all.direct <- data.u2[is.na(data.u2$hate_violence_means) == FALSE, ] +data.u2.all.direct$hate.direct.bin <- ifelse(data.u2.all.direct$hate_violence_means >=3, 1, 0) +round(mean(data.u2.all.direct$hate.direct.bin)*100) ## 18 \ No newline at end of file diff --git a/32/replication_package/out_count_table.rdata b/32/replication_package/out_count_table.rdata new file mode 100644 index 0000000000000000000000000000000000000000..a27a7741fc58beed003573fffa5740186b9d548a --- /dev/null +++ b/32/replication_package/out_count_table.rdata @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ccd234462ece80c73745d90e9e27c76c646e09715a4f23e4f875725a6006dd5 +size 10955242 diff --git a/32/replication_package/produce_context_data.do b/32/replication_package/produce_context_data.do new file mode 100644 index 0000000000000000000000000000000000000000..60a5c9b04d8d1c1126c62138d5298a375d4fb45d --- /dev/null +++ b/32/replication_package/produce_context_data.do @@ -0,0 +1,89 @@ +************************************************************* +*Purpose: Merge context data and generate additional vars +*Stata Version: 16 +************************************************************* + +*------------------------------- +*generate merged_context_1.dta +*------------------------------- +use "source_data/unemployment.dta", clear + +*unemployment gendergap +*---------------------- +gen unemp_gendergap = unemp_men/unemp_female +label var unemp_gendergap "male unemployment rate / female unemployment rate" + +rename ags_dist ags_county // "county" and "district" used as synonyms +label var ags_c " Identifier for County" +save "source_data/merged_context_1.dta",replace + +*----------------------------- +*generate merged_context_2.dta +*----------------------------- + +*unemployment data +*------------------- +use "source_data/unemployment.dta", clear + +gen unemp_gendergap = unemp_men/unemp_female +label var unemp_gendergap "male unemployment rate / female unemployment rate" + +save "source_data/temp1.dta", replace + +*refugees by gender +*------------------- +use "source_data/refugee_gender.dta", clear + +egen ref_male = rowtotal(all_male0_3 all_male3_6 all_male6_15 all_male15_18 all_male18_25 all_male25_30 all_male30_40 all_male40_50 all_male50_65 all_male65_75 all_male75_up) +gen pc_ref_male = ref_male*100/all_totref +label var pc_ref_male "% male refugees, of all refugees" +label var ref_male "total number of male refugees (all ages)" + +save "source_data/temp2.dta", replace + +*education +*---------- +use "source_data/education.dta", clear + +*high degree +gen pc_hidegree_all2011 = pop15_high_degree*100/pop15_total +label var pc_hidegree_all2011 "% population with university entrance exam, incl. still in school" // (census 2011) + +save "source_data/temp3.dta", replace + + +* sector +*-------- +use "source_data/sectors.dta", clear + +gen pc_manufacturing = no_manufacturing/no_employed +label var pc_manufacturing "pc_manufacturing" + +save "source_data/temp4.dta", replace + +*merge data +*---------- +/* +this is a more comprehensive dataset - start by using a master data file +that includes the ags year combinations we need +*/ + +use "source_data/population.dta" + +merge 1:1 ags year using "source_data/temp1.dta" // unemployment +drop _m +merge 1:1 ags year using "source_data/temp2.dta" // refugees +drop _m +merge m:1 ags using "source_data/temp3.dta" // education in 2011 this m:1 merge +drop _m +merge 1:1 ags year using "source_data/temp4.dta" //sectors +drop _m + +rename ags_dist ags_county // "county" and "district" used as synonyms +label var ags_c " Identifier for County" + +save "source_data/merged_context_2.dta",replace +erase "source_data/temp1.dta" +erase "source_data/temp2.dta" +erase "source_data/temp3.dta" +erase "source_data/temp4.dta" diff --git a/32/replication_package/source_context.pdf b/32/replication_package/source_context.pdf new file mode 100644 index 0000000000000000000000000000000000000000..909b37240b46e4ecae68f161afcead130e9202d5 --- /dev/null +++ b/32/replication_package/source_context.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f795cd86bfb2e74eef85962eca903471790639cd848c998934406a6208d6eed3 +size 157393 diff --git a/32/replication_package/source_context_placebo.pdf b/32/replication_package/source_context_placebo.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8c0f259c87899f37929b2820771012fb1afc431d --- /dev/null +++ b/32/replication_package/source_context_placebo.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a93779e37456c5055ae0b1386564fbba9616c1c8669176130110fd177dedc88 +size 180992 diff --git a/32/replication_package/source_data/area_mun.dta b/32/replication_package/source_data/area_mun.dta new file mode 100644 index 0000000000000000000000000000000000000000..5abd77ff52d7aaff7f9d39343aca99ece51632fc --- /dev/null +++ b/32/replication_package/source_data/area_mun.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbbc3f1c2ef170246e40c6b32ce440b9d60aaae466c89f51a8d81ba278988b2e +size 765299 diff --git a/32/replication_package/source_data/base.dta b/32/replication_package/source_data/base.dta new file mode 100644 index 0000000000000000000000000000000000000000..f1ef032ca6af6e5a199521471f12ca9627d8904a --- /dev/null +++ b/32/replication_package/source_data/base.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5af5c1de4f9362caa1eb1fe0233241b34f721512416bf8daa79a69fd79ec66a +size 844133 diff --git a/32/replication_package/source_data/base_pl.dta b/32/replication_package/source_data/base_pl.dta new file mode 100644 index 0000000000000000000000000000000000000000..7a98c13d7744d202bb12b5bc9647cd6b494d33af --- /dev/null +++ b/32/replication_package/source_data/base_pl.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da54848f03aae66e23beef62ef0edd781f03869355c09408b72c31d002b65fba +size 694698 diff --git a/32/replication_package/source_data/crime.dta b/32/replication_package/source_data/crime.dta new file mode 100644 index 0000000000000000000000000000000000000000..1d0eaf21dccf141a5aa4a5ebe85033b6d3b21833 --- /dev/null +++ b/32/replication_package/source_data/crime.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d93d6b20b821852be117c8715e33636ac432aeaf2314d20eedca14107b66573 +size 21664 diff --git a/32/replication_package/source_data/education.dta b/32/replication_package/source_data/education.dta new file mode 100644 index 0000000000000000000000000000000000000000..3960ab0a82255ab27a39f3f8ea95bf6f4a5fd883 --- /dev/null +++ b/32/replication_package/source_data/education.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fee3371a6aa2fbdb92bf1bfd861f0d460f2eb55daa9d9f5f08e1dc47cac50865 +size 39650 diff --git a/32/replication_package/source_data/hate.dta b/32/replication_package/source_data/hate.dta new file mode 100644 index 0000000000000000000000000000000000000000..d25b737071a2aa96f27c6ae61013ebb4ef1db479 --- /dev/null +++ b/32/replication_package/source_data/hate.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17d13a62e1abead6692c79bb476766e41e6fd64701be85c14549f77afeb6130d +size 2143165 diff --git a/32/replication_package/source_data/merged_context_1.dta b/32/replication_package/source_data/merged_context_1.dta new file mode 100644 index 0000000000000000000000000000000000000000..e341e619f1e058e20505eb2743a063ba73bc077c --- /dev/null +++ b/32/replication_package/source_data/merged_context_1.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2df0c90bf9b8e38d80bab08f85de2b3f87df05861233b2deb276c3ed9162e7b9 +size 241539 diff --git a/32/replication_package/source_data/merged_context_2.dta b/32/replication_package/source_data/merged_context_2.dta new file mode 100644 index 0000000000000000000000000000000000000000..9942845b64f70f19c5b1bb6edd5a94b25a7e2bf4 --- /dev/null +++ b/32/replication_package/source_data/merged_context_2.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf108efd04187720950b11bb72d30c929a26ae6ffa4ba009bafc37694f2d3cad +size 1323816 diff --git a/32/replication_package/source_data/pop_gemeinde_2008_2018.dta b/32/replication_package/source_data/pop_gemeinde_2008_2018.dta new file mode 100644 index 0000000000000000000000000000000000000000..1d8a3222e0f73297904c250d88053d10d534fa23 --- /dev/null +++ b/32/replication_package/source_data/pop_gemeinde_2008_2018.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d80379610f6d011650aee5a4e8d5e289a626460ae568dd7feae5f6257bbb27d5 +size 77180609 diff --git a/32/replication_package/source_data/pop_kreise_2015_2017.dta b/32/replication_package/source_data/pop_kreise_2015_2017.dta new file mode 100644 index 0000000000000000000000000000000000000000..903178555abef9fa7a2fd28e4da4ba9f1e549b12 --- /dev/null +++ b/32/replication_package/source_data/pop_kreise_2015_2017.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea3561218aa950bd9c682d3d242ab979e9d5bc23177e7ea6d268468a0ce7c958 +size 26488 diff --git a/32/replication_package/source_data/population.dta b/32/replication_package/source_data/population.dta new file mode 100644 index 0000000000000000000000000000000000000000..5be7fc83298bd86da91b2f5ff72b444e8e7a950f --- /dev/null +++ b/32/replication_package/source_data/population.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7fe4cba1be98e195be54a00e5a827d5b1e2fda56093054bcafa22f2ec909a93 +size 46987 diff --git a/32/replication_package/source_data/refugee_gender.dta b/32/replication_package/source_data/refugee_gender.dta new file mode 100644 index 0000000000000000000000000000000000000000..b07853374105020dee0177b37ec0eca5b9723440 --- /dev/null +++ b/32/replication_package/source_data/refugee_gender.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b2126acb78af60c555ccaebbe1c024401569df114540b0a9ab47d61da06f264 +size 127827 diff --git a/32/replication_package/source_data/refugees_2008_2017.dta b/32/replication_package/source_data/refugees_2008_2017.dta new file mode 100644 index 0000000000000000000000000000000000000000..add0f9bb2c050bf4f17fc8849144cb72834e9dc8 --- /dev/null +++ b/32/replication_package/source_data/refugees_2008_2017.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fc45783e4a4f51ba663d22f766b5fe56639a075ae9c5f9b9e635602632f4118 +size 1380624 diff --git a/32/replication_package/source_data/sectors.dta b/32/replication_package/source_data/sectors.dta new file mode 100644 index 0000000000000000000000000000000000000000..b357e891882e8e4379930bcbb173a305c8f29383 --- /dev/null +++ b/32/replication_package/source_data/sectors.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bca2f44da65dee4c54c9ff2804b69b6a911715ae96a59198a0f6a367a93f456 +size 488307 diff --git a/32/replication_package/source_data/unempl_gemeinde_2008_2017.dta b/32/replication_package/source_data/unempl_gemeinde_2008_2017.dta new file mode 100644 index 0000000000000000000000000000000000000000..3a81dc30ef308feba4763e4a87f303d52467be5a --- /dev/null +++ b/32/replication_package/source_data/unempl_gemeinde_2008_2017.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4c2ba9d7c5964f1671530e94d565bc029b2355dbd0e1dc78ef4a82ab0b948be +size 8082440 diff --git a/32/replication_package/source_data/unemployment.dta b/32/replication_package/source_data/unemployment.dta new file mode 100644 index 0000000000000000000000000000000000000000..ca85be6169574a07d7d6ae5e1284f87154bcc4be --- /dev/null +++ b/32/replication_package/source_data/unemployment.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:714cc77c4840d0fa99a155e2dd7498b2b0c6a63a4effe64381adf44b82a59513 +size 231439 diff --git a/32/replication_package/source_data/voting.dta b/32/replication_package/source_data/voting.dta new file mode 100644 index 0000000000000000000000000000000000000000..7e45ff3dfa9d5b23b6aeba3ba88ff7c29eabf017 --- /dev/null +++ b/32/replication_package/source_data/voting.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7be35304a013490ee92c5fbb6dedc75032dc731f70eaab99833448f8b0186fb9 +size 1705216 diff --git a/32/replication_package/survey.dta b/32/replication_package/survey.dta new file mode 100644 index 0000000000000000000000000000000000000000..23b750e93a46adb4985932a7fd0a71c698f733d5 --- /dev/null +++ b/32/replication_package/survey.dta @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40d6fa1133cfe63c006fc7d37c89a0980f1cf2559fa83537d0ac4339b314fc6e +size 4702645 diff --git a/32/replication_package/table1.tex b/32/replication_package/table1.tex new file mode 100644 index 0000000000000000000000000000000000000000..869e02a09107cb3949b1f09331380b07a8180b90 --- /dev/null +++ b/32/replication_package/table1.tex @@ -0,0 +1,34 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:30:28 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & \multicolumn{5}{c}{hate\_violence\_means} & formula.6 \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Mate Competition & 0.437$^{***}$ & 0.263$^{***}$ & 0.236$^{***}$ & 0.206$^{***}$ & 0.185$^{***}$ & 0.155$^{***}$ \\ + & (0.016) & (0.020) & (0.021) & (0.019) & (0.019) & (0.019) \\ + & & & & & & \\ + Job Competition & & 0.250$^{***}$ & 0.236$^{***}$ & 0.077$^{***}$ & 0.065$^{***}$ & 0.056$^{***}$ \\ + & & (0.019) & (0.019) & (0.020) & (0.020) & (0.019) \\ + & & & & & & \\ + Life Satisfaction & & $-$0.015$^{**}$ & $-$0.014$^{*}$ & $-$0.003 & $-$0.002 & $-$0.0001 \\ + & & (0.006) & (0.007) & (0.006) & (0.006) & (0.006) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 3,019 & 3,019 & 3,008 & 3,008 & 3,008 & 3,008 \\ +R$^{2}$ & 0.191 & 0.240 & 0.288 & 0.394 & 0.410 & 0.459 \\ +Adjusted R$^{2}$ & 0.191 & 0.240 & 0.267 & 0.371 & 0.382 & 0.431 \\ +Residual Std. Error & 0.799 (df = 3017) & 0.775 (df = 3015) & 0.760 (df = 2921) & 0.704 (df = 2897) & 0.698 (df = 2873) & 0.670 (df = 2857) \\ +F Statistic & 714.588$^{***}$ (df = 1; 3017) & 317.891$^{***}$ (df = 3; 3015) & 13.756$^{***}$ (df = 86; 2921) & 17.141$^{***}$ (df = 110; 2897) & 14.878$^{***}$ (df = 134; 2873) & 16.170$^{***}$ (df = 150; 2857) \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C1.tex b/32/replication_package/table_C1.tex new file mode 100644 index 0000000000000000000000000000000000000000..7d9324e3012def603aada24a28b2f8fe3d50db33 --- /dev/null +++ b/32/replication_package/table_C1.tex @@ -0,0 +1,62 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:32:51 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & 2.127$^{***}$ & 2.132$^{***}$ & 1.598$^{***}$ & 1.549$^{***}$ & 1.406$^{***}$ & 1.537$^{***}$ \\ + & (0.491) & (0.432) & (0.491) & (0.411) & (0.463) & (0.412) \\ + & & & & & & \\ + Log (Population) & 1.730$^{***}$ & 1.519$^{***}$ & 1.619$^{***}$ & 1.392$^{***}$ & 1.522$^{***}$ & 1.372$^{***}$ \\ + & (0.056) & (0.041) & (0.060) & (0.044) & (0.055) & (0.042) \\ + & & & & & & \\ + Log (Population Density) & 0.098 & 0.087$^{*}$ & 0.052 & 0.039 & 0.017 & $-$0.002 \\ + & (0.070) & (0.052) & (0.070) & (0.051) & (0.066) & (0.049) \\ + & & & & & & \\ + Log (Unemployment Rate) & & & 1.087$^{***}$ & 1.028$^{***}$ & 0.634$^{***}$ & 0.715$^{***}$ \\ + & & & (0.180) & (0.142) & (0.156) & (0.130) \\ + & & & & & & \\ + % of population change (2011 vs 2015) & & & $-$0.617 & $-$0.235 & $-$0.299 & 0.020 \\ + & & & (0.975) & (0.608) & (0.851) & (0.541) \\ + & & & & & & \\ + Vote share for AfD (2013) & & & 5.618$^{*}$ & 4.822$^{**}$ & 5.358 & 3.178 \\ + & & & (3.116) & (2.406) & (3.384) & (2.718) \\ + & & & & & & \\ + Log (Refugee Inflow) (2014 vs 2015) & & & & & 0.857$^{***}$ & 0.734$^{***}$ \\ + & & & & & (0.324) & (0.261) \\ + & & & & & & \\ + Log (Refugee Size) (2014) & & & & & $-$0.210$^{**}$ & $-$0.192$^{**}$ \\ + & & & & & (0.104) & (0.084) \\ + & & & & & & \\ + Log (General Violence per capita) & & & & & 0.136 & 0.022 \\ + & & & & & (0.189) & (0.151) \\ + & & & & & & \\ + % of High Education & & & & & $-$0.022$^{*}$ & $-$0.018$^{*}$ \\ + & & & & & (0.013) & (0.011) \\ + & & & & & & \\ + Change in Manufacturing Share (2011 vs 2015) & & & & & 8.177$^{**}$ & 9.588$^{***}$ \\ + & & & & & (4.062) & (3.167) \\ + & & & & & & \\ + Share of Manufacturing & & & & & 0.057 & $-$0.306 \\ + & & & & & (0.750) & (0.606) \\ + & & & & & & \\ + Male Disadvantage & & & & & 0.920$^{**}$ & 0.846$^{***}$ \\ + & & & & & (0.371) & (0.319) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 10,307 & 30,921 & 10,029 & 30,087 & 9,282 & 27,846 \\ +Log Likelihood & $-$2,813.561 & $-$5,645.573 & $-$2,771.915 & $-$5,487.582 & $-$2,776.250 & $-$5,290.740 \\ +Akaike Inf. Crit. & 6,433.122 & 12,101.150 & 6,141.830 & 11,577.160 & 5,600.500 & 10,633.480 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C2.tex b/32/replication_package/table_C2.tex new file mode 100644 index 0000000000000000000000000000000000000000..cf9c915771905030b21be156fdd04f2832ec0c80 --- /dev/null +++ b/32/replication_package/table_C2.tex @@ -0,0 +1,62 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:35:11 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Excess Males (Age 25 - 44) & 1.595$^{***}$ & 1.794$^{***}$ & 0.958$^{**}$ & 1.066$^{***}$ & 0.932$^{**}$ & 1.192$^{***}$ \\ + & (0.454) & (0.400) & (0.456) & (0.373) & (0.430) & (0.364) \\ + & & & & & & \\ + Log (Population) & 1.726$^{***}$ & 1.511$^{***}$ & 1.614$^{***}$ & 1.387$^{***}$ & 1.518$^{***}$ & 1.365$^{***}$ \\ + & (0.056) & (0.041) & (0.059) & (0.043) & (0.054) & (0.042) \\ + & & & & & & \\ + Log (Population Density) & 0.082 & 0.073 & 0.030 & 0.019 & 0.001 & $-$0.014 \\ + & (0.070) & (0.052) & (0.070) & (0.051) & (0.066) & (0.049) \\ + & & & & & & \\ + Log (Unemployment Rate) & & & 1.120$^{***}$ & 1.039$^{***}$ & 0.642$^{***}$ & 0.704$^{***}$ \\ + & & & (0.184) & (0.145) & (0.157) & (0.131) \\ + & & & & & & \\ + % of population change (2011 vs 2015) & & & $-$0.463 & $-$0.023 & $-$0.207 & 0.156 \\ + & & & (0.905) & (0.554) & (0.816) & (0.511) \\ + & & & & & & \\ + Vote share for AfD (2013) & & & 5.974$^{*}$ & 5.282$^{**}$ & 5.776$^{*}$ & 3.771 \\ + & & & (3.088) & (2.400) & (3.366) & (2.699) \\ + & & & & & & \\ + Log (Refugee Inflow) (2014 vs 2015) & & & & & 0.859$^{***}$ & 0.705$^{***}$ \\ + & & & & & (0.324) & (0.263) \\ + & & & & & & \\ + Log (Refugee Size) (2014) & & & & & $-$0.211$^{**}$ & $-$0.191$^{**}$ \\ + & & & & & (0.103) & (0.084) \\ + & & & & & & \\ + Log (General Violence per capita) & & & & & 0.130 & 0.019 \\ + & & & & & (0.187) & (0.149) \\ + & & & & & & \\ + % of High Education & & & & & $-$0.022$^{*}$ & $-$0.018$^{*}$ \\ + & & & & & (0.013) & (0.010) \\ + & & & & & & \\ + Change in Manufacturing Share (2011 vs 2015) & & & & & 8.213$^{**}$ & 9.464$^{***}$ \\ + & & & & & (4.029) & (3.139) \\ + & & & & & & \\ + Share of Manufacturing & & & & & 0.076 & $-$0.318 \\ + & & & & & (0.748) & (0.603) \\ + & & & & & & \\ + Male Disadvantage & & & & & 0.910$^{**}$ & 0.856$^{***}$ \\ + & & & & & (0.369) & (0.316) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 10,378 & 31,134 & 10,097 & 30,291 & 9,288 & 27,864 \\ +Log Likelihood & $-$2,823.656 & $-$5,669.987 & $-$2,781.008 & $-$5,512.023 & $-$2,782.381 & $-$5,312.211 \\ +Akaike Inf. Crit. & 6,453.312 & 12,149.970 & 6,160.016 & 11,626.050 & 5,612.761 & 10,676.420 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C3.tex b/32/replication_package/table_C3.tex new file mode 100644 index 0000000000000000000000000000000000000000..acfa13065ab303209b49f5dea29481e3e0f384f7 --- /dev/null +++ b/32/replication_package/table_C3.tex @@ -0,0 +1,64 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:35:27 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & 0.116$^{***}$ & 0.069$^{***}$ & 0.089$^{***}$ & 0.051$^{***}$ & 0.095$^{***}$ & 0.057$^{***}$ \\ + & (0.027) & (0.015) & (0.025) & (0.013) & (0.026) & (0.014) \\ + & & & & & & \\ + Log (Population) & 0.162$^{***}$ & 0.086$^{***}$ & 0.156$^{***}$ & 0.081$^{***}$ & 0.152$^{***}$ & 0.078$^{***}$ \\ + & (0.009) & (0.005) & (0.008) & (0.004) & (0.008) & (0.004) \\ + & & & & & & \\ + Log (Population Density) & 0.011 & 0.011$^{***}$ & 0.010 & 0.011$^{***}$ & 0.008 & 0.008$^{**}$ \\ + & (0.007) & (0.004) & (0.007) & (0.003) & (0.007) & (0.003) \\ + & & & & & & \\ + Log (Unemployment Rate) & & & 0.137$^{***}$ & 0.090$^{***}$ & 0.093$^{***}$ & 0.066$^{***}$ \\ + & & & (0.015) & (0.009) & (0.014) & (0.008) \\ + & & & & & & \\ + % of population change (2011 vs 2015) & & & $-$0.059 & $-$0.031 & 0.024 & 0.025 \\ + & & & (0.086) & (0.041) & (0.100) & (0.050) \\ + & & & & & & \\ + Vote share for AfD (2013) & & & 0.307$^{**}$ & 0.120$^{*}$ & 0.370$^{**}$ & 0.106 \\ + & & & (0.147) & (0.069) & (0.182) & (0.089) \\ + & & & & & & \\ + Log (Refugee Inflow) (2014 vs 2015) & & & & & 0.075 & 0.046 \\ + & & & & & (0.051) & (0.029) \\ + & & & & & & \\ + Log (Refugee Size) (2014) & & & & & $-$0.019 & $-$0.011 \\ + & & & & & (0.014) & (0.007) \\ + & & & & & & \\ + Log (General Violence per capita) & & & & & 0.010 & 0.007 \\ + & & & & & (0.021) & (0.011) \\ + & & & & & & \\ + % of High Education & & & & & $-$0.003$^{*}$ & $-$0.002$^{**}$ \\ + & & & & & (0.002) & (0.001) \\ + & & & & & & \\ + Change in Manufacturing Share (2011 vs 2015) & & & & & 0.725 & 0.583$^{**}$ \\ + & & & & & (0.489) & (0.243) \\ + & & & & & & \\ + Share of Manufacturing & & & & & 0.021 & $-$0.023 \\ + & & & & & (0.092) & (0.048) \\ + & & & & & & \\ + Male Disadvantage & & & & & 0.114$^{**}$ & 0.063$^{**}$ \\ + & & & & & (0.047) & (0.025) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 10,307 & 30,921 & 10,029 & 30,087 & 9,282 & 27,846 \\ +R$^{2}$ & 0.366 & 0.252 & 0.347 & 0.204 & 0.302 & 0.180 \\ +Adjusted R$^{2}$ & 0.340 & 0.242 & 0.327 & 0.196 & 0.301 & 0.179 \\ +Residual Std. Error & 0.316 (df = 9904) & 0.247 (df = 30516) & 0.314 (df = 9730) & 0.246 (df = 29786) & 0.320 (df = 9258) & 0.248 (df = 27820) \\ +F Statistic & 14.206$^{***}$ (df = 402; 9904) & 25.480$^{***}$ (df = 404; 30516) & 17.368$^{***}$ (df = 298; 9730) & 25.406$^{***}$ (df = 300; 29786) & 174.490$^{***}$ (df = 23; 9258) & 244.318$^{***}$ (df = 25; 27820) \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C4.tex b/32/replication_package/table_C4.tex new file mode 100644 index 0000000000000000000000000000000000000000..2314a9e783a2a0d88048bf03390e5cf7fb0078b0 --- /dev/null +++ b/32/replication_package/table_C4.tex @@ -0,0 +1,62 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:34 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & Physical\_muni\_1517\_bin & Physical\_muni\_bin & Physical\_muni\_1517\_bin & Physical\_muni\_bin & Physical\_muni\_1517\_bin & Physical\_muni\_bin \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & 3.773$^{***}$ & 3.038$^{***}$ & 2.624$^{***}$ & 1.906$^{**}$ & 2.719$^{***}$ & 1.634$^{*}$ \\ + & (0.938) & (0.818) & (0.910) & (0.744) & (0.944) & (0.902) \\ + & & & & & & \\ + Log (Population) & 1.775$^{***}$ & 1.640$^{***}$ & 1.562$^{***}$ & 1.429$^{***}$ & 1.442$^{***}$ & 1.366$^{***}$ \\ + & (0.120) & (0.090) & (0.124) & (0.100) & (0.106) & (0.101) \\ + & & & & & & \\ + Log (Population Density) & 0.096 & 0.071 & 0.080 & 0.045 & 0.046 & $-$0.018 \\ + & (0.134) & (0.109) & (0.129) & (0.103) & (0.113) & (0.105) \\ + & & & & & & \\ + Log (Unemployment Rate) & & & 1.591$^{***}$ & 1.515$^{***}$ & 1.179$^{***}$ & 1.309$^{***}$ \\ + & & & (0.346) & (0.304) & (0.282) & (0.256) \\ + & & & & & & \\ + % of population change (2011 vs 2015) & & & $-$0.837 & $-$0.368 & 0.023 & 0.154 \\ + & & & (0.772) & (0.721) & (0.580) & (0.555) \\ + & & & & & & \\ + Vote share for AfD (2013) & & & 2.058 & 0.875 & 0.588 & 0.763 \\ + & & & (6.640) & (6.184) & (5.209) & (5.080) \\ + & & & & & & \\ + Log (Refugee Inflow) (2014 vs 2015) & & & & & 0.262 & $-$0.091 \\ + & & & & & (0.686) & (0.646) \\ + & & & & & & \\ + Log (Refugee Size) (2014) & & & & & $-$0.429$^{**}$ & $-$0.288 \\ + & & & & & (0.210) & (0.202) \\ + & & & & & & \\ + Log (General Violence per capita) & & & & & $-$0.303 & $-$0.288 \\ + & & & & & (0.383) & (0.383) \\ + & & & & & & \\ + % of High Education & & & & & $-$0.011 & $-$0.018 \\ + & & & & & (0.024) & (0.023) \\ + & & & & & & \\ + Change in Manufacturing Share (2011 vs 2015) & & & & & 4.548 & $-$0.633 \\ + & & & & & (8.376) & (8.393) \\ + & & & & & & \\ + Share of Manufacturing & & & & & 1.859 & 2.050 \\ + & & & & & (1.742) & (1.632) \\ + & & & & & & \\ + Male Disadvantage & & & & & 1.258 & 1.217 \\ + & & & & & (0.800) & (0.786) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 10,307 & 30,921 & 10,029 & 30,087 & 9,282 & 27,846 \\ +Log Likelihood & $-$842.859 & $-$1,447.433 & $-$820.949 & $-$1,339.173 & $-$884.639 & $-$1,339.369 \\ +Akaike Inf. Crit. & 2,491.718 & 3,704.866 & 2,239.899 & 3,280.346 & 1,817.279 & 2,730.737 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C5.tex b/32/replication_package/table_C5.tex new file mode 100644 index 0000000000000000000000000000000000000000..ba08416faa4de4da507adf9fc5256c3d10130a32 --- /dev/null +++ b/32/replication_package/table_C5.tex @@ -0,0 +1,63 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:36 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{2}{c}{\textit{Dependent variable:}} \\ +\cline{2-3} +\\[-1.8ex] & Hate\_all\_muni\_1517 & Hate\_all\_muni \\ +\\[-1.8ex] & (1) & (2)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & 1.150$^{***}$ & 1.246$^{***}$ \\ + & (0.366) & (0.363) \\ + & & \\ + Log (Population) & 1.264$^{***}$ & 1.249$^{***}$ \\ + & (0.039) & (0.038) \\ + & & \\ + Log (Population Density) & $-$0.032 & $-$0.030 \\ + & (0.045) & (0.045) \\ + & & \\ + Log (Unemployment Rate) & 0.703$^{***}$ & 0.729$^{***}$ \\ + & (0.131) & (0.129) \\ + & & \\ + % of population change (2011 vs 2015) & 0.072 & 0.096 \\ + & (0.508) & (0.457) \\ + & & \\ + Vote share for AfD (2013) & 4.464$^{*}$ & 4.088 \\ + & (2.670) & (2.670) \\ + & & \\ + Log (Refugee Inflow) (2014 vs 2015) & 0.588$^{**}$ & 0.541$^{**}$ \\ + & (0.280) & (0.272) \\ + & & \\ + Log (Refugee Size) (2014) & $-$0.189$^{**}$ & $-$0.180$^{*}$ \\ + & (0.093) & (0.093) \\ + & & \\ + Log (General Violence per capita) & 0.034 & $-$0.016 \\ + & (0.161) & (0.165) \\ + & & \\ + % of High Education & $-$0.017 & $-$0.017$^{*}$ \\ + & (0.011) & (0.011) \\ + & & \\ + Change in Manufacturing Share (2011 vs 2015) & 10.081$^{***}$ & 10.432$^{***}$ \\ + & (3.333) & (3.452) \\ + & & \\ + Share of Manufacturing & $-$0.028 & $-$0.035 \\ + & (0.651) & (0.632) \\ + & & \\ + Male Disadvantage & 0.617$^{*}$ & 0.656$^{*}$ \\ + & (0.337) & (0.345) \\ + & & \\ +\hline \\[-1.8ex] +Observations & 9,282 & 27,846 \\ +Log Likelihood & $-$5,125.037 & $-$7,759.071 \\ +$\theta$ & 1.247$^{***}$ (0.088) & 0.842$^{***}$ (0.053) \\ +Akaike Inf. Crit. & 10,298.070 & 15,570.140 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{2}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C6.tex b/32/replication_package/table_C6.tex new file mode 100644 index 0000000000000000000000000000000000000000..d4afd28bbd62ad9fbd0c3b87d609a7bd84f535ee --- /dev/null +++ b/32/replication_package/table_C6.tex @@ -0,0 +1,68 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:37 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{4}{c}{\textit{Dependent variable:}} \\ +\cline{2-5} +\\[-1.8ex] & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin \\ +\\[-1.8ex] & (1) & (2) & (3) & (4)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & 1.291$^{***}$ & 1.442$^{***}$ & 1.588$^{**}$ & 1.445$^{**}$ \\ + & (0.462) & (0.410) & (0.791) & (0.701) \\ + & & & & \\ + West & 0.075 & $-$0.124 & 0.542 & $-$0.119 \\ + & (0.161) & (0.118) & (1.063) & (0.913) \\ + & & & & \\ + Log (Population) & 1.484$^{***}$ & 1.340$^{***}$ & 1.485$^{***}$ & 1.340$^{***}$ \\ + & (0.046) & (0.039) & (0.046) & (0.039) \\ + & & & & \\ + Log (Population Density) & 0.046 & 0.030 & 0.046 & 0.030 \\ + & (0.061) & (0.048) & (0.061) & (0.048) \\ + & & & & \\ + Log (Unemployment Rate) & 0.585$^{***}$ & 0.653$^{***}$ & 0.577$^{***}$ & 0.653$^{***}$ \\ + & (0.148) & (0.124) & (0.151) & (0.128) \\ + & & & & \\ + % of population change (2011 vs 2015) & 0.050 & 0.308 & 0.072 & 0.308 \\ + & (0.772) & (0.499) & (0.765) & (0.497) \\ + & & & & \\ + Vote share for AfD (2013) & 3.865 & 3.183 & 3.860 & 3.183 \\ + & (3.223) & (2.624) & (3.223) & (2.625) \\ + & & & & \\ + Log (Refugee Inflow) (2014 vs 2015) & 1.475$^{***}$ & 1.282$^{***}$ & 1.471$^{***}$ & 1.282$^{***}$ \\ + & (0.326) & (0.247) & (0.328) & (0.247) \\ + & & & & \\ + Log (Refugee Size) (2014) & $-$0.397$^{***}$ & $-$0.386$^{***}$ & $-$0.396$^{***}$ & $-$0.386$^{***}$ \\ + & (0.094) & (0.079) & (0.094) & (0.079) \\ + & & & & \\ + Log (General Violence per capita) & 0.083 & $-$0.092 & 0.086 & $-$0.092 \\ + & (0.166) & (0.138) & (0.166) & (0.139) \\ + & & & & \\ + % of High Education & $-$0.027$^{**}$ & $-$0.021$^{**}$ & $-$0.027$^{**}$ & $-$0.021$^{**}$ \\ + & (0.012) & (0.010) & (0.012) & (0.010) \\ + & & & & \\ + Change in Manufacturing Share (2011 vs 2015) & 7.554$^{*}$ & 8.568$^{**}$ & 7.560$^{*}$ & 8.568$^{**}$ \\ + & (4.241) & (3.509) & (4.247) & (3.509) \\ + & & & & \\ + Share of Manufacturing & $-$0.332 & $-$0.611 & $-$0.337 & $-$0.611 \\ + & (0.666) & (0.504) & (0.666) & (0.505) \\ + & & & & \\ + Male Disadvantage & 1.077$^{***}$ & 1.015$^{***}$ & 1.084$^{***}$ & 1.016$^{***}$ \\ + & (0.369) & (0.317) & (0.370) & (0.318) \\ + & & & & \\ + Excess Males x West & & & $-$0.419 & $-$0.004 \\ + & & & (0.938) & (0.812) \\ + & & & & \\ +\hline \\[-1.8ex] +Observations & 9,282 & 27,846 & 9,282 & 27,846 \\ +Log Likelihood & $-$2,790.647 & $-$5,310.629 & $-$2,790.555 & $-$5,310.629 \\ +Akaike Inf. Crit. & 5,611.295 & 10,655.260 & 5,613.110 & 10,657.260 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C7.tex b/32/replication_package/table_C7.tex new file mode 100644 index 0000000000000000000000000000000000000000..c5eb8ac457c6e78f256d4250881b0435ba5d5b93 --- /dev/null +++ b/32/replication_package/table_C7.tex @@ -0,0 +1,65 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:38 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{2}{c}{\textit{Dependent variable:}} \\ +\cline{2-3} +\\[-1.8ex] & Hate\_all\_muni\_1517\_bin & Hate\_all\_muni\_bin \\ +\\[-1.8ex] & (1) & (2)\\ +\hline \\[-1.8ex] + Excess Males (Age 15 - 44) & $-$8.441 & $-$17.754 \\ + & (18.923) & (15.168) \\ + & & \\ + Log (Refugee Inflow) (2014 vs 2015) & $-$0.544 & $-$2.018 \\ + & (2.711) & (2.185) \\ + & & \\ + Log (Population) & 1.522$^{***}$ & 1.372$^{***}$ \\ + & (0.055) & (0.042) \\ + & & \\ + Log (Population Density) & 0.019 & 0.001 \\ + & (0.066) & (0.049) \\ + & & \\ + Log (Unemployment Rate) & 0.630$^{***}$ & 0.708$^{***}$ \\ + & (0.155) & (0.130) \\ + & & \\ + % of population change (2011 vs 2015) & $-$0.299 & 0.017 \\ + & (0.856) & (0.548) \\ + & & \\ + Vote share for AfD (2013) & 5.358 & 3.192 \\ + & (3.386) & (2.726) \\ + & & \\ + Log (Refugee Size) (2014) & $-$0.209$^{**}$ & $-$0.190$^{**}$ \\ + & (0.104) & (0.085) \\ + & & \\ + Log (General Violence per capita) & 0.141 & 0.035 \\ + & (0.190) & (0.152) \\ + & & \\ + % of High Education & $-$0.022$^{*}$ & $-$0.019$^{*}$ \\ + & (0.013) & (0.011) \\ + & & \\ + Change in Manufacturing Share (2011 vs 2015) & 8.200$^{**}$ & 9.647$^{***}$ \\ + & (4.077) & (3.200) \\ + & & \\ + Share of Manufacturing & 0.044 & $-$0.335 \\ + & (0.750) & (0.606) \\ + & & \\ + Male Disadvantage & 0.929$^{**}$ & 0.865$^{***}$ \\ + & (0.372) & (0.321) \\ + & & \\ + Excess Males × Log (Refugee Inflow) & 1.290 & 2.524 \\ + & (2.477) & (1.987) \\ + & & \\ +\hline \\[-1.8ex] +Observations & 9,282 & 27,846 \\ +Log Likelihood & $-$2,776.125 & $-$5,289.906 \\ +Akaike Inf. Crit. & 5,602.249 & 10,633.810 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{2}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_C9.tex b/32/replication_package/table_C9.tex new file mode 100644 index 0000000000000000000000000000000000000000..759d486a4e1c493d46f273c03758ea181994c232 --- /dev/null +++ b/32/replication_package/table_C9.tex @@ -0,0 +1,26 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:39 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & \multicolumn{5}{c}{Hate\_all\_muni\_bin} \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Future-Treatment & $-$1.326 & 0.480 & 0.544 & $-$0.277 & $-$0.243 \\ + & (1.551) & (1.061) & (1.592) & (0.773) & (1.043) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 8,939 & 8,681 & 8,679 & 26,299 & 13,147 \\ +Log Likelihood & $-$1,366.904 & $-$2,312.448 & $-$1,546.793 & $-$5,284.379 & $-$4,558.570 \\ +Akaike Inf. Crit. & 2,783.807 & 4,674.896 & 3,143.587 & 10,622.760 & 9,171.140 \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D5_1.tex b/32/replication_package/table_D5_1.tex new file mode 100644 index 0000000000000000000000000000000000000000..80f514ce55e7947106a7b201393da2da1a8d53ff --- /dev/null +++ b/32/replication_package/table_D5_1.tex @@ -0,0 +1,34 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:46 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & formula.7.means & formula.7.justified & formula.7.message & formula.7.prevent & formula.7.condemn \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Mate Competition & 0.155$^{***}$ & 0.173$^{***}$ & 0.192$^{***}$ & 0.204$^{***}$ & 0.027 \\ + & (0.019) & (0.019) & (0.019) & (0.018) & (0.021) \\ + & & & & & \\ + Job Competition & 0.056$^{***}$ & 0.050$^{***}$ & 0.097$^{***}$ & 0.087$^{***}$ & 0.017 \\ + & (0.019) & (0.019) & (0.019) & (0.018) & (0.021) \\ + & & & & & \\ + Life Satisfaction & $-$0.0001 & $-$0.009 & $-$0.004 & $-$0.011$^{*}$ & $-$0.007 \\ + & (0.006) & (0.006) & (0.006) & (0.006) & (0.007) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 3,008 & 3,008 & 3,008 & 3,008 & 3,008 \\ +R$^{2}$ & 0.459 & 0.453 & 0.448 & 0.469 & 0.347 \\ +Adjusted R$^{2}$ & 0.431 & 0.424 & 0.419 & 0.441 & 0.313 \\ +Residual Std. Error (df = 2857) & 0.670 & 0.683 & 0.679 & 0.643 & 0.745 \\ +F Statistic (df = 150; 2857) & 16.170$^{***}$ & 15.746$^{***}$ & 15.462$^{***}$ & 16.814$^{***}$ & 10.136$^{***}$ \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D5_2.tex b/32/replication_package/table_D5_2.tex new file mode 100644 index 0000000000000000000000000000000000000000..d5cd036f34fba93337a71481edb543fb36ce068d --- /dev/null +++ b/32/replication_package/table_D5_2.tex @@ -0,0 +1,40 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:47 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & formula.7\_int.means & formula.7\_int.justified & formula.7\_int.message & formula.7\_int.prevent & formula.7\_int.condemn \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Mate Competition & 0.100$^{***}$ & 0.151$^{***}$ & 0.171$^{***}$ & 0.143$^{***}$ & 0.079$^{**}$ \\ + & (0.035) & (0.036) & (0.036) & (0.034) & (0.039) \\ + & & & & & \\ + West & $-$0.071 & $-$0.052 & $-$0.034 & $-$0.142$^{*}$ & 0.037 \\ + & (0.079) & (0.081) & (0.080) & (0.076) & (0.088) \\ + & & & & & \\ + Job Competition & 0.050$^{***}$ & 0.045$^{**}$ & 0.092$^{***}$ & 0.083$^{***}$ & 0.015 \\ + & (0.019) & (0.019) & (0.019) & (0.018) & (0.021) \\ + & & & & & \\ + Life Satisfaction & $-$0.0001 & $-$0.010 & $-$0.005 & $-$0.011$^{*}$ & $-$0.007 \\ + & (0.006) & (0.006) & (0.006) & (0.006) & (0.007) \\ + & & & & & \\ + Mate Competition x West & 0.072$^{*}$ & 0.032 & 0.029 & 0.079$^{**}$ & $-$0.059 \\ + & (0.037) & (0.038) & (0.038) & (0.036) & (0.041) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 3,008 & 3,008 & 3,008 & 3,008 & 3,008 \\ +R$^{2}$ & 0.457 & 0.448 & 0.445 & 0.468 & 0.343 \\ +Adjusted R$^{2}$ & 0.431 & 0.422 & 0.419 & 0.443 & 0.311 \\ +Residual Std. Error (df = 2870) & 0.670 & 0.684 & 0.679 & 0.642 & 0.746 \\ +F Statistic (df = 137; 2870) & 17.646$^{***}$ & 17.019$^{***}$ & 16.810$^{***}$ & 18.444$^{***}$ & 10.919$^{***}$ \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D6_1.tex b/32/replication_package/table_D6_1.tex new file mode 100644 index 0000000000000000000000000000000000000000..3cde97055112c687b8315cf5ea275a74f8e5f1c1 --- /dev/null +++ b/32/replication_package/table_D6_1.tex @@ -0,0 +1,34 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:48 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lcccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ +\cline{2-7} +\\[-1.8ex] & \multicolumn{5}{c}{hate\_violence\_means} & formula.6 \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ +\hline \\[-1.8ex] + Mate Competition & 0.445$^{***}$ & 0.267$^{***}$ & 0.257$^{***}$ & 0.211$^{***}$ & 0.188$^{***}$ & 0.154$^{***}$ \\ + & (0.023) & (0.029) & (0.030) & (0.028) & (0.028) & (0.027) \\ + & & & & & & \\ + Job Competition & & 0.255$^{***}$ & 0.223$^{***}$ & 0.059$^{**}$ & 0.035 & 0.020 \\ + & & (0.028) & (0.028) & (0.029) & (0.029) & (0.028) \\ + & & & & & & \\ + Life Satisfaction & & $-$0.008 & $-$0.0002 & 0.005 & 0.005 & 0.005 \\ + & & (0.009) & (0.010) & (0.009) & (0.009) & (0.009) \\ + & & & & & & \\ +\hline \\[-1.8ex] +Observations & 1,560 & 1,560 & 1,554 & 1,554 & 1,554 & 1,554 \\ +R$^{2}$ & 0.198 & 0.241 & 0.315 & 0.426 & 0.449 & 0.506 \\ +Adjusted R$^{2}$ & 0.197 & 0.239 & 0.276 & 0.383 & 0.399 & 0.454 \\ +Residual Std. Error & 0.827 (df = 1558) & 0.806 (df = 1556) & 0.786 (df = 1470) & 0.725 (df = 1446) & 0.716 (df = 1422) & 0.683 (df = 1406) \\ +F Statistic & 383.981$^{***}$ (df = 1; 1558) & 164.257$^{***}$ (df = 3; 1556) & 8.139$^{***}$ (df = 83; 1470) & 10.029$^{***}$ (df = 107; 1446) & 8.862$^{***}$ (df = 131; 1422) & 9.782$^{***}$ (df = 147; 1406) \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D6_3.tex b/32/replication_package/table_D6_3.tex new file mode 100644 index 0000000000000000000000000000000000000000..1dd6c24c4321d47f1253cfd6df8f3062e9fec2a5 --- /dev/null +++ b/32/replication_package/table_D6_3.tex @@ -0,0 +1,34 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Wed, Sep 09, 2020 - 23:38:49 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & formula.7.means & formula.7.justified & formula.7.message & formula.7.prevent & formula.7.condemn \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Mate Competition & 0.154$^{***}$ & 0.176$^{***}$ & 0.174$^{***}$ & 0.199$^{***}$ & 0.008 \\ + & (0.027) & (0.027) & (0.027) & (0.026) & (0.028) \\ + & & & & & \\ + Job Competition & 0.020 & 0.015 & 0.088$^{***}$ & 0.062$^{**}$ & $-$0.004 \\ + & (0.028) & (0.029) & (0.028) & (0.027) & (0.030) \\ + & & & & & \\ + Life Satisfaction & 0.005 & $-$0.018$^{**}$ & $-$0.013 & $-$0.025$^{***}$ & $-$0.011 \\ + & (0.009) & (0.009) & (0.009) & (0.009) & (0.010) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 1,554 & 1,554 & 1,554 & 1,554 & 1,554 \\ +R$^{2}$ & 0.506 & 0.480 & 0.480 & 0.496 & 0.423 \\ +Adjusted R$^{2}$ & 0.454 & 0.426 & 0.426 & 0.443 & 0.363 \\ +Residual Std. Error (df = 1406) & 0.683 & 0.696 & 0.685 & 0.665 & 0.721 \\ +F Statistic (df = 147; 1406) & 9.782$^{***}$ & 8.837$^{***}$ & 8.843$^{***}$ & 9.401$^{***}$ & 7.022$^{***}$ \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D8_1.tex b/32/replication_package/table_D8_1.tex new file mode 100644 index 0000000000000000000000000000000000000000..1510e375374ecf7683fc8e84e8c86023af4efc73 --- /dev/null +++ b/32/replication_package/table_D8_1.tex @@ -0,0 +1,31 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Thu, Sep 10, 2020 - 01:25:19 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & \multicolumn{5}{c}{hate\_cont} \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Mate Competition & 0.413$^{***}$ & 0.374$^{***}$ & 0.266$^{***}$ & 0.256$^{***}$ & 0.248$^{***}$ \\ + & (0.026) & (0.026) & (0.028) & (0.028) & (0.028) \\ + & & & & & \\ + Aggressiveness & & 0.508$^{***}$ & 0.428$^{***}$ & 0.430$^{***}$ & 0.404$^{***}$ \\ + & & (0.077) & (0.074) & (0.074) & (0.074) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 1,527 & 1,527 & 1,527 & 1,527 & 1,527 \\ +R$^{2}$ & 0.254 & 0.276 & 0.354 & 0.365 & 0.374 \\ +Adjusted R$^{2}$ & 0.223 & 0.245 & 0.314 & 0.316 & 0.326 \\ +Residual Std. Error & 0.850 (df = 1465) & 0.838 (df = 1464) & 0.799 (df = 1437) & 0.797 (df = 1417) & 0.792 (df = 1416) \\ +F Statistic & 8.177$^{***}$ (df = 61; 1465) & 8.991$^{***}$ (df = 62; 1464) & 8.832$^{***}$ (df = 89; 1437) & 7.482$^{***}$ (df = 109; 1417) & 7.706$^{***}$ (df = 110; 1416) \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/replication_package/table_D8_2.tex b/32/replication_package/table_D8_2.tex new file mode 100644 index 0000000000000000000000000000000000000000..750190d09c4c7c477c45f5e6ede5d7b533b2ddff --- /dev/null +++ b/32/replication_package/table_D8_2.tex @@ -0,0 +1,31 @@ + +% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu +% Date and time: Thu, Sep 10, 2020 - 01:25:19 +\begin{table}[!htbp] \centering + \caption{} + \label{} +\begin{tabular}{@{\extracolsep{5pt}}lccccc} +\\[-1.8ex]\hline +\hline \\[-1.8ex] + & \multicolumn{5}{c}{\textit{Dependent variable:}} \\ +\cline{2-6} +\\[-1.8ex] & \multicolumn{5}{c}{hate\_cont} \\ +\\[-1.8ex] & (1) & (2) & (3) & (4) & (5)\\ +\hline \\[-1.8ex] + Mate Competition & 0.433$^{***}$ & 0.406$^{***}$ & 0.295$^{***}$ & 0.281$^{***}$ & 0.270$^{***}$ \\ + & (0.037) & (0.038) & (0.042) & (0.042) & (0.042) \\ + & & & & & \\ + Aggressiveness & & 0.346$^{***}$ & 0.289$^{***}$ & 0.270$^{**}$ & 0.261$^{**}$ \\ + & & (0.107) & (0.107) & (0.107) & (0.106) \\ + & & & & & \\ +\hline \\[-1.8ex] +Observations & 729 & 729 & 729 & 729 & 729 \\ +R$^{2}$ & 0.294 & 0.305 & 0.372 & 0.416 & 0.427 \\ +Adjusted R$^{2}$ & 0.231 & 0.242 & 0.286 & 0.314 & 0.326 \\ +Residual Std. Error & 0.854 (df = 668) & 0.848 (df = 667) & 0.823 (df = 640) & 0.807 (df = 620) & 0.799 (df = 619) \\ +F Statistic & 4.641$^{***}$ (df = 60; 668) & 4.801$^{***}$ (df = 61; 667) & 4.315$^{***}$ (df = 88; 640) & 4.084$^{***}$ (df = 108; 620) & 4.237$^{***}$ (df = 109; 619) \\ +\hline +\hline \\[-1.8ex] +\textit{Note:} & \multicolumn{5}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ +\end{tabular} +\end{table} diff --git a/32/should_reproduce.txt b/32/should_reproduce.txt new file mode 100644 index 0000000000000000000000000000000000000000..d7cef92b46b007f909edf0a121170b209cbc29f2 --- /dev/null +++ b/32/should_reproduce.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e0e518889c94e63909410d9dd9c73f433ebcb624c97cd50a912ebd1c790a631 +size 19