Introduction

This vignette shows how to replicate and extend the charts in chapter 1 of my book Non-democratic Politics: Authoritarianism, Dictatorships, and Democratization (Palgrave Macmillan, 2016). It assumes that you have downloaded and installed the replication package as follows:

if(!require(devtools)) {
  install.packages("devtools")
}

devtools::install_github('xmarquez/AuthoritarianismBook')

It also assumes you have the dplyr, ggplot2, lubridate, purrr, tidyr, and plotly (for interactive graphing - not needed for the static figures) packages installed:

if(!require(dplyr)) {
  install.packages("dplyr")
}

if(!require(ggplot2)) {
  install.packages("ggplot2")
}

if(!require(lubridate)) {
  install.packages("lubridate")
}

if(!require(purrr)) {
  install.packages("purrr")
}

if(!require(ggrepel)) {
  install.packages("ggrepel")
}

if(!require(plotly)) {
  install.packages("plotly")
}

if(!require(tidyr)) {
  install.packages("tidyr")
}

Figure 1.1: Sample Trajectories through Regime Space

Original figure

This figure plots the “regime trajectories” of three countries through a two-dimensional space defined by a “control over society” axis (the x axis, ranging from the “maximal pluralism” of a democratic regime) and a “personal power” axis (the y axis, ranging from minimal personal power - maximal institutional control - to maximal personal power).

The measure of “social control” is the the “core civil society index” (v2xcs_ccsi) from the V-Dem dataset, version 6.1 (Coppedge Michael, John Gerring, Staffan I. Lindberg, Svend-Erik Skaaning, Jan Teorell, et al. 2016a). This is a measure of “how robust is civil society,” described as follows by the V-Dem codebook:

The core civil society index (CCSI) is designed to provide a measure of a robust civil society, understood as one that enjoys autonomy from the state and in which citizens freely and actively pursue their political and civic goals, however conceived. (Coppedge Michael, John Gerring, Staffan I. Lindberg, Svend-Erik Skaaning, Jan Teorell, et al. 2016b, 61)

The codebook also notes that “the index is formed by taking the point estimates from a Bayesian factor analysis model of the indicators for CSO [civil society organization] entry and exit (v2cseeorgs), CSO repression (v2csreprss) and CSO participatory environment (v2csprtcpt).” The index is described in more detail in a working paper by Bernhard et al. (2015). First thing to do is to load this dataset ans select the variable we need:

library(AuthoritarianismBook)
library(dplyr)
library(ggplot2)

civil_society <- vdem %>% 
  select(country_name, GWn, year, in_system, v2xcs_ccsi, v2xcs_ccsi_codelow, v2xcs_ccsi_codehigh) 

This index ranges from 0-1, where 0 means that civil society is maximally constrained and 1 means that civil society is minimally constrained. The index is available for 173 countries and 16430 country-years:

library(knitr)

civil_society %>%
  filter(!is.na(v2xcs_ccsi)) %>%
  summarise(num_countries = n_distinct(country_name),
            country_years = n(),
            mean_v2xcs_ccsi = mean(v2xcs_ccsi),
            max_v2xcs_ccsi = max(v2xcs_ccsi),
            min_v2xcs_ccsi = min(v2xcs_ccsi)) %>%
  kable(digits = 2,
        col.names = c("Number of countries","Country-years", "Mean", "Max", "Min"))
Number of countries Country-years Mean Max Min
173 16430 0.47 0.98 0.01

To use it in the figure, I first transform the index to a “normalized” scale using the normal quantile function. (The original index uses the normal distribution function to transform the results of the bayesian analysis into a 0-1 probability scale; applying the normal quantile function simply reverses this process).

civil_society <- civil_society %>%
  mutate(civil_society = qnorm(1 - v2xcs_ccsi),
         civil_society_high = qnorm(1 - v2xcs_ccsi_codelow), 
         civil_society_low = qnorm(1 - v2xcs_ccsi_codehigh))

Now the index has mean around 0 and standard deviation 1, and higher values correspond to more control over civil society instead of less:

civil_society %>%
  filter(!is.na(v2xcs_ccsi)) %>%
  summarise(num_countries = n_distinct(country_name),
            country_years = n(),
            mean_civil_society = mean(civil_society),
            sd_civil_society = sd(civil_society)) %>%
  kable(digits = 2,
        col.names = c("Countries","Country-years", "Mean", "SD"))
Countries Country-years Mean SD
173 16430 0.08 1.03

The measure of personal power comes from a latent variable analysis of several sources: the V-dem indexes of legislative and judicial constraints on the executive and of executive corruption; Polity IV’s measure of executive constraints (Marshall, Gurr, and Jaggers 2010); Geddes, Wright, and Frantz’s 2014 indicator of personalism (Geddes, Wright, and Frantz 2014); Kailitz 2013’s indicator of personalism (Kailitz 2013); Magaloni, Chu, and Min 2013’s experimental measure of personalism (Magaloni, Chu, and Min 2013); and Wahman, Teorell, and Hadenius 2013’s measure of mean executive turnover in non-democratic regimes (Wahman, Teorell, and Hadenius 2013). The construction of this index is described in detail in the vignette “An Index of Personal Power” The index value is in a normalized scale with mean around 0 and standard deviation of around 1, with larger values indicating less personal power:

personal_scores %>%
  filter(!is.na(z1)) %>%
  summarise(num_countries = n_distinct(country_name),
            country_years = n(),
            mean_personal_power = mean(z1),
            sd_personal_power = sd(z1),
            max_personal_power = max(z1),
            min_personal_power = min(z1)) %>%
  kable(digits = 2,
        col.names = c("Countries","Country-years", "Mean", "SD", "Max", "Min"))
Countries Country-years Mean SD Max Min
215 22597 0 0.89 2.51 -2.46

This measure of personal power is explored in more detail in the vignette for chapter 4. Note that this index is only a very approximate measure of personal power - there are some problems with the original measures of personalism used to construct it - but it’s good enough to illustrate some trajectories through regime space.

To create the figure we first invert the polarity of the personal power index (so that larger values indicate more personal power) and then join both datasets:

personal_scores <- personal_scores %>%
  mutate(personal_power  = -z1, 
         personal_power_high = -pct025, 
         personal_power_low = -pct975) 


data <- inner_join(civil_society, personal_scores)
## Joining, by = c("country_name", "GWn", "year", "in_system")

We can now plot the figure for New Zealand, Russia (Soviet Union), and Venezuela:

countries <- c("New Zealand","Venezuela","Russia (Soviet Union)")

fig1.1 <- ggplot(data = data %>%
                   filter(country_name %in% countries,
                          in_system), 
                 aes(x=civil_society,y = personal_power)) + 
  geom_rect(inherit.aes=FALSE,                                      # Plots the grey   
            xmin = 2,                                               # areas that say
            xmax= 3,                                                # "Totalitarian zone" 
            ymin = min(data$personal_power, na.rm = TRUE),          # and "Authoritarian zone"
            ymax = max(data$personal_power, na.rm = TRUE), 
            fill = "lightgrey") +
  geom_rect(inherit.aes=FALSE, 
            xmin = -1, 
            xmax= -2, 
            ymin = min(data$personal_power, na.rm = TRUE), 
            ymax = max(data$personal_power, na.rm = TRUE),  
            fill = "lightgrey") +
  geom_path() +                                                     # Connects points
  geom_count(alpha = 0.3, show.legend=FALSE) +
  geom_text(data = data %>%                                         # Adds labels at 
              filter(country_name %in% countries,                   # 10-year intervals
                     (year %% 10) == 0),
            aes(label = year), 
            check_overlap = TRUE) +
  facet_wrap(~country_name, ncol=1) +
  theme_bw() +
  geom_vline(xintercept = 0.5, linetype = 2) +
  annotate("text", x = 2.5, y = 0, label = "Totalitarian zone", angle = 90) +
  annotate("text", x = -1.5, y = 0, label = "Democratic zone", angle = 90) +
  annotate("text", x = -0.3, y = -1, label = "Competitive\nauthoritarian\nzone") +
  annotate("text", x = 1.3, y = -1, label = "Authoritarian\nzone") +
  labs(y = "Personal power", x = "Regime control over civil society") 

fig1.1

To add leader names, we need to use the leader data from Archigos, which we put in country-year format:

library(lubridate)
library(purrr)
library(tidyr)

leader_data <- archigos %>%
  group_by(country_name, GWn, leader, startdate, enddate) %>%
  mutate(year = map2(startdate, enddate, ~ year(.x):year(.y))) %>%
  unnest() %>%
  arrange(country_name, year, enddate) %>%
  ungroup()

data <- inner_join(leader_data, data) %>%
  arrange(country_name, year)
## Joining, by = c("country_name", "GWn", "year")
# This is a helper function for finding local peaks in personal power:

findpeaks <- function(vec,bw=1,x.coo=c(1:length(vec)))
{
  pos.x.max <- NULL
  pos.y.max <- NULL
  pos.x.min <- NULL
  pos.y.min <- NULL   
  for(i in 1:(length(vec)-1))   {     if((i+1+bw)>length(vec)){
                sup.stop <- length(vec)}else{sup.stop <- i+1+bw
                }
    if((i-bw)<1){inf.stop <- 1}else{inf.stop <- i-bw}
    subset.sup <- vec[(i+1):sup.stop]
    subset.inf <- vec[inf.stop:(i-1)]

    is.max   <- sum(subset.inf > vec[i]) == 0
    is.nomin <- sum(subset.sup > vec[i]) == 0

    no.max   <- sum(subset.inf > vec[i]) == length(subset.inf)
    no.nomin <- sum(subset.sup > vec[i]) == length(subset.sup)

    if(is.max & is.nomin){
      pos.x.max <- c(pos.x.max,x.coo[i])
      pos.y.max <- c(pos.y.max,vec[i])
    }
    if(no.max & no.nomin){
      pos.x.min <- c(pos.x.min,x.coo[i])
      pos.y.min <- c(pos.y.min,vec[i])
    }
  }
  return(pos.x.max)
}

Now we’re ready to add labels:

library(ggrepel)

label_data <- data %>%
  filter(!is.na(personal_power),
         country_name %in% countries) %>%
  group_by(country_name) %>%
  mutate(local_personal_max = (personal_power %in% personal_power[findpeaks(personal_power, bw = 20)]),
         local_personal_max = ifelse(country_name == "New Zealand",FALSE,local_personal_max)) %>% 
  filter(local_personal_max) %>% 
  distinct(leader, personal_power, local_personal_max, .keep_all = TRUE)

fig1.1 +
  geom_text_repel(data = label_data,
                  aes(x = civil_society,
                      y = personal_power,
                      label=paste(leader,year)),
                  inherit.aes = FALSE) +
  geom_hline(yintercept = 0, color = "red")

Interactive version

It is simple to create an interactive version of this graph:

data <- data %>%
  mutate(name = paste(leader, year))

countries <- "Venezuela"

fig1.1 <- ggplot(data = data %>%
                   filter(country_name %in% countries,
                          in_system), 
                 aes(text = name,
                     x = civil_society,
                     y = personal_power)) + 
  geom_rect(inherit.aes=FALSE,                                      # Plots the grey   
            xmin = 2,                                               # areas that say
            xmax= 3,                                                # "Totalitarian zone" 
            ymin = min(data$personal_power, na.rm = TRUE),          # and "Authoritarian zone"
            ymax = max(data$personal_power, na.rm = TRUE), 
            fill = "lightgrey") +
  geom_rect(inherit.aes=FALSE, 
            xmin = -1, 
            xmax= -2, 
            ymin = min(data$personal_power, na.rm = TRUE), 
            ymax = max(data$personal_power, na.rm = TRUE),  
            fill = "lightgrey") +
  geom_point(alpha = 0.3, show.legend=FALSE) +
  facet_wrap(~country_name, ncol=1) +
  theme_bw() +
  geom_vline(xintercept = 0.5, linetype = 2) +
  annotate("text", x = 2.5, y = 0, label = "Totalitarian zone", angle = 90) +
  annotate("text", x = -1.5, y = 0, label = "Democratic zone", angle = 90) +
  annotate("text", x = -0.3, y = -1, label = "Competitive\nauthoritarian\nzone") +
  annotate("text", x = 1.3, y = -1, label = "Authoritarian\nzone") +
  labs(y = "Personal power", x = "Regime control over civil society") 

library(plotly)
ggplotly(fig1.1)

Figure 1.2: Personal Power and Social Control in Russia over Time

Original figure

This figure presents the scores for personal power and social control for Russia, using the same data as the previous figure.

if(!require(reshape2)) {
  install.packages("reshape2")
}

library(reshape2)

data <- inner_join(civil_society, personal_scores) %>% 
  inner_join(leader_data) %>%
  mutate(is_start_leader_year = (year == year(startdate))) %>%
  melt(measure.vars = c("personal_power","civil_society")) %>%
  mutate(variable = plyr::mapvalues(variable, 
                                    from = c("personal_power","civil_society"), 
                                    to = c("Personal power","Control over civil society"))) %>%
  filter(country_name == "Russia (Soviet Union)", in_system) %>%
  mutate(high = ifelse(variable == "Personal power", personal_power_high, civil_society_high),
         low = ifelse(variable == "Personal power", personal_power_low, civil_society_low)) 
## Joining, by = c("country_name", "GWn", "year", "in_system")
## Joining, by = c("country_name", "GWn", "year")
axis_labels <- data_frame(breaks = c(data$year[data$is_start_leader_year], 1933, 1937, 1945),
                          labels = c(paste(data$year[data$is_start_leader_year],
                                    data$leader[data$is_start_leader_year]), 
                                "1933: Stalin consolidates power", 
                                '1937: Peak of "Great Terror"', 
                                "1945: End of WWII")) %>%
  distinct() %>%
  group_by(breaks) %>%
  summarise(labels = paste(labels, collapse = "\n"))
  

ggplot(data = data, aes(x=year, y = value,
                        ymax = high,
                        ymin = low,
                        linetype = variable, 
                        color = variable,
                        fill = variable)) +
  geom_path() +
  geom_ribbon(alpha = 0.2) +
  facet_wrap(~country_name, ncol=2) +
  theme_bw() +
  scale_x_continuous(breaks = axis_labels$breaks,
                     labels = axis_labels$labels) +
  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) +
  geom_vline(data = data %>%
               filter(is_start_leader_year, variable == "Personal power") %>%
               distinct(leader,value, is_start_leader_year, .keep_all = TRUE),
             aes(xintercept = year)) +
  geom_hline(yintercept = 0, color = "red") +
  labs(y = "Degree of personal power or social control 
       (in standard deviations from mean, 
       0 is the mean in sample)", x = "Year") +
  theme(legend.position = "bottom") +
  guides(linetype = guide_legend(title = ""),
         color = guide_legend(title = ""),
         fill = guide_legend(title = ""))

Extension: Plotting personal power and social control for other countries

It is a simple matter to graph social control and personal power in other countries. Here’s Venezuela:

data <- inner_join(civil_society, personal_scores) %>% 
  inner_join(leader_data) %>%
  mutate(is_start_leader_year = (year == year(startdate))) %>%
  melt(measure.vars = c("personal_power","civil_society")) %>%
  mutate(variable = plyr::mapvalues(variable, 
                                    from = c("personal_power","civil_society"), 
                                    to = c("Personal power","Control over civil society"))) %>%
  filter(in_system) %>%
  mutate(high = ifelse(variable == "Personal power", personal_power_high, civil_society_high),
         low = ifelse(variable == "Personal power", personal_power_low, civil_society_low)) 
## Joining, by = c("country_name", "GWn", "year", "in_system")
## Joining, by = c("country_name", "GWn", "year")
graph_1_2 <- function(country, dat = data, extra_breaks = NULL, extra_labels = NULL) {
  dat <- dat %>%
    filter(country_name == country)
  
  axis_labels <- data_frame(breaks = c(dat$year[dat$is_start_leader_year], extra_breaks),
                          labels = c(paste(dat$year[dat$is_start_leader_year],
                                    dat$leader[dat$is_start_leader_year]), extra_labels)) %>%
  distinct() %>%
  group_by(breaks) %>%
  summarise(labels = paste(labels, collapse = "\n"))
  
  
  fig <- ggplot(data = dat, aes(x=year, y = value,
                          ymax = high,
                          ymin = low,
                          linetype = variable, 
                          color = variable,
                          fill = variable)) +
    geom_path() +
    geom_ribbon(alpha = 0.2) +
    facet_wrap(~country_name, ncol=2) +
    theme_bw() +
    scale_x_continuous(breaks = axis_labels$breaks,
                       labels = axis_labels$labels) +
    theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) +
    geom_vline(data = dat %>%
                 filter(is_start_leader_year, variable == "Personal power") %>%
                 distinct(leader,value, is_start_leader_year, .keep_all = TRUE),
               aes(xintercept = year)) +
    geom_hline(yintercept = 0, color = "red") +
    labs(y = "Degree of personal power or social control
         (in standard deviations from mean, 
         0 is the mean in sample)", x = "Year") +
    theme(legend.position = "bottom") +
    guides(linetype = guide_legend(title = ""),
           color = guide_legend(title = ""),
           fill = guide_legend(title = ""))
  
  print(fig)
}

graph_1_2("Venezuela")

And here’s China, which shows both an increase in Mao’s personal power during the cultural revolution, and a slight decrease ins ocial control by the state, as lots of groups formed that were not under the full control of the state:

graph_1_2("China", extra_breaks = c(1966, 1976), 
          extra_labels = c("1966: Beginning of the Cultural Revolution",
                           "1976: End of the Cultural Revolution"))

Chile is also unsurprising, with Pinochet’s personal power increasing shortly after the 1973 coup along with social control, but both of them decreasing towards the end of his rule:

graph_1_2("Chile")

In Spain, Franco’s personal power does not slacken until the end of his rule, but social control declines around the middle of his reign:

graph_1_2("Spain")

Extension: Correlations between social control and personal power

As we can see from these examples, personal power and social control are highly but not perfectly correlated. They are also highly but not perfectly correlated with various measures of democracy.

data <- full_join(civil_society %>% select(country_name, GWn, year, civil_society), 
                  personal_scores %>% select(country_name, GWn, year, personal_power)) %>%
  full_join(vdem %>% select(country_name, GWn, year, 
                            v2x_polyarchy, v2x_api, v2x_mpi, 
                            v2x_libdem, v2x_partipdem, 
                            v2x_delibdem, v2x_egaldem)) %>%
  full_join(extended_uds %>% select(country_name, GWn, year, index)) %>%
  rename(extended_uds = index)
## Joining, by = c("country_name", "GWn", "year")
## Joining, by = c("country_name", "GWn", "year")
## Joining, by = c("country_name", "GWn", "year")
if(!require(GGally)) {
  install.packages("GGally")
}

library(GGally)

ggcorr(data = data %>% select(-country_name, -year, -GWn), label=TRUE,label_round=2) + 
  scale_fill_gradient2()
## Scale for 'fill' is already present. Adding another scale for 'fill',
## which will replace the existing scale.

Distribution of regimes

Regimes do cluster in particular regions:

data <- full_join(civil_society,personal_scores) %>%
  left_join(kailitz_yearly) %>%
  mutate(name = paste(country_name, year))
## Joining, by = c("country_name", "GWn", "year", "in_system")
## Joining, by = c("country_name", "GWn", "year", "in_system")
ggplot(data = data, aes(text = name,
                        x = civil_society,
                        y = personal_power, 
                        color = communist)) +
  geom_point(position="jitter") +
  theme_bw() + 
  geom_hline(yintercept = 0, color = "red") +
  geom_vline(xintercept = 0, color = "red") +
  annotate("text", x = -2, y = -2, label = "Institutionalized\ndemocracy") +
  annotate("text", x = -1, y = 1, label = "Personal competitive authoritarian") +
  annotate("text", x = 2, y = 2, label = "Personal Totalitarian") +
  annotate("text", x = 1, y = 0, label = "Institutionalized authoritarian") +
  xlim(c(-2.5,2.5)) +
  labs(x = "Control over civil society",
       y = "Personal power")
## Warning: Removed 6368 rows containing missing values (geom_point).

An interactive graph is very easy to create:

ggplotly()

References

Bernhard, Michael, Eitan Tzelgov, Dong-Joon Jung, Michael Coppedge, and Staffan I. Lindberg. 2015. “The Varieties of Democracy Core Civil Society Index.” 13. V-Dem Institute.

Coppedge, Michael, John Gerring, Staffan I. Lindberg, Svend-Erik Skaaning, Jan Teorell, David Altman, Michael Bernhard, et al. 2016a. “V-Dem [Country-Year/Country-Date] Dataset, Version 6.1.” Dataset. Varieties of Democracy (V-Dem) Project. https://www.v-dem.net/en/data/data-version-6-1/.

Coppedge, Michael, John Gerring, Staffan I. Lindberg, Svend-Erik Skaaning, Jan Teorell with David Altman, Michael Bernhard, M. Steven Fish, et al. 2016b. “V-Dem Codebook V6.” Varieties of Democracy (V-Dem) Project.

Geddes, Barbara, Joseph Wright, and Erica Frantz. 2014. “Autocratic Breakdown and Regime Transitions: A New Data Set.” Perspectives on Politics 12 (1): 313–31. doi:10.1017/S1537592714000851.

Kailitz, Steffen. 2013. “Classifying Political Regimes Revisited: Legitimation and Durability.” Democratization 20 (1): 39–60. doi:10.1080/13510347.2013.738861.

Magaloni, Beatriz, Jonathan Chu, and Eric Min. 2013. “Autocracies of the World, 1950-2012 (Version 1.0).” Dataset. http://cddrl.fsi.stanford.edu/research/autocracies_of_the_world_dataset.

Marshall, Monty G., Ted Robert Gurr, and Keith Jaggers. 2010. “Polity IV Project: Political Regime Characteristics and Transitions, 1800-2009.” Data set. Center for Systemic Peace. http://www.systemicpeace.org/inscr/inscr.htm.

Wahman, Michael, Jan Teorell, and Axel Hadenius. 2013. “Authoritarian Regime Types Revisited: Updated Data in Comparative Perspective.” Contemporary Politics 19 (1): 19–34. https://sites.google.com/site/authoritarianregimedataset/data.