library(texreg)
source("functions/extract_ols_custom.R")
# Libraries
library(tidyverse)
library(gridExtra)
library(tikzDevice)
# Load Data
load("./data/diss_df.rda")
# Labels for easier plotting
diss_df$cabinetINClabel <- ifelse(diss_df$cabinetINC == 1, "Power-Sharing",
"No \nPower-Sharing")
# PS => JudInd
plot_ps_judinc_LJI <- ggplot(diss_df, aes(x = cabinetINClabel, y = LJI_t2)) +
geom_jitter(size = 1.7, alpha = 0.5, height = 0) +
geom_boxplot(aes(fill = cabinetINClabel), alpha = 0.6) +
scale_fill_brewer(palette = "Blues") +
stat_summary(aes(group = 1), fun.y = mean, geom = "point", shape = 23,
size = 4, fill = "#d7191c", color = "#d7191c") +
theme_bw() +
theme(legend.position = "none", axis.text = element_text(size = 11)) +
labs(x = "", y = "LJI")
plot_allaid_LJI <- ggplot(diss_df, aes(x = log(aiddata_AidGDP), y = LJI_t2)) +
geom_point(size = 1.7, alpha = 0.5) +
geom_smooth(method = "lm") +
theme_bw() +
labs(x = "All Aid / GDP (log)", y = "LJI")
# For Manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aid_ps_indeff_judind.tex", height = 3.5)
# cowplot::plot_grid(plot_ps_judinc_LJI, plot_allaid_LJI, nrow = 1)
# dev.off()
# For Replication Archive
cowplot::plot_grid(plot_ps_judinc_LJI, plot_allaid_LJI, nrow = 1)

# Libraries
library(tidyverse)
# load data
load("./data/diss_df.rda")
# plot raw data
psaid_judind_plot <- ggplot(diss_df,
aes(x = log(aiddata_AidGDP),
y = LJI_t2)) +
geom_point(size = 1.7, alpha = 0.5) +
geom_smooth(method = "lm") +
facet_wrap( ~ cabinetINC, nrow = 1,
labeller = labeller(cabinetINC = c("0" = "No Power-Sharing",
"1" = "Power-Sharing"))) +
theme_bw() +
theme(strip.text = element_text(size=11)) +
labs(x = "Aid / GDP (log)", y = "Linzer and Staton Judicial Independence")
# Output Manuscript
library(gridExtra)
library(tikzDevice)
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aidps_judind_scatterplot.tex", height = 3.5)
# print(psaid_judind_plot)
# dev.off()
print(psaid_judind_plot)

# Libraries
library(tidyverse)
library(cowplot)
library(lfe)
library(tikzDevice)
# Data
load("./data/diss_df.rda")
diss_df <- diss_df %>%
dplyr::select(-matches("logit"))
# Prepare data frame for multiple plots
judind_vars <- list(
LJI_t1 = diss_df,
LJI_t2 = diss_df,
LJI_t3 = diss_df,
LJI_t4 = diss_df,
LJI_t5 = diss_df,
v2x_jucon_t1 = diss_df,
v2x_jucon_t2 = diss_df,
v2x_jucon_t3 = diss_df,
v2x_jucon_t4 = diss_df,
v2x_jucon_t5 = diss_df
)
# create data frame with list column
judind_vars <- enframe(judind_vars)
# define function that will be applied to every data frame in the list column
main_model <- function(lead_type, data) {
data <- as.data.frame(data)
data$lead_var <- data[, grep(lead_type, names(data), value =T)]
model <- lfe::felm(lead_var ~
cabinetCOUNT *
aiddata_AidGDP_ln +
log(GDP_per_capita) +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh | 0 | 0 | GWNo,
data=data)
return(model)
}
# fit models & post-process data for plotting
model_all <- judind_vars %>%
dplyr::mutate(model = map2(name, value, ~ main_model(.x, .y)))
model_out <- model_all %>%
mutate(coef = map(model, broom::tidy)) %>%
unnest(coef) %>%
# keep only interaction term coefs
filter(term == "cabinetCOUNT:aiddata_AidGDP_ln") %>%
mutate(dem_score = ifelse(grepl("LJI", name), "LJI", "V-Dem")) %>%
dplyr::select(dem_score, name, estimate, std.error) %>%
group_by(dem_score) %>%
mutate(name = 1:5)
temp_dyn_rol <- model_out
save(temp_dyn_rol, file = "./data/temp_dyn_rol.rda")
temp_dynamics_plot <- ggplot(model_out,
aes(x = name,
y = estimate,
group = dem_score, color = dem_score)) +
geom_point( aes(group = dem_score), size = 1.7,
position = position_dodge(width = .5)) +
geom_errorbar(aes(ymin = estimate - 1.67 * std.error,
ymax = estimate + 1.67 * std.error,
linetype = dem_score),
width = 0,
position = position_dodge(width = .5)) +
geom_hline(yintercept = 0, linetype = 2) +
scale_color_manual("", values = c("#4575b4", "#e41a1c")) +
scale_linetype_manual("", values = c(1, 5)) +
theme_bw()+
labs(x = "Year after t0", y = "Estimate of Interaction Coefficient \n between Power-Sharing (cabinet)\n and Aid/GDP (log)") +
theme(legend.position = "bottom") +
theme(legend.key.size=unit(3,"lines")) # +
# annotate("rect", xmin=1.5, xmax=2.5, ymin=-Inf, ymax=Inf, alpha=.1, fill="blue")
# Output for manuscript
# options(tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/temp_dynamics_plot_judind.tex", height = 3.5)
# print(temp_dynamics_plot)
# dev.off()
# Output for replication archive
print(temp_dynamics_plot)

# Libraries
library(tidyverse)
library(rms)
library(tikzDevice)
# Load data
load("./data/diss_df.rda")
# Estimate Models for plotting later
# LJI
model_aidps_judind_LJI_cabinc<- ols(LJI_t2 ~
cabinetINC *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_LJI_cabinc <- robcov(model_aidps_judind_LJI_cabinc, diss_df$GWNo)
model_aidps_judind_LJI_cabcount <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_LJI_cabcount <- robcov(model_aidps_judind_LJI_cabcount, diss_df$GWNo)
# plot marginal effects
source("functions/interaction_plots.R")
# # Output for manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aidps_interaction_judind_plot.tex", height = 3.5)
#
# par(mfrow=c(1,3),
# mar = c(5, 7, 4, 0.5),
# cex.lab = 1.3,
# cex.axis = 1.3,
# mgp = c(3.5, 1, 0))
#
# interaction_plot_continuous(model_aidps_judind_LJI_cabcount,
# "cabinetCOUNT",
# "aiddata_AidGDP_ln",
# "cabinetCOUNT * aiddata_AidGDP_ln",
# title = "",
# ylab = "Marginal effect of Power-Sharing (cabinet) \n on Judicial Independence",
# add_median_effect = T,
# xlab = "a) Aid / GDP (Log)\n",
# conf = .90)
# interaction_plot_continuous(model_aidps_judind_LJI_cabcount,
# "aiddata_AidGDP_ln",
# "cabinetCOUNT",
# "cabinetCOUNT * aiddata_AidGDP_ln",
# title = "",
# add_median_effect = T,
# ylab = "Marginal effect of Aid\n on Judicial Independence",
# xlab = "b) Power-Sharing \n(Number of rebel seats)",
# conf = .90)
# interaction_plot_binary(model_aidps_judind_LJI_cabinc,
# "aiddata_AidGDP_ln",
# "cabinetINC",
# "cabinetINC * aiddata_AidGDP_ln",
# title = "",
# ylab = "Marginal effect of Aid\n on Judicial Independence",
# xlab = "c) Power-Sharing \n(1 = Yes, 0 = No)",
# conf = .90)
# dev.off()
# Output for Replication Archive
par(mfrow=c(1,3),
mar = c(5, 7, 4, 0.5),
cex.lab = 1.3,
cex.axis = 1.3,
mgp = c(3.5, 1, 0))
interaction_plot_continuous(model_aidps_judind_LJI_cabcount,
"cabinetCOUNT",
"aiddata_AidGDP_ln",
"cabinetCOUNT * aiddata_AidGDP_ln",
title = "",
ylab = "Marginal effect of Power-Sharing (cabinet) \n on Judicial Independence",
add_median_effect = T,
xlab = "a) Aid / GDP (Log)\n",
conf = .90)
interaction_plot_continuous(model_aidps_judind_LJI_cabcount,
"aiddata_AidGDP_ln",
"cabinetCOUNT",
"cabinetCOUNT * aiddata_AidGDP_ln",
title = "",
add_median_effect = T,
ylab = "Marginal effect of Aid\n on Judicial Independence",
xlab = "b) Power-Sharing \n(Number of rebel seats)",
conf = .90)
interaction_plot_binary(model_aidps_judind_LJI_cabinc,
"aiddata_AidGDP_ln",
"cabinetINC",
"cabinetINC * aiddata_AidGDP_ln",
title = "",
ylab = "Marginal effect of Aid\n on Judicial Independence",
xlab = "c) Power-Sharing \n(1 = Yes, 0 = No)",
conf = .90)

# Libraries
library(tidyverse)
library(rms)
library(tikzDevice)
library(gridExtra)
# Load data
load("./data/diss_df.rda")
# Estimate Model
diss_df$conflictID <- NULL # conflictID throws an error b/c of missing data
d <- datadist(diss_df); options(datadist='d')
model_aidps_judind_LJI_cabcount <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_LJI_cabcount <- robcov(model_aidps_judind_LJI_cabcount, diss_df$GWNo)
# generate predictions at different power-sharing levels
predictions <- Predict(model_aidps_judind_LJI_cabcount,
aiddata_AidGDP_ln = c(0, 3.4), # 0 = 1% Aid / GDP , 3.4 = 30%
cabinetCOUNT = seq(0, 10, 1),
conf.int = 0.9) # 90 % confidence intervals
# generate plot
meplot_aidps_judind_interaction <- ggplot(data.frame(predictions),
aes(x = cabinetCOUNT,
y = yhat,
group = as.factor(exp(aiddata_AidGDP_ln)))) +
geom_line( color = "black", size = 1) +
geom_ribbon(aes(ymax = upper,
ymin = lower,
fill = as.factor(round(exp(aiddata_AidGDP_ln), 0))),
alpha = 0.7) +
scale_fill_manual(values = c("#b3cde3", "#e41a1c"),
name = "Aid in per cent of GDP:") +
scale_x_continuous(breaks = seq(0, 10, 2)) +
theme_bw() +
theme(text = element_text(size=8)) +
labs(x = "Power-Sharing (No. of rebel seats in government)",
y = "LS Judicial Independence") +
theme(legend.position = "bottom")
# At different aid levels
predictions_aid <- Predict(model_aidps_judind_LJI_cabcount,
aiddata_AidGDP_ln, # 0 = 1% Aid / GDP , 3.4 = 30%
cabinetCOUNT = seq(0, 10, length.out = 2),
conf.int = 0.9) # 90 % confidence intervals
# generate plot
meplot_aidps_judind_interaction_aid <- ggplot(data.frame(predictions_aid),
aes(x = exp(aiddata_AidGDP_ln),
y = yhat,
group = as.factor(cabinetCOUNT))) +
geom_line( color = "black", size = 1) +
geom_ribbon(aes(ymax = upper,
ymin = lower,
fill = as.factor(cabinetCOUNT)),
alpha = 0.7) +
scale_fill_manual(values = c("#b3cde3", "#e41a1c"),
name = "Number of rebels \nin the power-sharing coalition:") +
theme_bw() +
theme(text = element_text(size=8)) +
labs(x = "Aid / GDP",
y = "LS Judicial Independence") +
theme(legend.position = "bottom")
# Output manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aidps_judind_ME.tex", height = 4.5, width = 6.5)
#
# grid.arrange(meplot_aidps_judind_interaction,
# meplot_aidps_judind_interaction_aid,
# nrow = 1)
# dev.off()
# Output Replication Archive
grid.arrange(meplot_aidps_judind_interaction,
meplot_aidps_judind_interaction_aid,
nrow = 1)

# Libraries
library(tidyverse)
library(cowplot)
library(lfe)
library(tikzDevice)
# Data
load("./data/diss_df.rda")
diss_df <- diss_df %>%
dplyr::select(-matches("logit")) %>%
mutate(dga_gdp_ln = log(dga_gdp_zero +1 ),
pga_gdp_ln = log(program_aid_gdp_zero + 1),
bga_gdp_ln = log(commodity_aid_gdp_zero + 1))
# Prepare data frame for multiple plots
judind_vars <- list(
cabinetCOUNT = diss_df,
seniorCOUNT = diss_df,
nonseniorCOUNT = diss_df,
dga_gdp_ln = diss_df,
pga_gdp_ln = diss_df,
bga_gdp_ln = diss_df
)
# create data frame with list column
judind_vars <- enframe(judind_vars)
# define function that will be applied to every data frame in the list column
main_model <- function(ind_var, data) {
data <- as.data.frame(data)
data$ind_var <- data[, ind_var]
if(grepl("COUNT", ind_var)) {
model <- lfe::felm(LJI_t2 ~
ind_var *
aiddata_AidGDP_ln +
log(GDP_per_capita) +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh | 0 | 0 | GWNo,
data=data)
return(model)
} else {
model <- lfe::felm(LJI_t2 ~
cabinetCOUNT *
ind_var +
log(GDP_per_capita) +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh | 0 | 0 | GWNo,
data=data)
return(model)
}
}
# fit models & post-process data for plotting
model_all <- judind_vars %>%
dplyr::mutate(model = map2(name, value, ~ main_model(.x, .y)))
model_out <- model_all %>%
mutate(coef = map(model, broom::tidy)) %>%
unnest(coef) %>%
# keep only interaction term coefs
filter(grepl(":", term)) %>%
dplyr::select(name, estimate, std.error) %>%
mutate(name = forcats::fct_relevel(name,
c("cabinetCOUNT",
"seniorCOUNT",
"nonseniorCOUNT",
"dga_gdp_ln",
"pga_gdp_ln",
"bga_gdp_ln")))
model_out_rol <- model_out
save(model_out_rol, file= "./data/mechanism_models_rol.rda")
mechanisms_judind_plot <- ggplot(model_out,
aes(x = name,
y = estimate)) +
geom_point( size = 1.7,
position = position_dodge(width = .5)) +
geom_errorbar(aes(ymin = estimate - 1.67 * std.error,
ymax = estimate + 1.67 * std.error),
width = 0,
position = position_dodge(width = .5)) +
geom_hline(yintercept = 0, linetype = 2) +
theme_bw()+
scale_x_discrete(labels = c("Cabinet PS (Baseline)",
"Senior PS",
"Nonsenior PS",
"DGA",
"Program Aid",
"Budget Aid")) +
labs(x = "", y = "Estimate of Interaction Coefficient \n between Different Types of \n Power-Sharing (cabinet) and Aid")
# Output for manuscript
# options(tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/mechanisms_judind_plot.tex", height = 2.75)
# print(mechanisms_judind_plot)
# dev.off()
# Output for replication archive
print(mechanisms_judind_plot)

# Libraries
library(tidyverse)
library(cowplot)
library(lfe)
library(tikzDevice)
# Data
load("./data/diss_df.rda")
diss_df <- diss_df %>%
dplyr::select(-matches("logit"))
# Prepare data frame for multiple plots
judind_vars <- list(
v2x_jucon_t2 = diss_df, # judicial constraints on the executive
v2jureform_t2 = diss_df, # reforms
v2juaccnt_t2 = diss_df,
v2jupurge_t2 = diss_df,
v2jupack_t2 = diss_df
)
# create data frame with list column
judind_vars <- enframe(judind_vars)
# define function that will be applied to every data frame in the list column
main_model <- function(lead_type, data) {
data <- as.data.frame(data)
data$lead_var <- data[, grep(lead_type, names(data), value =T)]
model <- lfe::felm(lead_var ~
cabinetCOUNT *
aiddata_AidGDP_ln +
log(GDP_per_capita) +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh | 0 | 0 | GWNo,
data=data)
return(model)
}
# fit models & post-process data for plotting
model_all <- judind_vars %>%
dplyr::mutate(model = map2(name, value, ~ main_model(.x, .y)))
model_out <- model_all %>%
mutate(coef = map(model, broom::tidy)) %>%
unnest(coef) %>%
# keep only interaction term coefs
filter(grepl(":", term)) %>%
mutate(name = forcats::fct_reorder(name, estimate, sort))
mechanisms_plot2 <- ggplot(model_out,
aes(x = name,
y = estimate)) +
geom_point( size = 1.7,
position = position_dodge(width = .5)) +
geom_errorbar(aes(ymin = estimate - 1.67 * std.error,
ymax = estimate + 1.67 * std.error),
width = 0,
position = position_dodge(width = .5)) +
geom_hline(yintercept = 0, linetype = 2) +
scale_color_brewer("",palette = "Set2") +
theme_bw()+
scale_x_discrete(labels = c("Reforms",
"Purges",
"Accountability",
"Judicial Independence \n(Reference)",
"Court Packing")) +
labs(x = "", y = "Estimate of Interaction Coefficient \n between Power-Sharing (cabinet)\n and Aid/GDP (log)") +
theme(legend.position = "bottom")
# options(tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/mechanisms2_judind_plot.tex", height = 2.75)
# print(mechanisms_plot2)
# dev.off()
print(mechanisms_plot2)

# Libraries
library(texreg)
# source("functions/extract_ols_custom.R")
library(rms)
# load Data
load("./data/diss_df.rda")
#
# diss_df$conflictID <- NULL
# datadist_diss_df <- datadist(diss_df); options(datadist='datadist_diss_df')
# Models
model_ps_lji_cabcount <- ols(LJI_t2 ~
cabinetCOUNT +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_ps_lji_cabcount <- robcov(model_ps_lji_cabcount, diss_df$GWNo)
model_ps_lji_seniorcount <- ols(LJI_t2 ~
seniorCOUNT +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_ps_lji_seniorcount <- robcov(model_ps_lji_seniorcount, diss_df$GWNo)
model_ps_lji_nonseniorcount <- ols(LJI_t2 ~
nonseniorCOUNT +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_ps_lji_nonseniorcount <- robcov(model_ps_lji_nonseniorcount, diss_df$GWNo)
# Aid
model_dga_lji_cabcount <- ols(LJI_t2 ~
cabinetCOUNT +
log(dga_gdp_zero + 1) +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_dga_lji_cabcount <- robcov(model_dga_lji_cabcount, diss_df$GWNo)
model_pga_lji_cabcount <- ols(LJI_t2 ~
cabinetCOUNT +
log(program_aid_gdp_zero + 1) +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_pga_lji_cabcount <- robcov(model_pga_lji_cabcount, diss_df$GWNo)
model_bga_lji_cabcount <- ols(LJI_t2 ~
cabinetCOUNT +
log(commodity_aid_gdp_zero + 1) +
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_bga_lji_cabcount <- robcov(model_bga_lji_cabcount, diss_df$GWNo)
# Output
model_list <- list(model_ps_lji_cabcount,
model_ps_lji_seniorcount,
model_ps_lji_nonseniorcount,
model_dga_lji_cabcount,
model_pga_lji_cabcount,
model_bga_lji_cabcount)
coef_name_map <- list(cabinetCOUNT = "Power-Sharing (cabinet)",
seniorCOUNT = "Power-Sharing (senior)",
nonseniorCOUNT = "Power-Sharing (nonsenior)",
"cabinetCOUNT * aiddata_AidGDP_ln" = "PS (cabinet) * Aid",
"cabinetCOUNT:aiddata_AidGDP_ln" = "PS (cabinet) * Aid",
ps_share = "PS (cabinet share)",
"ps_share * aiddata_AidGDP_ln" = "PS (cabinet share) * Aid",
dga_gdp_zero = "DGA/GDP (log)",
program_aid_gdp_zero = "Program Aid/GDP (log)",
commodity_aid_gdp_zero = "Budget Aid/GDP (log)",
aiddata_AidGDP_ln = "Aid / GDP (log)",
ln_gdp_pc = "GDP p/c",
ln_pop = "Population",
conf_intens = "Conflict Intensity",
nonstate = "Non-State Violence",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
polity2 = "Polity",
Ethnic = "Ethnic Frac.",
DS_ordinal = "UN PKO")
# custom functions to write tex output
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
#
# custom_texreg(model_list,
# file = "../output/aid_ps_indeff_judind.tex",
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = coef_name_map,
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# dcolumn = T,
# include.rsquared = F,
# include.cluster = T,
# star.symbol = "\\*",
# caption = "",
# include.lr = F)
# custom.multicol = T,
# custom.model.names = c(" \\multicolumn{3}{c}{ \\textbf{Power-Sharing}} & \\multicolumn{3}{c}{ \\textbf{Foreign Aid}} \\\\ \\cmidrule(r){2-4} \\cmidrule(l){5-7} & \\multicolumn{1}{c}{(1) }",
# "\\multicolumn{1}{c}{(2) }",
# "\\multicolumn{1}{c}{(3) }",
# "\\multicolumn{1}{c}{(4) }",
# "\\multicolumn{1}{c}{(5) }",
# "\\multicolumn{1}{c}{(6) }"))
htmlreg(model_list,
stars = c(0.001, 0.01, 0.05, 0.1),
custom.coef.map = coef_name_map,
symbol = "+",
table = F,
booktabs = T,
use.packages = F,
include.cluster = T,
dcolumn = T,
star.symbol = "\\*",
caption = "",
include.lr = F)
| Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | ||
|---|---|---|---|---|---|---|---|
| Power-Sharing (cabinet) | 0.00 | 0.00 | 0.01 | 0.00 | |||
| (0.00) | (0.00) | (0.00) | (0.00) | ||||
| Power-Sharing (senior) | 0.02 | ||||||
| (0.01) | |||||||
| Power-Sharing (nonsenior) | 0.01 | ||||||
| (0.01) | |||||||
| DGA/GDP (log) | 0.00 | ||||||
| (0.03) | |||||||
| Program Aid/GDP (log) | -0.02 | ||||||
| (0.03) | |||||||
| Budget Aid/GDP (log) | -0.01 | ||||||
| (0.01) | |||||||
| Aid / GDP (log) | -0.02* | -0.02* | -0.02* | -0.02* | -0.01 | -0.02+ | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | ||
| GDP p/c | -0.01 | -0.01 | -0.01 | -0.01 | -0.02 | -0.01 | |
| (0.02) | (0.02) | (0.02) | (0.02) | (0.02) | (0.02) | ||
| Population | -0.02+ | -0.02+ | -0.02+ | -0.02+ | -0.02* | -0.02+ | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | ||
| Conflict Intensity | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | |
| (0.04) | (0.04) | (0.04) | (0.04) | (0.04) | (0.04) | ||
| Non-State Violence | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | |
| (0.04) | (0.04) | (0.04) | (0.04) | (0.04) | (0.04) | ||
| Nat. Res. Rents | -0.00** | -0.00** | -0.00* | -0.00** | -0.00** | -0.00* | |
| (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | ||
| Regime Type (FH) | 0.10*** | 0.10*** | 0.10*** | 0.10*** | 0.10*** | 0.10*** | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | ||
| Num. obs. | 272 | 272 | 272 | 272 | 272 | 272 | |
| R2 | 0.59 | 0.59 | 0.59 | 0.59 | 0.59 | 0.59 | |
| Adj. R2 | 0.58 | 0.58 | 0.58 | 0.58 | 0.58 | 0.58 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||||||
# Libraries
library(texreg)
# source("functions/extract_ols_custom.R")
library(rms)
# load Data
load("./data/diss_df.rda")
# LJI
model_aidps_judind_LJI_cabinc<- ols(LJI_t2 ~
cabinetINC *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_LJI_cabinc <- robcov(model_aidps_judind_LJI_cabinc, diss_df$GWNo)
model_aidps_judind_LJI_cabcount <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_LJI_cabcount <- robcov(model_aidps_judind_LJI_cabcount, diss_df$GWNo)
# V-Dem
model_aidps_judind_vdem_cabinc <- ols(v2x_jucon_t2 ~
cabinetINC *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_vdem_cabinc <- robcov(model_aidps_judind_vdem_cabinc, diss_df$GWNo)
model_aidps_judind_vdem_cabcount <- ols(v2x_jucon_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data = diss_df,
x = T, y = T)
model_aidps_judind_vdem_cabcount <- robcov(model_aidps_judind_vdem_cabcount, diss_df$GWNo)
# model list:
model_list <- list(model_aidps_judind_LJI_cabinc,
model_aidps_judind_LJI_cabcount,
model_aidps_judind_vdem_cabinc,
model_aidps_judind_vdem_cabcount)
coef_name_map <- list(
cabinetINC = "Power-Sharing (binary)",
"cabinetINC * aiddata_AidGDP_ln" = "Power-Sharing (binary) * Aid",
cabinetCOUNT = "Power-Sharing (cabinet)",
"cabinetCOUNT * aiddata_AidGDP_ln" = "Power-Sharing (cabinet) * Aid",
"cabinetCOUNT:aiddata_AidGDP_ln" = "PS (cabinet) * Aid",
ps_share = "PS (cabinet share)",
"ps_share * aiddata_AidGDP_ln" = "PS (cabinet share) * Aid",
dga_gdp_zero = "DGA/GDP (log)",
program_aid_gdp_zero = "Program Aid/GDP (log)",
commodity_aid_gdp_zero = "Budget Aid/GDP (log)",
aiddata_AidGDP_ln = "Aid / GDP (log)",
ln_gdp_pc = "GDP p/c (log)",
ln_pop = "Population (log)",
conf_intens = "Conflict Intensity",
nonstate = "Non-State Violence",
WBnatres = "Nat. Res. Rents",
polity2 = "Polity",
fh = "Regime Type (FH)",
Ethnic = "Ethnic Frac.",
DS_ordinal = "UN PKO")
# custom functions to write tex output
# source("functions/extract_ols_custom.R")
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
#
# custom_texreg(model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = coef_name_map,
# symbol = "+",
# file = "../output/aidps_judind_main.tex",
# table = F,
# booktabs = T,
# use.packages = F,
# dcolumn = T,
# custom.multicol = T,
# custom.model.names = c(" \\multicolumn{2}{c}{ \\textbf{LJI}} & \\multicolumn{2}{c}{ \\textbf{V-Dem}} \\\\ \\cmidrule(r){2-3} \\cmidrule(l){4-5} & \\multicolumn{1}{c}{(1) }",
# "\\multicolumn{1}{c}{(2) }",
# "\\multicolumn{1}{c}{(3) }",
# "\\multicolumn{1}{c}{(4) }"),
# include.cluster = T,
# include.rsquared = F,
# star.symbol = "\\*",
# include.lr = F)
#
# texreg::htmlreg(model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = coef_name_map,
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# dcolumn = T,
# include.cluster = T,
# include.rsquared = F,
# star.symbol = "\\*",
# include.lr = F,
# caption = "")
# Libraries
library(texreg)
source("functions/extract_ols_custom.R")
source("./functions/extract_plm_custom.R")
library(tidyverse)
library(rms)
library(plm)
library(countrycode)
# load Data
load("./data/diss_df.rda")
# Ethnic
model_interaction_judind_LJI_Ethnic<- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
Ethnic
,
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_Ethnic <- robcov(model_interaction_judind_LJI_Ethnic, diss_df$GWNo)
# PKO
model_interaction_judind_LJI_PKO <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
DS_ordinal
,
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_PKO <- robcov(model_interaction_judind_LJI_PKO, diss_df$GWNo)
# Cabinet Share
library(readxl)
cnts <- read_excel("./data/CNTSDATA.xls")
cnts <- cnts %>% filter(year >= 1989)
cnts$iso3c <- countrycode(cnts$country, "country.name", "iso3c")
cnts <- cnts %>% filter(country != "SOMALILAND")
testcabsize <- left_join(diss_df, cnts[, c("iso3c", "year", "polit10")])
testcabsize$ps_share <- testcabsize$cabinetCOUNT / testcabsize$polit10 * 100
model_cabsize_judind <- ols(LJI_t2 ~
ps_share *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh,
data = testcabsize, x = T, y = T)
model_cabsize_judind <- robcov(model_cabsize_judind, testcabsize$GWNo)
# Regional Mean
model_interaction_judind_LJI_regmean <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
LJI_regional_mean
,
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_regmean <- robcov(model_interaction_judind_LJI_regmean , diss_df$GWNo)
# Commonlaw
model_interaction_judind_LJI_commonlaw <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
commonlaw
,
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_commonlaw <- robcov(model_interaction_judind_LJI_commonlaw, diss_df$GWNo)
# Constitutional Duration
model_interaction_judind_LJI_constdur<- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
duration_constitution
,
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_constdur <- robcov(model_interaction_judind_LJI_constdur, diss_df$GWNo)
#
#
# # All controls
# model_interaction_judind_LJI_allcontrols <- ols(LJI_t2 ~
# cabinetCOUNT *
# aiddata_AidGDP_ln +
# ln_gdp_pc +
# ln_pop +
# conf_intens +
# nonstate +
# WBnatres +
# fh +
# Ethnic +
# DS_ordinal +
# LJI_regional_mean +
# commonlaw +
# duration_constitution
# ,
# data = diss_df,
# x = T, y = T)
# model_interaction_judind_LJI_allcontrols <- robcov(model_interaction_judind_LJI_allcontrols, diss_df$GWNo)
# Random Effects
model_interaction_judind_LJI_RE <- plm(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
model = "random",
index = c("country", "year"),
data = diss_df,
x = T, y = T)
series conflictID is NA and has been removed series conflictdummy, xnewconflictinyearv412, xonset1v412, xonset2v412, xonset5v412, xonset8v412, xonset20v412, xmaxintyearv412, xgovonlyv412, xterronlyv412, xbothgovterrv412, xsumconfv412, xpcyears, xis.pc, xcodingend are constants and have been removed
model_interaction_judind_LJI_RE$vcov <- plm::vcovHC(model_interaction_judind_LJI_RE)
# Region Fixed Effects
model_interaction_judind_LJI_FE <- ols(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh +
region,
# model = "within",
# index = c("region", "country_year"),
data = diss_df,
x = T, y = T)
model_interaction_judind_LJI_FE <- robcov(model_interaction_judind_LJI_FE,diss_df$country)
# Country FEs
model_interaction_judind_LJI_FE_cntry <- plm(LJI_t2 ~
cabinetCOUNT *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
model = "within",
index = c("country", "year"),
data = diss_df,
x = T, y = T)
series conflictID is NA and has been removed series conflictdummy, xnewconflictinyearv412, xonset1v412, xonset2v412, xonset5v412, xonset8v412, xonset20v412, xmaxintyearv412, xgovonlyv412, xterronlyv412, xbothgovterrv412, xsumconfv412, xpcyears, xis.pc, xcodingend are constants and have been removed
model_interaction_judind_LJI_FE_cntry$vcov <- plm::vcovHC(model_interaction_judind_LJI_FE_cntry, cluster = "group")
# Output
# Model list
model_list <- list(model_interaction_judind_LJI_Ethnic,
model_interaction_judind_LJI_PKO,
model_cabsize_judind,
model_interaction_judind_LJI_regmean,
model_interaction_judind_LJI_commonlaw,
model_interaction_judind_LJI_constdur,
model_interaction_judind_LJI_RE,
model_interaction_judind_LJI_FE,
model_interaction_judind_LJI_FE_cntry)
## Order of coefficients in output table
name_map_robustness <- list(cabinetCOUNT = "PS (cabinet)",
"cabinetCOUNT * aiddata_AidGDP_ln" = "PS (cabinet) * Aid",
"cabinetCOUNT:aiddata_AidGDP_ln" = "PS (cabinet) * Aid",
ps_share = "PS (cabinet share)",
"ps_share * aiddata_AidGDP_ln" = "PS (cabinet share) * Aid",
aiddata_AidGDP_ln = "Aid / GDP (log)",
ln_gdp_pc = "GDP p/c",
ln_pop = "Population",
conf_intens = "Conflict Intensity",
nonstate = "Non-State Violence",
WBnatres = "Nat. Res. Rents",
polity2 = "Polity",
fh = "Regime Type (FH)",
Ethnic = "Ethnic Frac.",
DS_ordinal = "UN PKO",
LJI_regional_mean = "LJI Regional Mean",
commonlaw = "Common Law",
duration_constitution = "Const. Duration")
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
# # Output Manuscript
# custom_texreg(l = model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# dcolumn = T,
# custom.coef.map = name_map_robustness,
# file = "../output/aidps_judind_robustness.tex",
# custom.model.names = c("(1) ELF",
# "(2) PKO",
# "(3) Cab. Size",
# "(4) Regional Mean",
# "(5) Common Law",
# "(6) Const. Duration",
# "(7) RE",
# "(8) Region FE",
# "(9) Country FE"),
#
# star.symbol = "\\*",
# include.lr = F,
# include.cluster = T,
# include.rsquared = F,
# include.variance = F)
# Output Replication Archive
htmlreg(model_list,
stars = c(0.001, 0.01, 0.05, 0.1),
symbol = "+",
table = F,
booktabs = T,
use.packages = F,
dcolumn = T,
custom.coef.map = name_map_robustness,
custom.model.names = c("(1) ELF",
"(2) PKO",
"(3) Cab. Size",
"(4) Regional Mean",
"(5) Common Law",
"(6) Const. Duration",
"(7) RE",
"(8) Region FE",
"(9) Country FE"),
star.symbol = "\\*",
include.lr = F,
include.cluster = T,
include.rsquared = F,
include.variance = F)
| (1) ELF | (2) PKO | (3) Cab. Size | (4) Regional Mean | (5) Common Law | (6) Const. Duration | (7) RE | (8) Region FE | (9) Country FE | ||
|---|---|---|---|---|---|---|---|---|---|---|
| PS (cabinet) | 0.03*** | 0.02** | 0.02* | 0.02* | 0.02** | -0.00 | 0.02+ | -0.00 | ||
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.00) | (0.01) | (0.00) | |||
| PS (cabinet) * Aid | -0.01*** | -0.01** | -0.01* | -0.01+ | -0.01** | 0.00 | -0.01 | -0.00 | ||
| (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | |||
| PS (cabinet share) | 0.00 | |||||||||
| (0.00) | ||||||||||
| PS (cabinet share) * Aid | -0.00 | |||||||||
| (0.00) | ||||||||||
| Aid / GDP (log) | -0.02* | -0.02* | -0.02* | -0.01 | -0.01* | -0.02* | -0.00 | -0.01 | -0.00 | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.00) | (0.01) | (0.00) | ||
| GDP p/c | -0.02 | -0.02 | 0.00 | -0.00 | 0.01 | -0.03 | 0.03*** | 0.03+ | 0.02** | |
| (0.02) | (0.02) | (0.02) | (0.02) | (0.02) | (0.02) | (0.01) | (0.02) | (0.01) | ||
| Population | -0.02+ | -0.02+ | -0.03* | -0.02+ | -0.02+ | -0.03* | 0.00 | -0.03** | 0.17* | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.02) | (0.01) | (0.07) | ||
| Conflict Intensity | 0.02 | 0.02 | 0.02 | 0.03 | 0.01 | 0.02 | 0.01 | 0.06+ | -0.00 | |
| (0.04) | (0.04) | (0.03) | (0.03) | (0.04) | (0.03) | (0.02) | (0.03) | (0.03) | ||
| Non-State Violence | 0.03 | 0.01 | 0.01 | 0.01 | -0.05 | 0.00 | -0.04* | 0.02 | -0.04* | |
| (0.03) | (0.04) | (0.04) | (0.04) | (0.05) | (0.03) | (0.02) | (0.03) | (0.02) | ||
| Nat. Res. Rents | -0.00+ | -0.00* | -0.00** | -0.00 | -0.00** | -0.00** | -0.00*** | -0.00* | -0.00** | |
| (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | (0.00) | ||
| Regime Type (FH) | 0.10*** | 0.10*** | 0.09*** | 0.07*** | 0.09*** | 0.10*** | 0.04*** | 0.07*** | 0.03*** | |
| (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | (0.01) | ||
| Ethnic Frac. | -0.12+ | |||||||||
| (0.07) | ||||||||||
| UN PKO | -0.00 | |||||||||
| (0.01) | ||||||||||
| LJI Regional Mean | 0.64*** | |||||||||
| (0.13) | ||||||||||
| Common Law | 0.15** | |||||||||
| (0.06) | ||||||||||
| Const. Duration | 0.00+ | |||||||||
| (0.00) | ||||||||||
| Num. obs. | 272 | 272 | 214 | 272 | 272 | 271 | 272 | 272 | 272 | |
| Countries | 46 | 46 | 42 | 46 | 46 | 46 | 46 | 46 | 46 | |
| Adj. R2 | 0.60 | 0.58 | 0.63 | 0.71 | 0.64 | 0.60 | 0.52 | 0.75 | 0.46 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | ||||||||||
# Libraries
library(texreg)
source("functions/extract_ols_custom.R")
source("./functions/extract_plm_custom.R")
library(tidyverse)
library(rms)
library(plm)
library(countrycode)
load("./data/diss_df.rda")
##### Matching #####
library(MatchIt)
library(tidyr)
set.seed(159753)
# prepare data without missings
match_ji_data <- diss_df %>%
ungroup() %>%
dplyr::select(cabinetINC, cabinetCOUNT, seniorINC,
seniorCOUNT, nonseniorINC, nonseniorCOUNT,
aiddata_AidGDP, population, nonstate,
WBnatres, fh, GDP_per_capita, conf_intens,
aiddata_AidGDP_ln, LJI_t2, v2x_jucon_t2, GWNo, year,
pc_period, Location, ln_pop, ln_gdp_pc,
LJI_regional_mean, commonlaw, duration_constitution, Ethnic, polity_chng)
match_ji_data <- match_ji_data[complete.cases(match_ji_data), ]
# generate pretreatment controls
match_ji_data <- match_ji_data %>%
arrange(GWNo, pc_period, year) %>%
group_by(GWNo, pc_period) %>%
mutate(match_aiddata_AidGDP_ln = first(aiddata_AidGDP_ln),
match_pop = first(population),
match_gdp = first(GDP_per_capita),
match_nonstate = first(nonstate),
match_WBnatres = first(WBnatres),
match_fh = first(fh),
match_duration_constitution = first(duration_constitution),
match_LJI_regional_mean = first(LJI_regional_mean))
match_ji_data <- as.data.frame(match_ji_data)
match_ji_res <- matchit(cabinetINC ~
match_aiddata_AidGDP_ln +
log(match_gdp) +
log(match_pop) +
conf_intens + # conf_intens is already pre-treatment
match_nonstate +
log(match_WBnatres + 1) +
match_fh ,
method = "nearest",
ratio = 2,
distance = "mahalanobis",
data = match_ji_data)
# extract data
match_ji_res_df <- match.data(match_ji_res)
# Models
#### Matching: PS * Aid => Judicial Independence
# LJI
model_psaid_matched_LJI <- ols(LJI_t2 ~
cabinetINC *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data=match_ji_res_df , x=T, y=T)
model_psaid_matched_LJI <- rms::robcov(model_psaid_matched_LJI, match.data(match_ji_res)$GWNo)
# V-Dem
model_psaid_matched_vdem <- ols(v2x_jucon_t2 ~
cabinetINC *
aiddata_AidGDP_ln +
ln_gdp_pc +
ln_pop +
conf_intens +
nonstate +
WBnatres +
fh
,
data=match_ji_res_df , x=T, y=T)
model_psaid_matched_vdem <- rms::robcov(model_psaid_matched_vdem, match.data(match_ji_res)$GWNo)
#### Instrumental Variable Regressions ###
# ivreg with Jud Ind
library(AER)
library(ivpack)
library(lmtest)
# load instrument
load(file = "./data/instrumentedAid2.RData")
load("./data/diss_df.rda")
diss_df <- merge(diss_df, instrument_df, by = c("year", "iso2c"), all.x = TRUE)
diss_df$total_sum_except <- as.numeric(diss_df$total_sum_except)
# subset only complete.cases / necessary for cluster.robust.se()
iv_na <- na.omit(diss_df[, c(
"cabinetCOUNT",
"cabinetINC",
"aiddata_Aid",
"aiddata_AidGDP_ln",
"aiddata_AidPC_ln",
"fh",
"GDP_per_capita",
"population",
"conf_intens",
"WBnatres",
"total_sum_except",
"year",
"GWNo",
"GDP",
"nonstate", "LJI_t2", "v2x_jucon_t2")])
##### IV #####
iv_na$aid_instrumented_gdp_ln <- log(iv_na$total_sum_except / iv_na$GDP)
diss_df$aid_instrumented_gdp_ln <- log(diss_df$total_sum_except / diss_df$GDP)
# to proceed with IV estimation I first hard-code the instrument
iv_na$instr_aid_gdp_ln <- log(iv_na$total_sum_except / iv_na$GDP)
# data transformation for Stata
iv_na$ln_gdp_pc <- log(iv_na$GDP_per_capita)
iv_na$ln_pop <- log(iv_na$population)
# stuff for stata
# diss_df$region_num <- as.numeric(as.factor(diss_df$region))
# diss_df$country_year_num <- as.numeric(as.factor(diss_df$country_year))
foreign::write.dta(iv_na, "./data/diss_df_IV.dta")
# hard code interaction variable
iv_na$cabincXaid <- iv_na$aiddata_AidGDP_ln * iv_na$cabinetINC
iv_na$cabincXaid_instr <- iv_na$aid_instrumented_gdp_ln * iv_na$cabinetINC
library(lfe)
model_iv_judind_lji <- felm(LJI_t2 ~
cabinetINC +
ln_gdp_pc +
ln_pop +
nonstate +
conf_intens +
WBnatres +
fh
| 0 | (aiddata_AidGDP_ln|cabincXaid ~ aid_instrumented_gdp_ln + cabincXaid_instr) | GWNo,
data = iv_na)
model_iv_judind_vdem <- felm(v2x_jucon_t2 ~
cabinetINC +
ln_gdp_pc +
ln_pop +
nonstate +
conf_intens +
WBnatres +
fh
| 0 | (aiddata_AidGDP_ln|cabincXaid ~ aid_instrumented_gdp_ln + cabincXaid_instr) | GWNo,
data = iv_na)
# Output Models
## Order of coefficients in output table
name_map <- list(cabinetINC = "Power-Sharing (binary)",
"cabinetINC * aiddata_AidGDP_ln" = "Power-Sharing (binary) * Aid",
"`cabincXaid(fit)`" = "Power-Sharing (binary) * Aid",
"`aiddata_AidGDP_ln(fit)`" = "Aid / GDP (log)",
"aiddata_AidGDP_ln" = "Aid / GDP (log)",
"ln_gdp_pc" = "GDP p/c",
"ln_pop" = "Population",
conf_intens = "Conflict Intensity",
nonstate = "Non-State Violence",
WBnatres = "Nat. Res. Rents",
polity2 = "Regime Type",
fh = "Regime Type")
model_list <- list(model_psaid_matched_LJI, model_psaid_matched_vdem,
model_iv_judind_lji, model_iv_judind_vdem)
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
source("functions/extract_felm_custom.R")
#
# custom_texreg(model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = name_map,
# symbol = "+",
# file = "../output/aidps_judind_matching2sls.tex",
# table = F,
# booktabs = T,
# use.packages = F,
# add.lines = list(c("Countries",
# length(unique(match_ji_res_df$GWNo)),
# length(unique(match_ji_res_df$GWNo)),
# length(unique(diss_df$GWNo)),
# length(unique(diss_df$GWNo))),
# c("Kleibergen-Paap rk Wald F statistic",
# "",
# "",
# "40.32",
# "40.32")),
# dcolumn = T,
# custom.multicol = T,
# custom.model.names = c(" \\multicolumn{2}{c}{ \\textbf{Matching}} & \\multicolumn{2}{c}{ \\textbf{2SLS}} \\\\ \\cmidrule(r){2-3} \\cmidrule(l){4-5} & \\multicolumn{1}{c}{(1) LJI }",
# "\\multicolumn{1}{c}{(2) V-Dem }",
# "\\multicolumn{1}{c}{(3) LJI }",
# "\\multicolumn{1}{c}{(4) V-Dem }"),
# include.cluster = F,
# include.rsquared = F,
# star.symbol = "\\*",
# include.adjrs = T,
# include.lr = F)
texreg::htmlreg(model_list,
stars = c(0.001, 0.01, 0.05, 0.1),
custom.coef.map = name_map,
symbol = "+",
table = F,
booktabs = T,
use.packages = F,
dcolumn = T,
include.cluster = T,
include.rsquared = F,
star.symbol = "\\*",
include.lr = F,
caption = "")
| Model 1 | Model 2 | Model 3 | Model 4 | ||
|---|---|---|---|---|---|
| Power-Sharing (binary) | 0.11* | 0.23* | 0.11* | 0.22* | |
| (0.05) | (0.10) | (0.05) | (0.10) | ||
| Power-Sharing (binary) * Aid | -0.05** | -0.07* | -0.05** | -0.06+ | |
| (0.02) | (0.03) | (0.02) | (0.04) | ||
| Aid / GDP (log) | -0.01 | -0.01 | -0.00 | 0.02 | |
| (0.01) | (0.02) | (0.01) | (0.03) | ||
| GDP p/c | 0.01 | -0.05 | -0.00 | -0.01 | |
| (0.02) | (0.04) | (0.02) | (0.04) | ||
| Population | -0.01 | 0.01 | -0.02 | 0.01 | |
| (0.01) | (0.02) | (0.01) | (0.02) | ||
| Conflict Intensity | 0.08* | 0.01 | 0.01 | -0.04 | |
| (0.03) | (0.07) | (0.04) | (0.06) | ||
| Non-State Violence | -0.05 | -0.02 | 0.01 | 0.01 | |
| (0.03) | (0.07) | (0.04) | (0.05) | ||
| Nat. Res. Rents | -0.00* | 0.00 | -0.00* | -0.00 | |
| (0.00) | (0.00) | (0.00) | (0.00) | ||
| Regime Type | 0.08*** | 0.12*** | 0.10*** | 0.13*** | |
| (0.01) | (0.02) | (0.01) | (0.02) | ||
| Num. obs. | 108 | 108 | 270 | 270 | |
| Countries | 25 | 25 | |||
| Adj. R2 | 0.70 | 0.40 | 0.58 | 0.51 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||||
use ".\data\diss_df_iv.dta", replace
* Generate interactions & interactions with instrument
gen cabXaid = cabinetINC * aiddata_AidGDP_ln
gen cabXaid_instr = cabinetINC * aid_instrumented_gdp_ln
* estimate 2SLS for judicial independence
ivreg2 LJI_t2 cabinetINC ln_gdp_pc ln_pop nonstate conf_intens WBnatres fh ///
(aiddata_AidGDP_ln cabXaid = aid_instrumented_gdp_ln cabXaid_instr), cluster(GWNo) first