-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_figures.Rmd
250 lines (213 loc) · 14.3 KB
/
make_figures.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
---
title: 'Figures for "NGOs and Authoritarianism"'
author:
- name: Andrew Heiss
affiliation: Brigham Young University
date: "Last run: `r format(Sys.time(), '%B %e, %Y')`"
output:
html_document:
highlight: pygments
theme: spacelab
code_folding: hide
---
```{r load-libraries, warning=FALSE, message=FALSE}
library(tidyverse)
library(readxl)
library(countrycode)
library(scales)
library(ggbeeswarm)
library(patchwork)
library(magrittr)
library(validate)
library(pander)
library(here)
```
# Load data from V-Dem
When loading the [V-Dem](https://www.v-dem.net/en/) CSV, `readr::read_csv()` chokes on a bunch of rows for whatever reason and gives a ton of warnings, but it still works. Loading the Stata version of V-Dem doesn't create the warnings, but it's slower and it results in the same data. So I just load from CSV and make sure it has the right number of rows and columns in the end.
```{r load-vdem, cache=TRUE, warning=FALSE, message=FALSE}
# V-Dem data
# Run this to load the cache in an interactive session
# lazyLoad(file.path(here(), "make_figures_cache", "html", "load-vdem_891e6bac420054832bed978ca9e5f927"))
vdem_raw <- read_csv(file.path(here(), "data", "Country_Year_V-Dem_Extended_CSV_v8",
"V-Dem-CY+Others-v8.csv"))
```
```{r check-vdem, results="asis", message=FALSE, warning=FALSE}
# Check that the data loaded correctly
vdem_raw %>%
check_that(n_rows = nrow(.) == 26537, n_cols = ncol(.) == 4641) %>%
summary() %>%
mutate(expression = expression %>% map_chr(pandoc.verbatim.return)) %>%
pandoc.table()
```
```{r clean-data}
vdem_small <- vdem_raw %>%
select(country_name, year, ccode = COWcode, v2x_regime,
# Executive and legislative elections, parties, and CSOs
v2xex_elecreg, v2xlg_elecreg, v2psbars_ord, v2csprtcpt_ord,
# Civil society repression
v2csreprss_ord, v2csreprss, v2csreprss_mean, v2csreprss_osp) %>%
group_by(ccode) %>%
mutate(election_on_track = v2xex_elecreg == 1 | v2xlg_elecreg == 1) %>%
mutate(multiple_parties_allowed = v2psbars_ord >= 2) %>%
mutate(cso_participation = v2csprtcpt_ord >= 2) %>%
# Autocracy = closed autocracies and electoral autocracies with V-Dem's RoW index
mutate(autocracy = v2x_regime <= 1)
```
# Democratic-ish institutions in authoritarian regimes
Figure 3 in @Kendall-TaylorFrantz:2014a shows the proportion of autocracies that have at least one party, that have multiple parties and a competitive legislature, and that have held an election in the last six years. The trends in these proportions over time show that autocracies have increasingly adopted democratic-ish institutions as a tool of regime survival. They combine data from [NELDA](https://nelda.co/), the [Autocratic Regime Data](http://sites.psu.edu/dictators/), and [Democracy and Dictatorship Revisited](https://sites.google.com/site/joseantoniocheibub/datasets/democracy-and-dictatorship-revisited) to generate their plot. These datasets are older, though, and better and more robust data sources now exist, like the [Varieties of Democracies (V-Dem) project.](https://www.v-dem.net/en/).
I use data from V-Dem to create a similar plot of autocratic adoption of democratic-ish institutions. I show three measures:
1. **Regularly scheduled elections on course**: In the original figure, Kendall-Taylor and Frantz looked at whether elections had occurred in the last 6 years, which doesn't always capture slower moving democracies or unexpected interruptions. To improve this, I use V-Dem's "Executive electoral regime index" (`v2xex_elecreg`) and "Legislative electoral regime index" (`v2xlg_elecreg`) to measure whether elections are supposed to happen and are on track to happen. This variable is true if either the executive or the legislative elections are on track (1).
2. **Multiple parties allowed**: I use V-Dem's "Barriers to parties" (`v2psbars_ord`) to create a dichotomous variable indicating whether parties are allowed. The variable is false if parties are explicitly banned (0) or if it is virtually impossible to form them (1).
3. **Civil society organizations allowed**: I use V-Dem's "CSO participatory environment" (`v2csprtcpt_ord`) to create a dichotomous variable indicating whether citizens are allowed to associate in civil society organizations and NGOs. The variable is false if most associations are state-sponsored (0) or if voluntary CSOs exist but are rarely used (1).
Rather than use Polity IV, Unified Democracy Scores, or Geddes, Wright, and Frantz's dictator data to categorize regimes as either democracies or autocracies, I use V-Dem's "Regimes of the world (RoW)" (`v2x_regime`) measure, which categorizes regimes based on a host of V-Dem's more robust democracy measures. I consider all closed autocracies (0) and electoral autocracies (1) to be autocracies.
```{r plot-institutions, warning=FALSE, fig.height=5, fig.width=7, fig.align="center"}
vdem_dictators_yearly <- vdem_small %>%
filter(autocracy) %>%
group_by(year) %>%
summarize(`Regularly scheduled elections on course` = sum(election_on_track, na.rm = TRUE) / n(),
`Multiple parties allowed` = sum(multiple_parties_allowed, na.rm = TRUE) / n(),
`Civil society organizations allowed` = sum(cso_participation, na.rm = TRUE) / n()) %>%
ungroup()
plot_dictator_institutions <- vdem_dictators_yearly %>%
gather(institution, pct, -year) %>%
filter(year >= 1970, year < 2016) %>%
mutate(institution = fct_inorder(institution, ordered = TRUE))
fig_dictator_institutions <- ggplot(plot_dictator_institutions,
aes(x = year, y = pct,
color = institution, size = institution)) +
geom_line() +
labs(x = NULL, y = "Percentage of autocracies") +
scale_y_continuous(labels = percent, expand = c(0, 0)) +
scale_color_manual(values = c("grey30", "grey70", "black"), name = NULL) +
scale_size_manual(values = c(0.5, 0.5, 1.5), name = NULL) +
coord_cartesian(ylim = c(0, 1)) +
guides(color = guide_legend(nrow = 2, byrow = TRUE)) +
theme_light(base_size = 9, base_family = "Asap Condensed") +
theme(axis.ticks = element_blank(),
legend.position = "bottom",
legend.margin = margin(-4, 0, 0, 0),
legend.key.size = unit(0.7, "lines"))
fig_dictator_institutions %T>%
print() %T>%
ggsave(., filename = file.path(here(), "output", "fig_dictator_institutions.pdf"),
width = 4.5, height = 3, units = "in", device = cairo_pdf) %>%
ggsave(., filename = file.path(here(), "output", "fig_dictator_institutions.png"),
width = 4.5, height = 3, units = "in", type = "cairo", dpi = 300)
```
# Civil society regulation and repression
Restrictions on NGOs have increased globally since the 1990s, but in different ways: both autocracies are democracies require NGO registration to some extent, while that registration process has become increasingly burdensome in autocracies in particular.
Here, [I use data](https://darinchristensen.com/replication/JoD_Replication.zip) from @ChristensenWeinstein:2013 to count how many NGO regulations countries have enacted since 1990. They include a host of possible regulations in their original dataset; I only look at whether NGOs are required to register (`q_2a`) and if that registration process is burdensome (`q_2b`).
I categorize regime type based on V-Dem's "Regimes of the world (RoW)" (`v2x_regime`) measure. I consider all closed autocracies (0) and electoral autocracies (1) to be autocracies. To keep countries consistently categorized over time, I create a variable called "Generally autocracy" (`generally_autocracy`) that is true if the country is marked as an autocracy in at least 50% of the years between 1990 and 2013. Thus, if a country democratizes for only a few years, it is still counted as an autocracy, and vice versa—if a country backslides to an electoral autocracy for a couple years, it is still considered a democracy.
```{r ngo-registration-regulations, fig.height=4, fig.width=7, fig.align="center"}
# Create measure of whether a country is generally an autocracy between 1990-2013
generally_autocracies <- vdem_small %>%
filter(year > 1990, year <= 2013) %>%
group_by(ccode) %>%
summarize(prop_autocracy = sum(autocracy, na.rm = TRUE) / n(),
generally_autocracy = prop_autocracy >= 0.5)
# Read and clean Christensen and Weinstein data
dcjw_raw <- read_excel(file.path(here(), "data", "DCJW NGO Laws", "DCJW_NGO_Laws.xlsx")) %>%
select(-c(contains("source"), contains("burden"), contains("subset"), Coder, Date)) %>%
gather(key, value, -Country) %>%
separate(key, c("question", "var_name"), 4) %>%
filter(!is.na(Country)) %>%
mutate(var_name = ifelse(var_name == "", "value", gsub("_", "", var_name))) %>%
spread(var_name, value)
# Just look at registration laws
dcjw_registration <- dcjw_raw %>%
mutate(question = recode(question, q_2a = "registration", q_2b = "burdensome")) %>%
filter(question %in% c("registration", "burdensome"))
# Make a panel of registration laws and fill legislation presence in missing years
dcjw_registration_panel <- dcjw_registration %>%
expand(Country, question, year = min(.$year, na.rm = TRUE):2013) %>%
left_join(dcjw_registration, by = c("Country", "question", "year")) %>%
# Bring most recent legislation forward
group_by(Country) %>%
mutate(value = zoo::na.locf(value, na.rm = FALSE)) %>%
ungroup() %>%
mutate(value = ifelse(is.na(value), 0, value)) %>%
mutate(ccode = countrycode(Country, "country.name", "cown",
custom_match = c("Serbia" = 345L))) %>%
left_join(generally_autocracies, by = "ccode")
# Calculate proportion of autocracies and democracies with NGO registration laws by year
dcjw_registration_yearly <- dcjw_registration_panel %>%
filter(year > 1990, !is.na(generally_autocracy)) %>%
group_by(year, question, generally_autocracy) %>%
summarize(prop_with_regulation = sum(value) / n()) %>%
ungroup() %>%
mutate(generally_autocracy = factor(generally_autocracy, levels = c(FALSE, TRUE),
labels = c("Democracies", "Autocracies"), ordered = TRUE),
question = factor(question, levels = c("registration", "burdensome"),
labels = c("NGO registration required", "NGO registration burdensome"),
ordered = TRUE))
fig_ngo_regulations <- ggplot(dcjw_registration_yearly,
aes(x = year, y = prop_with_regulation,
color = generally_autocracy)) +
geom_line(aes(group = generally_autocracy), size = 1) +
labs(x = NULL, y = "Proportion of countries\nwith regulations") +
scale_y_continuous(labels = percent, expand = c(0, 0)) +
coord_cartesian(ylim = c(0, 1), xlim = c(1990, 2015)) +
scale_color_manual(values = c("grey70", "grey30"), name = NULL,
guide = guide_legend(reverse = TRUE)) +
facet_wrap(~ question) +
theme_light(base_size = 9, base_family = "Asap Condensed") +
theme(axis.ticks = element_blank(),
panel.grid.minor.x = element_blank(),
strip.text = element_text(size = rel(0.9), color = "black"),
strip.background = element_blank(),
legend.position = "bottom",
legend.margin = margin(-4, 0, 0, 0),
legend.key.size = unit(0.7, "lines"))
fig_ngo_regulations
```
Laws on the books don't always reflect lived reality—anti-NGO laws are often applied unevenly and targeted at specific civil society organizations. V-Dem provides a useful measure of civil society repression ("CSO repression" or `v2csreprss_*`) to capture the extent to which governments restrict civil society organizations. This is measured on a 0–4 scale, with 4 representing the most democratic and open civil society (i.e. no repression) and 0 representing the most restricted civil society (i.e. complete repression and liquidation of civil society). I take the mean of V-Dem's Bayesian measurement model (`v2csreprss_mean`) for each country and average it by year and general autocraticness, as before. The 95% confidence intervals for the mean are shaded.
```{r cso-repression, fig.height=4, fig.width=7, fig.align="center"}
avg_cso_repression <- vdem_small %>%
filter(year > 1990, year < 2016) %>%
left_join(generally_autocracies, by = "ccode") %>%
group_by(generally_autocracy, ccode) %>%
summarize(repression_avg = mean(v2csreprss_ord, na.rm = TRUE)) %>%
ungroup() %>%
mutate(generally_autocracy = factor(generally_autocracy, levels = c(FALSE, TRUE),
labels = c("Democracies", "Autocracies"), ordered = TRUE))
repression_labels <- tribble(
~x, ~y, ~text,
1.5, 4, "No repression",
1.5, 3, "Weak repression",
1.5, 2, "Moderate repression",
1.5, 1, "Substantial repression",
1.5, 0, "Severe repression"
)
set.seed(12345)
fig_cso_repression <- ggplot(avg_cso_repression,
aes(x = fct_rev(generally_autocracy), y = repression_avg,
color = generally_autocracy)) +
geom_quasirandom(size = 0.5, varwidth = TRUE) +
geom_label(data = repression_labels, aes(x = x, y = y, label = text),
inherit.aes = FALSE, hjust = "center", nudge_x = 0,
size = 1.5, color = "grey50", family = "Asap Condensed",
label.padding = unit(0.1, "lines")) +
labs(x = NULL, y = "Mean civil society openness") +
scale_color_manual(values = c("grey70", "grey30"), name = NULL,
guide = FALSE) +
theme_light(base_size = 9, base_family = "Asap Condensed") +
theme(axis.ticks = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank())
fig_cso_repression
```
Combined plot for the chapter:
```{r ngo-registration-repression-both, fig.height=4, fig.width=9, fig.align="center"}
blank <- plot_spacer() + theme_void()
fig_combined <- (fig_ngo_regulations + labs(tag = "A")) +
blank +
(fig_cso_repression + labs(tag = "B")) +
plot_layout(widths = c(0.65, 0.02, 0.33))
fig_combined %T>%
print() %T>%
ggsave(., filename = file.path(here(), "output", "fig_repression_regulation.pdf"),
width = 7.5, height = 3, units = "in", device = cairo_pdf) %>%
ggsave(., filename = file.path(here(), "output", "fig_repression_regulation.png"),
width = 7.5, height = 3, units = "in", type = "cairo", dpi = 300)
```