Patterns
# Libraries
library(tidyverse)
library(ggrepel)
library(tikzDevice)
library(gridExtra)
library(cowplot)
# Load data
load("./data/nelda_ps.rda")
# Plot Power-Sharing
nelda_ps$cabinetINClabel <- ifelse(nelda_ps$cabinetINC.12 == 1,
"Power-Sharing",
"No Power-Sharing")
nelda_quality_boxplot <- ggplot(nelda_ps, aes(x = cabinetINClabel, y = quality)) +
geom_jitter(height = 0.1, size = 1.7, alpha = 0.5) +
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") +
labs(x = "", y = "NELDA Election Quality Index")
# Plot Aid
nelda_aid_plot <- ggplot(nelda_ps, aes(x = log(aiddata_AidGDP), y = quality)) +
geom_jitter(size = 1.7,
width = 0.1,
height = 0.1,
alpha = 0.5) +
geom_smooth(method = "lm") +
theme_bw() +
labs(y = "NELDA Election Quality Index", x = "All Aid / GDP (log)")
# Output for Manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aid_ps_individ_nelda.tex", height = 3.5)
# plot_grid(nelda_quality_boxplot, nelda_aid_plot)
# dev.off()
# Output for Rep. Archive
plot_grid(nelda_quality_boxplot, nelda_aid_plot)

# Libraries
library(tidyverse)
library(ggrepel)
library(gridExtra)
# Load data
load("./data/nelda_ps.rda")
aid_ps_election_nelda_plot <- ggplot(nelda_ps, aes(x = aid_ln, y = quality)) +
geom_jitter(size = 2, width = 0.1, height = 0.1, alpha = 0.5) +
geom_smooth(method = "lm") +
facet_wrap( ~ cabinetINC.12, nrow = 1,
labeller = labeller(cabinetINC.12 = c("0" = "No Power-Sharing",
"1" = "Power-Sharing"))) +
theme_bw() +
theme(strip.text = element_text(size=11)) +
labs(x = "Aid / GDP (log)", y = "NELDA Election Quality Index")
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aid_ps_interaction_rawdata.tex", height = 3.5, width = 6.5)
# grid.arrange(aid_ps_election_nelda_plot)
# dev.off()
# Output Replication Archive
print(aid_ps_election_nelda_plot)

# Libraries
library(tidyverse)
library(rms)
library(tikzDevice)
# load data
load("./data/nelda_ps.rda")
# Reestimate Models
# Models NELDA
model_aidps_quality_cabinc <- ols(quality ~
aid_ln *
cabinetINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabinc <- robcov(model_aidps_quality_cabinc, nelda_ps$country)
model_aidps_quality_cabcount <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount <- robcov(model_aidps_quality_cabcount, nelda_ps$country)
# Plot ME
source("./functions/interaction_plots.R")
# Output for manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/interaction_aidpselections.tex", height = 3.5)
# par(mfrow=c(1,3),
# mar = c(4, 5, 4, 2),
# cex.lab = 1.1,
# cex.axis = 0.9,
# mgp = c(3, 0.7, 0))
#
# interaction_plot_continuous(model_aidps_quality_cabcount,
# "cabinetCOUNT.12",
# "aid_ln",
# "aid_ln * cabinetCOUNT.12",
# title = "",
# ylab = "Marginal effect of Power-Sharing (cabinet) \n on Election Quality ",
# xlab = "a) Aid / GDP (Log)\n",
# add_median_effect = T,
#
# conf = .90)
#
# interaction_plot_continuous(model_aidps_quality_cabcount,
# "aid_ln",
# "cabinetCOUNT.12",
# "aid_ln * cabinetCOUNT.12",
# title = "",
# xlab = "\n Power-Sharing (cabinet) - \nNumber of rebel seats",
# ylab = "Estimated marginal coefficient of\n Aid / GDP (log)",
# conf = .90)
#
# interaction_plot_binary(model_aidps_quality_cabinc,
# "aid_ln",
# "cabinetINC.12",
# "aid_ln * cabinetINC.12",
# title = "",
# xlab = "\n Power-Sharing (cabinet) - \nBinary",
# ylab = "Estimated marginal coefficient of\n Aid / GDP (log)",
# conf = .90)
#
# dev.off()
# Output for Replication Archive:
par(mfrow=c(1,3),
mar = c(4, 5, 4, 2),
cex.lab = 1.1,
cex.axis = 0.9,
mgp = c(3, 0.7, 0))
interaction_plot_continuous(model_aidps_quality_cabcount,
"cabinetCOUNT.12",
"aid_ln",
"aid_ln * cabinetCOUNT.12",
title = "",
ylab = "Marginal effect of Power-Sharing (cabinet) \n on Election Quality ",
xlab = "a) Aid / GDP (Log)\n",
add_median_effect = T,
conf = .90)
interaction_plot_continuous(model_aidps_quality_cabcount,
"aid_ln",
"cabinetCOUNT.12",
"aid_ln * cabinetCOUNT.12",
title = "",
xlab = "\n Power-Sharing (cabinet) - \nNumber of rebel seats",
ylab = "Estimated marginal coefficient of\n Aid / GDP (log)",
conf = .90)
interaction_plot_binary(model_aidps_quality_cabinc,
"aid_ln",
"cabinetINC.12",
"aid_ln * cabinetINC.12",
title = "",
xlab = "\n Power-Sharing (cabinet) - \nBinary",
ylab = "Estimated marginal coefficient of\n Aid / GDP (log)",
conf = .90)

# Libraries
library(tidyverse)
library(rms)
# Load Data
load("./data/nelda_ps.rda")
# Estimate Model
datadist_nelda <- datadist(nelda_ps); options(datadist='datadist_nelda')
model_aidps_quality_cabcount <- ols(v2xel_frefair ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount <- robcov(model_aidps_quality_cabcount, nelda_ps$country)
# Generate Predictions
prediction_nelda <- Predict(model_aidps_quality_cabcount,
cabinetCOUNT.12 = c(0, 10), # no / much power-sharing
aid_ln = seq(-6, 3.9, 0.1),
fh = 3.57,
WBnatres = 7.860124) # range of aid
# generate plot
ME_aidps_interaction_nelda <- ggplot(data.frame(prediction_nelda),
aes(x = exp(aid_ln),
y = yhat,
group = as.factor(cabinetCOUNT.12))) +
geom_line( color = "black", size = 1) +
geom_ribbon(aes(ymax = upper,
ymin = lower,
fill = as.factor(cabinetCOUNT.12)),
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 = "Election Quality") +
theme(legend.position = "bottom")
prediction_nelda_ps <- Predict(model_aidps_quality_cabcount,
cabinetCOUNT.12 = seq(0, 10, 1),
aid_ln = c(0, 3.4),
fh = 3.57,
WBnatres = 7.860124)
prediction_nelda_ps$aid_ln <- round(exp(prediction_nelda_ps$aid_ln), 0)
meplot_aidps_nelda_interaction_ps <- ggplot(data.frame(prediction_nelda_ps),
aes(x = cabinetCOUNT.12,
y = yhat,
group = as.factor(aid_ln))) +
geom_line( color = "black", size = 1) +
geom_ribbon(aes(ymax = upper,
ymin = lower,
fill = as.factor(aid_ln)),
alpha = 0.7) +
scale_x_continuous(breaks = seq(0, 10, 2)) +
scale_fill_manual(values = c("#b3cde3", "#e41a1c"),
name = "Aid in per cent of GDP:") +
theme_bw() +
theme(text = element_text(size=8)) +
labs(x = "Power-Sharing (No. of Rebel Seats)",
y = "Election Quality") +
theme(legend.position = "bottom")
# Outut Manuscript
# options( tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/aidps_elections_ME.tex", height = 4.5, width = 6.5)
# grid.arrange(meplot_aidps_nelda_interaction_ps,
# ME_aidps_interaction_nelda,
# nrow = 1)
# dev.off()
# Output Replication Archive
gridExtra::grid.arrange(meplot_aidps_nelda_interaction_ps,
ME_aidps_interaction_nelda,
nrow = 1)

# Libraries
library(tidyverse)
library(lfe)
# Load data
load("./data/nelda_ps.rda")
model_aidps_quality_cabinc <- felm(quality ~
aid_ln *
cabinetINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
model_aidps_quality_seninc <- felm(quality ~
aid_ln *
seniorINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
model_aidps_quality_nonseninc <- felm(quality ~
aid_ln *
nonseniorINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
model_aidps_quality_dga <- felm(quality ~
log(dga_gdp_null + 1) *
cabinetINC.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
model_aidps_quality_progaid <- felm(quality ~
log(program_aid_gdp_null + 1) *
cabinetINC.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
model_aidps_quality_budgetaid <- felm(quality ~
log(budget_aid_gdp_null + 1) *
cabinetINC.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | 0 | country,
data = nelda_ps)
# extract coefficients for interaction term
mechanism_models <- list("Cabinet PS (Baseline)" = model_aidps_quality_cabinc,
"Senior PS" = model_aidps_quality_seninc,
"Nonsenior PS" = model_aidps_quality_nonseninc,
"DGA" = model_aidps_quality_dga,
"Program Aid"= model_aidps_quality_progaid,
"Budget Aid" = model_aidps_quality_budgetaid) %>%
enframe() %>%
mutate(tidymodel = map(value, broom::tidy)) %>%
unnest(tidymodel) %>%
filter(grepl(":", term)) %>%
mutate(name = forcats::fct_relevel(name, c("Cabinet PS (Baseline)",
"Senior PS",
"Nonsenior PS",
"DGA",
"Program Aid",
"Budget Aid")))
mechanism_models_elec <- mechanism_models
save(mechanism_models_elec, file= "./data/mechanism_models_elec.rda")
mechanisms_elec_models_plot <- ggplot(mechanism_models, aes(x = name, y = estimate) ) +
geom_point() +
geom_errorbar(aes(ymin = estimate - 1.67 * std.error,
ymax = estimate + 1.67 * std.error),
width = 0) +
theme_bw() +
theme(axis.title.y = element_text(size = 10)) +
geom_hline(yintercept = 0, linetype = 2) +
labs(x = "", y = "Coefficient Estimate of Interaction between \n Different Types of Power-Sharing (binary) \n and Different Aid Types")
# Output for manuscript
# options(tikzDocumentDeclaration = "\\documentclass[11pt]{article}" )
# tikz("../figures/mechanims_elec_models_plot.tex", height = 2.75)
# print(mechanisms_elec_models_plot)
# dev.off()
# Output for replication archive
print(mechanisms_elec_models_plot)

# Libraries
library(rms)
library(texreg)
# Load data
load("./data/nelda_ps.rda")
## Models NELDA (V-Dem Models see Appendix)
model_ps_quality_cabcount <- ols(quality ~
cabinetCOUNT.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_ps_quality_cabcount <- robcov(model_ps_quality_cabcount, nelda_ps$country)
model_ps_quality_seniorcount <- ols(quality ~
seniorCOUNT.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_ps_quality_seniorcount <- robcov(model_ps_quality_seniorcount, nelda_ps$country)
model_ps_quality_nonseniorcount <- ols(quality ~
nonseniorCOUNT.12 +
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_ps_quality_nonseniorcount <- robcov(model_ps_quality_nonseniorcount, nelda_ps$country)
# Models Aid
# DGA
model_dga_quality <- ols(quality ~
cabinetCOUNT.12 +
log(dga_gdp_null + 1 )+
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_dga_quality <- robcov(model_dga_quality, nelda_ps$country)
# program aid
model_prog_aid_quality <- ols(quality ~
cabinetCOUNT.12 +
log(program_aid_gdp_null + 1 )+
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_prog_aid_quality <- robcov(model_prog_aid_quality, nelda_ps$country)
# budget aid
model_budgetaid_quality <- ols(quality ~
cabinetCOUNT.12 +
log(budget_aid_gdp_null + 1 )+
aid_ln +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_budgetaid_quality <- robcov(model_budgetaid_quality, nelda_ps$country)
# individual effects model list
ind_effect_models <- list(model_ps_quality_cabcount,
model_ps_quality_seniorcount,
model_ps_quality_nonseniorcount,
model_dga_quality,
model_prog_aid_quality,
model_budgetaid_quality)
# Output
coef_name_map <- list(cabinetCOUNT.12 = "Power-Sharing (cabinet)",
seniorCOUNT.12 = "Power-Sharing (senior)",
nonseniorCOUNT.12 = "Power-Sharing (nonsenior)",
aid_ln = "Aid/GDP (log)",
dga_gdp_null = "DGA/GDP (log)",
program_aid_gdp_null= "Program Aid / GDP (log)",
budget_aid_gdp_null = "Budget Aid / GDP (log",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)")
# Get number of clusters
source("./functions/extract_ols_custom.R")
# Output Manuscript
# texreg(l = ind_effect_models,
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = coef_name_map,
# file = "../output/aid_ps_indeff_elections.tex",
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# dcolumn = T,
# include.lr = F,
# include.rsquared = F,
# include.cluster = T,
#
# include.adjrs = T,
# caption = "")
# Output Replication Archive
htmlreg(l = ind_effect_models,
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.lr = F,
include.rsquared = F,
include.adjrs = T,
include.cluster = T,
caption = "",
star.symbol = "\\*")
| Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Model 6 | ||
|---|---|---|---|---|---|---|---|
| Power-Sharing (cabinet) | 0.12* | 0.10+ | 0.11* | 0.13* | |||
| (0.05) | (0.05) | (0.05) | (0.05) | ||||
| Power-Sharing (senior) | 0.42** | ||||||
| (0.14) | |||||||
| Power-Sharing (nonsenior) | 0.15* | ||||||
| (0.07) | |||||||
| Aid/GDP (log) | -0.08 | -0.09 | -0.07 | -0.12 | -0.18* | -0.14 | |
| (0.09) | (0.09) | (0.09) | (0.09) | (0.09) | (0.09) | ||
| DGA/GDP (log) | 0.47 | ||||||
| (0.38) | |||||||
| Program Aid / GDP (log) | 0.36 | ||||||
| (0.42) | |||||||
| Budget Aid / GDP (log | 0.31 | ||||||
| (0.27) | |||||||
| Nat. Res. Rents | -0.03+ | -0.03* | -0.02 | -0.03+ | -0.03+ | -0.03* | |
| (0.01) | (0.02) | (0.01) | (0.02) | (0.02) | (0.01) | ||
| Regime Type (FH) | 0.31* | 0.29+ | 0.32* | 0.28+ | 0.31* | 0.27+ | |
| (0.15) | (0.15) | (0.16) | (0.16) | (0.16) | (0.15) | ||
| Nonstate Conflict | -2.52** | -2.47** | -2.56** | -2.48** | -2.46** | -2.55** | |
| (0.83) | (0.82) | (0.84) | (0.81) | (0.82) | (0.88) | ||
| Conflict Intensity | -0.68 | -0.65 | -0.66 | -0.72 | -0.78+ | -0.77 | |
| (0.49) | (0.47) | (0.50) | (0.49) | (0.46) | (0.50) | ||
| Population (log) | 0.06 | 0.07 | 0.06 | 0.09 | 0.09 | 0.09 | |
| (0.22) | (0.21) | (0.22) | (0.21) | (0.22) | (0.22) | ||
| GDP p/c (log) | -0.24 | -0.22 | -0.25 | -0.18 | -0.13 | -0.18 | |
| (0.24) | (0.24) | (0.24) | (0.25) | (0.30) | (0.24) | ||
| Num. obs. | 142 | 142 | 142 | 142 | 142 | 142 | |
| Countries | 41 | 41 | 41 | 41 | 41 | 41 | |
| Adj. R2 | 0.17 | 0.19 | 0.16 | 0.18 | 0.17 | 0.18 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||||||
# Libraries
library(rms)
# Load data
load("./data/nelda_ps.rda")
# nelda_ps <- filter(nelda_ps, country != "Bosnia-Herzegovina")
# Models NELDA
model_aidps_quality_cabinc <- ols(quality ~
aid_ln *
cabinetINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabinc <- robcov(model_aidps_quality_cabinc, nelda_ps$country)
model_aidps_quality_cabcount <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount <- robcov(model_aidps_quality_cabcount, nelda_ps$country)
# Model Vdem
model_aidps_vdem_cabinc <- ols(v2xel_frefair ~
aid_ln *
cabinetINC.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_vdem_cabinc <- robcov(model_aidps_vdem_cabinc, nelda_ps$country)
model_aidps_vdem_cabcount <- ols(v2xel_frefair ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_vdem_cabcount <- robcov(model_aidps_vdem_cabcount, nelda_ps$country)
# Output
int_eff_model_list <- list(model_aidps_quality_cabinc,
model_aidps_quality_cabcount,
model_aidps_vdem_cabinc,
model_aidps_vdem_cabcount)
coef_name_map <- list( cabinetINC.12 = "Power-Sharing (binary)",
"aid_ln * cabinetINC.12" = "Power-Sharing (binary) * Aid",
cabinetCOUNT.12 = "Power-Sharing (cabinet)",
"aid_ln * cabinetCOUNT.12" = "Power-Sharing (cabinet) * Aid",
aid_ln = "Aid/GDP (log)",
dga_gdp_null = "DGA/GDP (log)",
program_aid_gdp_null= "Program Aid / GDP (log)",
budget_aid_gdp_null = "Budget Aid / GDP (log",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)")
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
# custom_texreg(l = int_eff_model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# custom.coef.map = coef_name_map,
# file = "../output/aidps_elections_interaction_mainresults.tex",
# symbol = "+",
# table = F,
# booktabs = T,
# custom.multicol = T,
# custom.model.names = c(" \\multicolumn{2}{c}{\\textbf{NELDA Election Quality}} &
# \\multicolumn{2}{c}{\\textbf{V-Dem Clean Elections Index}} \\\\
# \\cmidrule(r){2-3} \\cmidrule(r){4-5}
# & \\multicolumn{1}{c}{(1) }",
# "\\multicolumn{1}{c}{(2) }",
# "\\multicolumn{1}{c}{(3) }",
# "\\multicolumn{1}{c}{(4) }"),
# use.packages = F,
# dcolumn = T,
# include.lr = F,
# include.cluster = T,
# include.rsquared = F,
# include.adjrs = T)
htmlreg(l = int_eff_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.lr = F,
include.cluster = T,
include.rsquared = F,
include.adjrs = T,
caption = "",
star.symbol = "\\*")
| Model 1 | Model 2 | Model 3 | Model 4 | ||
|---|---|---|---|---|---|
| Power-Sharing (binary) | -2.97** | -0.24* | |||
| (1.12) | (0.11) | ||||
| Power-Sharing (binary) * Aid | 1.49*** | 0.17*** | |||
| (0.43) | (0.04) | ||||
| Power-Sharing (cabinet) | -0.22* | -0.04* | |||
| (0.09) | (0.02) | ||||
| Power-Sharing (cabinet) * Aid | 0.12*** | 0.02*** | |||
| (0.04) | (0.01) | ||||
| Aid/GDP (log) | -0.12 | -0.08 | -0.02+ | -0.01 | |
| (0.08) | (0.09) | (0.01) | (0.01) | ||
| Nat. Res. Rents | -0.03* | -0.03* | -0.01*** | -0.01*** | |
| (0.01) | (0.02) | (0.00) | (0.00) | ||
| Regime Type (FH) | 0.33* | 0.29+ | 0.09*** | 0.08*** | |
| (0.15) | (0.15) | (0.02) | (0.02) | ||
| Nonstate Conflict | -2.48** | -2.46** | -0.25*** | -0.24*** | |
| (0.80) | (0.80) | (0.05) | (0.05) | ||
| Conflict Intensity | -0.47 | -0.58 | 0.02 | 0.01 | |
| (0.45) | (0.49) | (0.05) | (0.07) | ||
| Population (log) | 0.08 | 0.07 | 0.03* | 0.02 | |
| (0.21) | (0.21) | (0.01) | (0.01) | ||
| GDP p/c (log) | -0.20 | -0.18 | 0.02 | 0.02 | |
| (0.23) | (0.25) | (0.02) | (0.02) | ||
| Num. obs. | 142 | 142 | 141 | 141 | |
| Countries | 41 | 41 | 41 | 41 | |
| Adj. R2 | 0.21 | 0.18 | 0.53 | 0.49 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||||
# Libraries
library(rms)
library(plm)
library(countrycode)
# load data
load("./data/nelda_ps.rda")
# aid cutoffs
model_aidps_aidcutoff <- ols(quality ~
aid_ln +
nelda57 * # aid cutoff
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_aidcutoff <- robcov(model_aidps_aidcutoff, nelda_ps$country)
# election monitors
model_aidps_elmons <- ols(quality ~
aid_ln +
nelda45 * # aid cutoff
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_elmons <- robcov(model_aidps_elmons, nelda_ps$country)
# aid cutoffs
model_aidps_aidcutoff_vdem <- ols(v2xel_frefair ~
aid_ln +
nelda57 * # aid cutoff
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_aidcutoff_vdem <- robcov(model_aidps_aidcutoff_vdem, nelda_ps$country)
# election monitors
model_aidps_elmons_vdem <- ols(v2xel_frefair ~
aid_ln +
nelda45 * # election monitors
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps, x = T, y = T)
model_aidps_elmons_vdem <- robcov(model_aidps_elmons_vdem, nelda_ps$country)
# Output
model_list <- list(model_aidps_aidcutoff,
model_aidps_elmons,
model_aidps_aidcutoff_vdem,
model_aidps_elmons_vdem)
coef_name_map <- list( cabinetINC.12 = "Power-Sharing (binary)",
cabinetCOUNT.12 = "Power-Sharing (cabinet)",
nelda57 = "Aid Cut-Off",
"nelda57 * cabinetCOUNT.12" = "Power-Sharing (cabinet) * Aid Cut-Off",
nelda45 = "Election Monitors",
"nelda45 * cabinetCOUNT.12" = "Power-Sharing (cabinet) * Election Monitors",
"aid_ln * cabinetINC.12" = "Power-Sharing (binary) * Aid",
"aid_ln * cabinetCOUNT.12" = "Power-Sharing (cabinet) * Aid",
aid_ln = "Aid/GDP (log)",
dga_gdp_null = "DGA/GDP (log)",
program_aid_gdp_null= "Program Aid / GDP (log)",
budget_aid_gdp_null = "Budget Aid / GDP (log",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)")
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
#
# custom_texreg(l = model_list,
# stars = c(0.001, 0.01, 0.05, 0.1),
# file = "../output/aidcutoff_elmon_elections.tex",
# custom.coef.map = coef_name_map,
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# custom.multicol = T,
# custom.model.names = c(" \\multicolumn{2}{c}{\\textbf{NELDA Election Quality}} &
# \\multicolumn{2}{c}{\\textbf{V-Dem Clean Elections Index}} \\\\
# \\cmidrule(r){2-3} \\cmidrule(r){4-5}
# & \\multicolumn{1}{c}{(1) }",
# "\\multicolumn{1}{c}{(2) }",
# "\\multicolumn{1}{c}{(3) }",
# "\\multicolumn{1}{c}{(4) }"),
# dcolumn = T,
# include.lr = F,
# include.rsquared = F,
# include.adjrs = T,
# include.cluster = T)
htmlreg(l = 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.lr = F,
include.rsquared = F,
include.adjrs = T,
include.cluster = T,
caption = "",
star.symbol = "\\*")
| Model 1 | Model 2 | Model 3 | Model 4 | ||
|---|---|---|---|---|---|
| Power-Sharing (cabinet) | 0.11* | 0.48 | 0.02* | 0.02 | |
| (0.05) | (0.63) | (0.01) | (0.09) | ||
| Aid Cut-Off | -0.41 | -0.02 | |||
| (0.83) | (0.09) | ||||
| Power-Sharing (cabinet) * Aid Cut-Off | 1.43** | 0.15** | |||
| (0.47) | (0.05) | ||||
| Election Monitors | 0.57 | 0.03 | |||
| (0.71) | (0.05) | ||||
| Power-Sharing (cabinet) * Election Monitors | -0.36 | 0.00 | |||
| (0.63) | (0.09) | ||||
| Aid/GDP (log) | -0.09 | -0.10 | -0.01 | -0.01 | |
| (0.08) | (0.09) | (0.01) | (0.01) | ||
| Nat. Res. Rents | -0.03+ | -0.03+ | -0.01*** | -0.01*** | |
| (0.01) | (0.01) | (0.00) | (0.00) | ||
| Regime Type (FH) | 0.32* | 0.35* | 0.09*** | 0.09*** | |
| (0.15) | (0.17) | (0.02) | (0.02) | ||
| Nonstate Conflict | -2.60** | -2.27** | -0.26*** | -0.24*** | |
| (0.90) | (0.87) | (0.05) | (0.05) | ||
| Conflict Intensity | -0.76 | -0.67 | -0.01 | -0.01 | |
| (0.49) | (0.50) | (0.07) | (0.07) | ||
| Population (log) | 0.08 | 0.02 | 0.02 | 0.02 | |
| (0.22) | (0.18) | (0.01) | (0.02) | ||
| GDP p/c (log) | -0.29 | -0.28 | 0.01 | 0.01 | |
| (0.24) | (0.24) | (0.02) | (0.03) | ||
| Num. obs. | 142 | 142 | 141 | 141 | |
| Countries | 41 | 41 | 41 | 41 | |
| Adj. R2 | 0.17 | 0.16 | 0.46 | 0.45 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||||
# Libraries
library(rms)
library(plm)
library(countrycode)
library(texreg)
# load data
load("./data/nelda_ps.rda")
# Ethnic Fractionalization
model_aidps_quality_cabcount_elf <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population) +
Ethnic
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount_elf <- robcov(model_aidps_quality_cabcount_elf, nelda_ps$country)
# PKO
model_aidps_quality_cabcount_pko <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population) +
DS_ordinal
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount_pko <- robcov(model_aidps_quality_cabcount_pko, nelda_ps$country)
# cabinet size
library(readxl)
cnts <- read_excel("./data/CNTSDATA.xls")
DEFINEDNAME: 21 00 00 01 0b 00 00 00 01 00 00 00 00 00 00 0d 3b 00 00 00 00 e5 3b 00 00 c1 00 DEFINEDNAME: 21 00 00 01 0b 00 00 00 01 00 00 00 00 00 00 0d 3b 00 00 00 00 e5 3b 00 00 c1 00 DEFINEDNAME: 21 00 00 01 0b 00 00 00 01 00 00 00 00 00 00 0d 3b 00 00 00 00 e5 3b 00 00 c1 00 DEFINEDNAME: 21 00 00 01 0b 00 00 00 01 00 00 00 00 00 00 0d 3b 00 00 00 00 e5 3b 00 00 c1 00
cnts <- cnts %>% filter(year >= 1989)
cnts$iso3c <- countrycode(cnts$country, "country.name", "iso3c")
cnts <- cnts %>% filter(country != "SOMALILAND")
testcabsize <- left_join(nelda_ps, cnts[, c("iso3c", "year", "polit10")])
testcabsize$ps_share <- testcabsize$cabinetCOUNT / testcabsize$polit10 * 100
model_el_cabshare <- ols(quality ~
aid_ln *
ps_share +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = testcabsize, x = T, y = T)
model_el_cabshare <- robcov(model_el_cabshare, testcabsize$country)
# Was Incumbent contested: nelda20
nelda_ps <- as.data.frame(nelda_ps)
nelda_ps$nelda20 <- ifelse(nelda_ps$nelda20 == "yes", 1, 0)
inc_contested <- nelda_ps %>%
filter(nelda20 == 1)
inc_notcontested <- nelda_ps %>%
filter(nelda20 == 0)
inc_contested_model <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = inc_contested, x = T, y = T)
inc_contested_model <- robcov(inc_contested_model, inc_contested$country)
inc_notcontested_model <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = inc_notcontested, x = T, y = T)
inc_notcontested_model <- robcov(inc_notcontested_model, inc_notcontested$country)
# Type of Election
model_aidps_quality_cabcount_eltype <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population) +
types
,
data = nelda_ps, x = T, y = T)
model_aidps_quality_cabcount_eltype <- robcov(model_aidps_quality_cabcount_eltype, nelda_ps$country)
# Random Effects
countryre_aidps_quality_cabcount <- plm(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps,
index = c("country", "electionid"),
model = "random")
series nelda16, nelda23notes, nelda41notes, nelda42notes, longenough, Item, newconflictinyearv412, onset5v412, onset8v412, onset20v412, bothgovterrv412 are constants and have been removed
countryre_aidps_quality_cabcount$vcov <- vcovHC(countryre_aidps_quality_cabcount)
# Region FE
nelda_ps$region_fe <- countrycode(nelda_ps$country, "country.name", "region")
regionfe_aidps_quality_cabcount <- ols(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)+
region_fe
,
data = nelda_ps, y = T, x = T)
regionfe_aidps_quality_cabcount <- robcov(regionfe_aidps_quality_cabcount, nelda_ps$country)
# Country FE
countryfe_aidps_quality_cabcount <- plm(quality ~
aid_ln *
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
,
data = nelda_ps,
index = c("country", "electionid"),
model = "within")
series nelda16, nelda23notes, nelda41notes, nelda42notes, longenough, Item, newconflictinyearv412, onset5v412, onset8v412, onset20v412, bothgovterrv412 are constants and have been removed
countryfe_aidps_quality_cabcount$vcov <- vcovHC(countryfe_aidps_quality_cabcount)
# Output
# First: create model list
rob_election_modellist <- list(model_aidps_quality_cabcount_elf,
model_aidps_quality_cabcount_pko,
model_el_cabshare,
inc_contested_model,
inc_notcontested_model,
# model_aidps_quality_cabcount_eltype,
countryre_aidps_quality_cabcount,
regionfe_aidps_quality_cabcount)
coef_name_map <- list(cabinetINC.12 = "Power-Sharing (binary)",
cabinetCOUNT.12 = "Power-Sharing (cabinet)",
"aid_ln:cabinetCOUNT.12" = "Power-Sharing (cabinet) * Aid",
"aid_ln * cabinetCOUNT.12" = "Power-Sharing (cabinet) * Aid",
ps_share = "Power-Sharing (cabinet share)",
"aid_ln * ps_share" = "Power-Sharing (cabinet share) * Aid",
aid_ln = "Aid/GDP (log)",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
"log(population)" = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)",
"log(gdp_per_capita_un)" = "GDP p/c (log)",
Ethnic = "Ethnic Fractionalization",
DS_ordinal = "UN PKO",
nelda45 = "Election Monitors",
types = "Type of Election")
source("./functions/extract_ols_custom.R")
source("./functions/extract_plm_custom.R")
# Output Manuscript
texreg(rob_election_modellist,
stars = c(0.001, 0.01, 0.05, 0.1),
custom.coef.map = coef_name_map,
file = "../output/aidps_elections_interaction_robustness.tex",
symbol = "+",
table = F,
booktabs = T,
custom.model.names = c("(1) ELF",
"(2) UN PKO",
"(3) Cab. Size",
"(4) Inc. Contest.",
"(5) Inc. Not Cont.",
"(6) RE",
"(6) Region FE" ),
use.packages = F,
dcolumn = T,
include.lr = F,
include.adjrs = T,
caption = "",
star.symbol = "\\*",
include.rsquared = F,
include.cluster = T,
include.variance = F)
# Output Replication Archive
texreg::htmlreg(rob_election_modellist,
stars = c(0.001, 0.01, 0.05, 0.1),
custom.coef.map = coef_name_map,
symbol = "+",
table = F,
custom.model.names = c("(1) ELF",
"(2) UN PKO",
"(3) Cab. Size",
"(4) Inc. Contest.",
"(5) Inc. Not Cont.",
"(6) RE",
"(6) Region FE" ),
booktabs = T,
use.packages = F,
dcolumn = T,
include.lr = F,
include.adjrs = T,
caption = "",
star.symbol = "\\*",
include.rsquared = F,
include.cluster = T,
include.variance = F)
| (1) ELF | (2) UN PKO | (3) Cab. Size | (4) Inc. Contest. | (5) Inc. Not Cont. | (6) RE | (6) Region FE | ||
|---|---|---|---|---|---|---|---|---|
| Power-Sharing (cabinet) | -0.18+ | -0.17+ | -0.11 | -0.33** | -0.27* | -0.21+ | ||
| (0.11) | (0.09) | (0.11) | (0.12) | (0.12) | (0.11) | |||
| Power-Sharing (cabinet) * Aid | 0.09* | 0.09* | 0.10** | 0.15** | 0.12* | 0.10** | ||
| (0.04) | (0.04) | (0.04) | (0.05) | (0.05) | (0.04) | |||
| Power-Sharing (cabinet share) | -0.05+ | |||||||
| (0.02) | ||||||||
| Power-Sharing (cabinet share) * Aid | 0.03** | |||||||
| (0.01) | ||||||||
| Aid/GDP (log) | -0.16+ | -0.09 | -0.04 | -0.18 | 0.02 | -0.02 | -0.09 | |
| (0.08) | (0.09) | (0.10) | (0.12) | (0.09) | (0.11) | (0.10) | ||
| Nat. Res. Rents | -0.04*** | -0.03+ | -0.02 | -0.04* | -0.03+ | -0.01 | -0.04** | |
| (0.01) | (0.02) | (0.02) | (0.02) | (0.02) | (0.02) | (0.01) | ||
| Regime Type (FH) | 0.26+ | 0.32* | 0.19 | 0.44* | 0.24 | 0.35+ | 0.33* | |
| (0.14) | (0.16) | (0.20) | (0.21) | (0.16) | (0.18) | (0.16) | ||
| Nonstate Conflict | -2.86** | -2.46** | -1.99* | -1.07 | -3.59*** | -2.99*** | -3.02*** | |
| (1.03) | (0.80) | (0.94) | (1.15) | (0.47) | (0.75) | (0.81) | ||
| Conflict Intensity | -0.70 | -0.78 | -0.61 | -0.65 | -0.67 | -0.63 | -0.07 | |
| (0.45) | (0.51) | (0.52) | (0.55) | (0.56) | (0.67) | (0.52) | ||
| Population (log) | -0.01 | 0.07 | 0.21 | -0.09 | 0.30 | -0.08 | -0.01 | |
| (0.14) | (0.21) | (0.25) | (0.22) | (0.19) | (0.19) | (0.18) | ||
| GDP p/c (log) | -0.29 | -0.16 | -0.00 | -0.36 | -0.15 | -0.21 | -0.32 | |
| (0.24) | (0.24) | (0.33) | (0.30) | (0.26) | (0.33) | (0.31) | ||
| Ethnic Fractionalization | 2.69*** | |||||||
| (0.68) | ||||||||
| UN PKO | 0.17 | |||||||
| (0.19) | ||||||||
| Num. obs. | 142 | 142 | 114 | 74 | 68 | 142 | 142 | |
| Countries | 41 | 41 | 36 | 41 | 34 | 41 | 41 | |
| Adj. R2 | 0.31 | 0.19 | 0.10 | 0.13 | 0.22 | 0.40 | 0.36 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | ||||||||
# Libraries
library(rms)
library(texreg)
# Load matched data set
load("./data/nelda_ps_matched.rda")
match_df_elec_reg$aid_ln <- log(match_df_elec_reg$aiddata_AidGDP)
# NELDA
model_matched_aidps_cabINC_nelda <- rms::ols(quality ~
aid_ln * cabinetINC.12 +
log(gdp_per_capita_un) +
log(population) +
conf_intens +
# nonstate +
WBnatres +
fh,
data = match_df_elec_reg ,
x = T , y = T)
model_matched_aidps_cabINC_nelda <- robcov(model_matched_aidps_cabINC_nelda , match_df_elec_reg$country)
# cabinetINC * Aid; V-Dem
model_matched_aidps_cabINC_vdem <- rms::ols(v2xel_frefair ~
aid_ln * cabinetINC.12 +
log(gdp_per_capita_un) +
log(population) +
conf_intens +
# nonstate +
WBnatres +
fh ,
data = match_df_elec_reg ,
x = T , y = T)
model_matched_aidps_cabINC_vdem <- robcov(model_matched_aidps_cabINC_vdem , match_df_elec_reg$country)
# Output
matched_election_modellist <- list(model_matched_aidps_cabINC_nelda,
model_matched_aidps_cabINC_vdem)
coef_name_map <- list(cabinetINC.12 = "Power-Sharing (binary)",
"aid_ln * cabinetINC.12" = "Power-Sharing (binary) * Aid",
ps_share = "Power-Sharing (cabinet share)",
aid_ln = "Aid/GDP (log)",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
"log(population)" = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)",
"log(gdp_per_capita_un)" = "GDP p/c (log)",
Ethnic = "Ethnic Fractionalization",
DS_ordinal = "UN PKO",
nelda45 = "Election Monitors",
types = "Type of Election")
source("./functions/extract_ols_custom.R")
# texreg(matched_election_modellist,
# file = "../output/matched_results_elections.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,
# custom.model.names = c("(1) NELDA", "(2) V-Dem"),
# dcolumn = T,
# include.lr = F,
# include.adjrs = T,
# caption = "",
# star.symbol = "\\*",
# include.rsquared = F,
# include.cluster = T,
# include.variance = F)
texreg::htmlreg(matched_election_modellist,
stars = c(0.001, 0.01, 0.05, 0.1),
custom.coef.map = coef_name_map,
symbol = "+",
table = F,
booktabs = T,
use.packages = F,
custom.model.names = c("(1) NELDA", "V-Dem"),
dcolumn = T,
include.lr = F,
include.adjrs = T,
caption = "",
star.symbol = "\\*",
include.rsquared = F,
include.cluster = T,
include.variance = F)
| (1) NELDA | V-Dem | ||
|---|---|---|---|
| Power-Sharing (binary) | -2.30* | -0.16+ | |
| (1.08) | (0.08) | ||
| Power-Sharing (binary) * Aid | 1.11* | 0.13*** | |
| (0.46) | (0.03) | ||
| Aid/GDP (log) | 0.18 | -0.00 | |
| (0.39) | (0.04) | ||
| Nat. Res. Rents | -0.02 | -0.00 | |
| (0.02) | (0.00) | ||
| Regime Type (FH) | 0.16 | 0.10+ | |
| (0.37) | (0.05) | ||
| Conflict Intensity | -1.75*** | -0.02 | |
| (0.51) | (0.08) | ||
| Population (log) | 0.58* | 0.04+ | |
| (0.29) | (0.02) | ||
| GDP p/c (log) | 0.12 | 0.03 | |
| (0.59) | (0.06) | ||
| Num. obs. | 72 | 72 | |
| Countries | 26 | 26 | |
| Adj. R2 | 0.18 | 0.33 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||
# Libraries
library(tidyverse)
library(lfe)
# Load elections data
load("./data/nelda_ps.rda")
# load instrument data for aid
load(file = "./data/instrumentedAid2.RData")
nelda_ivreg <- left_join(nelda_ps, instrument_df,
by = c("year", "iso2c"))
nelda_ivreg$total_sum_except <- as.numeric(nelda_ivreg$total_sum_except)
nelda_ivreg$instr_aid_gdp <- log(nelda_ivreg$total_sum_except / nelda_ivreg$GDP)
nelda_ivreg$date <- NULL
nelda_ivreg$StartDate2 <- NULL
nelda_ivreg$yearmon.x <- NULL
nelda_ivreg$yearmon.y <- NULL
nelda_ivreg[nelda_ivreg == ""] <- NA
# hard code interactions for felm
nelda_ivreg$cabXaid_instr <- nelda_ivreg$cabinetCOUNT.12 * nelda_ivreg$instr_aid_gdp
nelda_ivreg$cabXaid <- nelda_ivreg$cabinetCOUNT.12 * nelda_ivreg$aid_ln
# Models
model_iv_aidps_nelda <- felm(quality ~
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | (cabXaid_instr | aid_ln ~ cabXaid + instr_aid_gdp ) | country, data = nelda_ivreg)
# V-Dem
model_iv_aidps_vdem <- felm(v2xel_frefair ~
cabinetCOUNT.12 +
WBnatres +
fh +
nonstate +
conf_intens +
log(gdp_per_capita_un) +
log(population)
| 0 | (cabXaid_instr | aid_ln ~ cabXaid + instr_aid_gdp ) | country, data = nelda_ivreg)
# Output
model_list <- list(model_iv_aidps_nelda,
model_iv_aidps_vdem)
# coef name map
coef_name_map <- list(cabinetCOUNT.12 = "Power-Sharing (cabinet)",
"`aid_ln(fit)`" = "Aid / GDP (instrumented)",
"`cabXaid_instr(fit)`" = "Power-Sharing (cabinet) * Aid (instrumented)",
"aid_ln * cabinetINC.12" = "Power-Sharing (binary) * Aid",
aid_ln = "Aid/GDP (log)",
WBnatres = "Nat. Res. Rents",
fh = "Regime Type (FH)",
nonstate = "Nonstate Conflict",
conf_intens = "Conflict Intensity",
population = "Population (log)",
"log(population)" = "Population (log)",
gdp_per_capita_un = "GDP p/c (log)",
"log(gdp_per_capita_un)" = "GDP p/c (log)")
source("./functions/custom_texreg.R")
environment(custom_texreg) <- asNamespace('texreg')
# Output Manuscript
# custom_texreg(model_list,
# custom.coef.map = coef_name_map,
# file = "../output/iv_results_elections.tex",
# add.lines = list(c("Kleibergen-Paap rk Wald F statistic",
# "17.50",
# "17.50"),
# c("Adj. R$^2$",
# round(summary(model_iv_aidps_nelda)$adj.r.squared, 2),
# round(summary(model_iv_aidps_vdem)$adj.r.squared, 2)),
# c("Countries",
# length(unique(nelda_ivreg$country)),
# length(unique(nelda_ivreg$country)))),
# stars = c(0.001, 0.01, 0.05, 0.1),
# symbol = "+",
# table = F,
# booktabs = T,
# use.packages = F,
# custom.model.names = c("(1) NELDA", "(2) V-Dem"),
# dcolumn = T,
# include.lr = F,
# caption = "",
# star.symbol = "\\*",
# include.rsquared = F,
# include.adjrs = F,
# include.cluster = T,
# include.variance = F)
# output replication archive
texreg::htmlreg(model_list,
custom.coef.map = coef_name_map,
stars = c(0.001, 0.01, 0.05, 0.1),
symbol = "+",
table = F,
booktabs = T,
use.packages = F,
custom.model.names = c("(1) NELDA", "(2) V-Dem"),
dcolumn = T,
include.lr = F,
caption = "",
star.symbol = "\\*",
include.rsquared = F,
include.adjrs = T,
include.cluster = T,
include.variance = F)
| (1) NELDA | (2) V-Dem | ||
|---|---|---|---|
| Power-Sharing (cabinet) | -2.03* | -0.37*** | |
| (0.80) | (0.07) | ||
| Aid / GDP (instrumented) | -0.04 | -0.03 | |
| (0.22) | (0.03) | ||
| Power-Sharing (cabinet) * Aid (instrumented) | 0.10** | 0.02*** | |
| (0.04) | (0.00) | ||
| Nat. Res. Rents | -0.03+ | -0.01*** | |
| (0.02) | (0.00) | ||
| Regime Type (FH) | 0.27 | 0.09*** | |
| (0.18) | (0.02) | ||
| Nonstate Conflict | -2.49** | -0.24*** | |
| (0.86) | (0.05) | ||
| Conflict Intensity | -0.61 | 0.03 | |
| (0.53) | (0.08) | ||
| Population (log) | 0.10 | 0.02 | |
| (0.24) | (0.02) | ||
| GDP p/c (log) | -0.14 | 0.00 | |
| (0.34) | (0.04) | ||
| Num. obs. | 142 | 141 | |
| Adj. R2 (full model) | 0.18 | 0.49 | |
| Adj. R2 (proj model) | 0.18 | 0.49 | |
| ***p < 0.001, **p < 0.01, *p < 0.05, +p < 0.1 | |||
use ".\data\ivelections.dta", replace
*gen aid_ln = log(aiddata_AidGDP)
gen gdp_pc_ln = log(gdp_per_capita_un)
gen ln_pop = log(population)
gen cabXaid = cabinetINC_12 * aid_ln
gen cabXinsaid = cabinetINC_12 * instr_aid_gdp
* 2SLS for NELDA election quality to extract F-Statistic
ivreg2 quality cabinetINC_12 ///
nonstate WBnatres fh gdp_pc_ln ln_pop conf_intens (aid_ln cabXaid = instr_aid_gdp cabXinsaid) , cluster(country) ffirst
ivreg2 v2xel_frefair cabinetINC_12 ///
nonstate WBnatres fh gdp_pc_ln ln_pop conf_intens (aid_ln cabXaid = instr_aid_gdp cabXinsaid) , cluster(country) ffirst