Skip to content

Commit

Permalink
fix dofile
Browse files Browse the repository at this point in the history
  • Loading branch information
j-jayes committed Nov 3, 2023
1 parent 589fbe0 commit 2f3594b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 21 deletions.
58 changes: 46 additions & 12 deletions do_files/04-income-regressions.do
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ clear all
set more off

* Setting the working directory
* cd "C:\Users\User\Documents\Recon\paper-3-analysis"
cd "/Users/jonathanjayes/Documents/PhD/paper-3-analysis/"
cd "C:\Users\User\Documents\Recon\paper-3-analysis"
* cd "/Users/jonathanjayes/Documents/PhD/paper-3-analysis/"



Expand Down Expand Up @@ -73,13 +73,13 @@ forvalues i = 0.1(0.1)0.9 {
eststo Model`h'
}

qreg2 log_income birth_parish_treated##c.popular_movement_density_1900_FA age ///
qreg2 log_income birth_parish_treated age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(.8) cluster (birth_parish_ref_code)

eststo Model8

qreg2 log_income birth_parish_treated##c.popular_movement_density_1900_FA age ///
qreg2 log_income birth_parish_treated age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(.9) cluster (birth_parish_ref_code)

Expand All @@ -98,12 +98,8 @@ esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 ///
*-------------------------------------------------------------*
eststo clear

qreg2 log_income birth_parish_treated##c.popular_movement_density_1900_FA age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(.3) cluster (birth_parish_ref_code)


forvalues i = 0.1(0.1)0.9 {
forvalues i = 0.1(0.1)0.7 {

di `i'

Expand Down Expand Up @@ -131,7 +127,7 @@ eststo Model9

* Tabulate the regression results and save them in TeX format
esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 ///
using 0401_log-income-regression.tex, label replace ///
using 0402-quantile_reg_1900_union_density_log-income.tex, label replace ///
stats(r2 N F mean_depvar, fmt(2 0 3 2) labels("R-squared" "Observations" "F-stat" "Mean Dependent Var")) ///
cells(b(star fmt(3)) se(par fmt(5))) ///
addnotes("Robust standard errors in parentheses")
Expand All @@ -141,7 +137,7 @@ esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 ///
*-------------------------------------------------------------*
eststo clear

forvalues i = 0.1(0.1)0.9 {
forvalues i = 0.1(0.1)0.7 {

di `i'

Expand Down Expand Up @@ -169,11 +165,49 @@ eststo Model9

* Tabulate the regression results and save them in TeX format
esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 ///
using 0402_log-income-regression.tex, label replace ///
using 0403-quantile_reg_1930_union_density_log-income.tex, label replace ///
stats(r2 N F mean_depvar, fmt(2 0 3 2) labels("R-squared" "Observations" "F-stat" "Mean Dependent Var")) ///
cells(b(star fmt(3)) se(par fmt(5))) ///
addnotes("Robust standard errors in parentheses")


*-------------------------------------------------------------*
* Quantile Regressions for log_income: 1910 union density
*-------------------------------------------------------------*
eststo clear

forvalues i = 0.1(0.1)0.7 {

di `i'

qreg2 log_income birth_parish_treated##c.popular_movement_density_1910_FA age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(`i') cluster (birth_parish_ref_code)

loc h = `i' * 10

eststo Model`h'
}

qreg2 log_income birth_parish_treated##c.popular_movement_density_1910_FA age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(.8) cluster (birth_parish_ref_code)

eststo Model8

qreg2 log_income birth_parish_treated##c.popular_movement_density_1910_FA age ///
age_2 female i.marital i.schooling i.hisclass_group_abb, ///
quantile(.9) cluster (birth_parish_ref_code)

eststo Model9


* Tabulate the regression results and save them in TeX format
esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 ///
using 0404-quantile_reg_1910_union_density_log-income.tex, label replace ///
stats(r2 N F mean_depvar, fmt(2 0 3 2) labels("R-squared" "Observations" "F-stat" "Mean Dependent Var")) ///
cells(b(star fmt(3)) se(par fmt(5))) ///
addnotes("Robust standard errors in parentheses")

* Model 1: Regression with log_income as DV, birth_parish_treated as IV
quietly summarize log_income
Expand Down
17 changes: 9 additions & 8 deletions figure-code/coefplot-by-income-decile.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -288,25 +288,26 @@ data_1910 <- process_year(coefficients_1910, standard_errors_1910, 1910)
data_1930 <- process_year(coefficients_1930, standard_errors_1930, 1930)
# Combine all the data
all_year_data <- bind_rows(data_1900, data_1910, data_1930) %>%
mutate(
Variable = fct_relevel(Variable, "Union density"),
Variable = fct_relevel(Variable, "Treated"),
year = as.character(year)
)
all_year_data <- bind_rows(data_1900, data_1910, data_1930) %>%
mutate( year = as.character(year))
# Process baseline data
baseline_data <- process_baseline(coefficients_baseline, standard_errors_baseline)
# Combine all data
all_data <- bind_rows(baseline_data, all_year_data)
all_data <- bind_rows(baseline_data, all_year_data) %>%
mutate(
Variable = fct_relevel(Variable, "Union density"),
Variable = fct_relevel(Variable, "Treated")
)
# Create a facet plot
ggplot(all_data, aes(x = decile, y = coefficient, color = Variable)) +
geom_point() +
geom_point(cex = 2, alpha = .5) +
geom_errorbar(aes(ymin = coefficient - se, ymax = coefficient + se), width = 0.2) +
facet_grid(year ~ .) +
theme_light() +
scale_colour_brewer(palette = "Dark2") +
geom_hline(yintercept = 0, lty = 2) +
scale_x_continuous(labels = scales::percent_format(scale = 1), breaks = seq(10, 90, 10)) +
labs(
Expand Down
1 change: 0 additions & 1 deletion results/regressions/0401-quantile_reg_log-income.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}&\multicolumn{1}{c}{(9)}\\
&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}&\multicolumn{1}{c}{Log Income}\\
& b/se & b/se & b/se & b/se & b/se & b/se & b/se & b/se & b/se \\
\hline
Birth Parish (Treated)& 0.000 & 0.427\sym{***}& 0.242\sym{***}& 0.164\sym{***}& 0.129\sym{***}& 0.097\sym{**} & 0.078\sym{*} & 0.062 & 0.041 \\
& (0.00691) & (0.07115) & (0.04430) & (0.03977) & (0.03042) & (0.02953) & (0.03062) & (0.03427) & (0.03319) \\
Expand Down

0 comments on commit 2f3594b

Please sign in to comment.