library(tidyverse)
library(plm)
Channels of Democracy
Potential Channels mentioned and their respective variables:
- Log Investment =
loginvpc
- Log TFP =
ltfp
- Index Economic Reforms:
marketref
- Trade Share =
ltrade
- Government Expenditure =
lgov
- Primary Enrollment =
lprienr
- Secondary enrollement =
lsecenr
- Child Mortality =
lmort
- Dummy Unrest =
unrestn
Formula
\[ var_{ct} = \beta D_{ct} + \sum_{j=1}^4 \gamma_j y_{ct-j}+ \sum_{j=1}^4 \delta_j var_{ct-j} +\alpha_c + \theta_t + \epsilon_{ct} \] p = 4 lags = preferred specification
Explanation:
- \(var_{ct}\) = explaining variable
- \(y_ct\) = log GDP per capita in country c at time t
- \(D_{ct}\) = Dichotomous measure of democracy
- 4 lags of log GDP for control
- 4 lags of the explaining variable for control
- \(\alpha\) = country fixed effects
- \(\theta\) = time fixed effects
- \(e\) = error
Imports
<- haven::read_dta("data/DDCGdata.dta")
DDCGdata
<- pdata.frame(DDCGdata, index=c("country_name", "year"))
pdf rm(DDCGdata)
head(pdf)
Models
TFP
<- plm(
model2 ~ dem + plm::lag(y,1:4)+ plm::lag(ltfp, 1:4), #the equation with country fixed effects
ltfp model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Reforms
<- plm(
model3 ~ dem + plm::lag(y,1:4)+ plm::lag(marketref, 1:4), #the equation with country fixed effects
marketref model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Trade
<- plm(
model4 ~ dem + plm::lag(y,1:4)+ plm::lag(ltrade2, 1:4), #the equation with country fixed effects
ltrade2 model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Government Expenditure
<- plm(
model5 ~ dem + plm::lag(y,1:4)+ plm::lag(lgov, 1:4), #the equation with country fixed effects
lgov model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Primary Enrollment
<- plm(
model6 ~ dem + plm::lag(y,1:4)+ plm::lag(lprienr, 1:4), #the equation with country fixed effects
lprienr model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Secondary Enrollment
<- plm(
model7 ~ dem + plm::lag(y,1:4)+ plm::lag(lsecenr, 1:4), #the equation with country fixed effects
lsecenr model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Child Mortality
<- plm(
model8 ~ dem + plm::lag(y,1:4)+ plm::lag(lmort, 1:4), #the equation with country fixed effects
lmort model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Unrest
<- plm(
model9 ~ dem + plm::lag(y,1:4)+ plm::lag(unrestn, 1:4), #the equation with country fixed effects
unrestn model="within", #The fixed effects within estimator
data = pdf,
effect = "twoways"
)
Additional Infos about the Models
<- list(model1, model2, model3, model4, model5, model6, model7, model8, model9) models
Long Run
Calculate the long run effects for the different models with this Formula:
\[ \frac{ \hat\beta }{1- \sum_{j=1}^p \hat\gamma_j} \]
<- list()
lre
for (i in 1:9) {
<- coef(models[[i]])["dem"]
beta_hat <- coef(models[[i]])[6:9]
gamma_hat
<- beta_hat / (1 - sum(gamma_hat))
lre[[i]]
}
<- unlist(lre)
lre <- round(lre, 2) lre
Persistence
Calculate the persistence for the different models with this Formula:
\[ D_{pers} = \sum_{j=1}^p \hat\gamma_j \]
<- list()
persistence
for (i in 1:9) {
<- coef(models[[i]])[6:9]
gamma_hat
<- sum(gamma_hat)
persistence[[i]]
}
<- unlist(persistence)
pers <- round(pers, 2) pers
Creating the Table
<- list(model1, model2, model3, model4, model5, model6, model7, model8, model9)
models
::stargazer(
stargazer
models,type = "html",
covariate.labels = c("Democracy"),
title = "Effects of Democracy on Potential Channels",
dep.var.labels = c(
"Log Investment", "Log TFP", "Index Economic Reforms",
"Log Trade Share", "Log of Gov. Exp.","Log Primary Enrollment",
"Log Secondary Enrollment", "Log Child Mortality", "Dummy Unrest"
), omit.stat = c("f", "ser", "rsq", "adj.rsq"),
keep = "dem",
keep.stat = "N",
add.lines = list(
c("Long Run Effect", lre),
c("Persistence", pers)
) )
Dependent variable: | |||||||||
Log Investment | Log TFP | Index Economic Reforms | Log Trade Share | Log of Gov. Exp. | Log Primary Enrollment | Log Secondary Enrollment | Log Child Mortality | Dummy Unrest | |
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | |
Democracy | 2.391*** | -0.205 | 0.687** | 0.689 | 3.311*** | 1.042*** | 1.345*** | -0.253*** | -7.832*** |
(0.928) | (0.255) | (0.282) | (0.503) | (1.078) | (0.230) | (0.393) | (0.051) | (1.764) | |
Long Run Effect | 9.11 | -2.88 | 5.58 | 5.45 | 16.06 | 21.91 | 18.96 | -34.26 | -11.94 |
Persistence | 0.74 | 0.93 | 0.88 | 0.87 | 0.79 | 0.95 | 0.93 | 0.99 | 0.34 |
Observations | 5,665 | 3,879 | 4,692 | 5,738 | 4,511 | 3,714 | 2,883 | 6,084 | 5,646 |
Note: | p<0.1; p<0.05; p<0.01 |
Saving the Table as Tex
::stargazer(
stargazer
models,type = "latex",
out = "output/table_channels.tex",
covariate.labels = c("Democracy"),
column.sep.width = "0.01pt",
title = "Effects of Democracy on Potential Channels",
dep.var.labels = c(
"Log Investment", "Log TFP", "Index Economic Reforms",
"Log Trade Share", "Log of Gov. Exp.","Log Primary Enrollment",
"Log Secondary Enrollment", "Log Child Mortality", "Dummy Unrest"
), omit.stat = c("f", "ser", "rsq", "adj.rsq"),
keep = "dem",
keep.stat = "N",
add.lines = list(
c("Long Run Effect", lre),
c("Persistence", pers)
) )