Good coup, bad coup

This post first appeared at Predictive Heuristics.

Alexander Noyes and Sebastian Elischer wrote about good coups on Monkey Cage a few weeks ago, in the shadow of fallout from the LaCour revelations. Good coups namely are those that lead to democratization, rather than outcomes one might more commonly associate with coups, like military rule, dictatorship, or instability. Elischer, although on the whole less optimistic about good coups than Noyes, writes:

There is some good news for those who want to believe in “good coups.” A number of military interventions in Africa have led to competitive multiparty elections, creating a necessary condition for successful democratization. These cases include the often (perhaps too often)-cited Malian coup of 1991, the Lesotho coup of 1991, the Nigerien coups of 1999 and 2000, the Guinean coup of 2008, the Malian coup of 2012 and potentially Burkina Faso’s 2014 coup, among others.

Here is a quick look at the larger picture. I took the same Powell and Thyne data on coups that is referenced in the blog posts and added the Polity data on regimes to it.1 Specifically, I added the Polity score 7 days before a coup, and 1 and 2 years afterwards, although I’ll focus on the changes 2 years later. The Polity score measures, on a scale from -10 to 10, how autocratic or democratic a regime is. The scale is in turn based on a larger number of items coded by the Polity project. It’s not quite an ordinal or interval scale, in part because there are a couple of special codes for regimes that are in transition or where a country is occupied or without a national government (failed state). Rather than exclude these special scores or convert them to Polity scores, I grouped the Polity scores into several broader categories from autocracy to full democracy, and kept the special codes under the label “unstable”, which may or may not be a good description for them.

The overwhelming pattern for all 227 successful coups that the data cover is that things stay the same (0.41 of cases) or get worse (0.40 of cases). The plot below shows the number of times specific category-to-category switches took place, with the regime 7 days before a successful coup on the y-axis, and the regime 2 years later on the x-axis. It’s really just a slightly more fancy version of a transition matrix.2


In 41, or 18 percent of cases, the regime was more democratic 2 years later. There are probably a few more that were still coded as being in transition to a more democratic regime, so the 18 percent is for unambiguously more democratic regimes.

Below is another way of visualizing the same data. I don’t know what this type of plot is called, but in any case the Gmisc R package implements a version of it:


It’s maybe clearer with this plot that of the transitions that do occur, the modal change is to autocracy. The number of autocracies 2 years post-coup is clearly larger than before, at the expense of less autocratic, more liberal regimes. There was one transition from democracy to full democracy–the thin line on the bottom right, which was for Cyprus in 1974 after a short-lived coup that led to Turkish invasion and eventually the fall of the Greek dictatorship and restoration of the previous president.

By the way, I’m trying to consciously steer away from language implying causation here. This is after all a descriptive look at polity before and 2 years after a coup, and I have not dug into any particular case histories nor tried to control for any confounding factors. Forgive the occasional slip, and I don’t mean to imply causality when I use words like “transition”.

So, when we consider the whole data, coups have historically more often than not reinforced autocratic tendencies. The picture actually looks much better if you look at post-1990 Sub-Saharan Africa only, as Elischer’s Monkey Cage post does:


More than a third of coups in post-1990 Sub-Saharan Africa are followed by regime liberalization. To be honest I was a bit surprised that the ratio of “good” to “bad” coups is that high. Here is a timeline of the specific cases. I changed the colors so that “same” is now red as well. The labels are easier to read if you click to open the larger version of the image.


Niger has had 3 coups since 1990: in 1996, 1999, and 2010. In the first, Polity decreased a year after the coup, but the other two resulted in improvements. This matches the narrative in Elischer’s post, as he gives the second two Nigerien coups as examples of good coups. A couple of other countries also appear twice in this list. I’m not sure whether repeated good coups are still a good thing, but on the other hand I’m not very familiar with the particular case histories, so maybe they really are.

Like with the transition plots before, extending the time period and spatial focus to all countries from 1950 on changes the picture a lot:


Most coups historically were “bad”, with more autocratic or unchanged regimes 2 years later. A few here and there seem to be associated with democratization, and while the number of bad coups has decreased over time from highs in the 60’s and 70’s, the good coups seem to continue with a steady trickle. Still, despite the occurrence of a substantial number of coups that are associated with democratization, the main pattern historically and still today is that successful coups more often than not associated with more of the same, or worse (autocratization3). The imbalance between positive and negative movements in regime is even more pronounced at shorter time scales, e.g. if you consider regime type 1 year after a coup, and the main immediate effect is probably instability and political deterioration.

Contrast this with Powell and Thyne,4 whose 2014 paper in Foreign Policy Analysis is one of the articles that started the mini-discussion on good coups. Powell and Thyne look at whether having had a coup or attempted but unsuccessful coup within the past 2 years is associated with democratization, which they operationalize as a shift in Polity score from less than 6 to 6 or higher. This is equivalent to a movement from any category below democracy to “Democracy” or “Full Democracy” in the categorization I have used here. They find that it does, and with further investigation show that the effect is even more pronounced in strongly autocratic regimes and those with a long-ruling leader.

How can coups increase the probability of democratization, while regimes tend to be similar or worse following a coup?

My empirically unevaluated hunch is that the trick is twofold: the data Powell and Thyne use consist only of autocracies (Polity < 6), and they only consider movement from not-democracy to democracy. To use a bad analogy, with this setup if a coup makes an autocracy more autocratic, nobody is there to hear it. In any case, I think that the explanation for the inconsistency is along these lines: coups perturb regimes, and sometimes these perturbations will be in the more democratic direction. So if you are only looking at whether countries cross a threshold from not democratic to democratic, you will find that coups will indeed sometimes push countries over the threshold.

Dan Carlin, in his podcasts on World War 1, has a great analogy about the quality of monarchs that came to mind here.5 He describes monarchical succession as a roll of the dice where sometimes you get great kings like Frederick II or Peter the Great, but other times you are stuck with the Wilhelm II or Nicholas II‘s of the regal world. Based on the cursory look I’ve described here, coups are then akin to rolling a loaded dice. Sometimes they can lead to regimes that are more liberal, and if not outright democratic at least less autocratic. But more often, they are associated with no change or change in the wrong direction, in addition to other short-term costs they carry.

So while good coups happen, there are also associated risks. You shouldn’t consider potential benefits without the potential costs involved. The next logical step would be to try to figure out whether there are any systematic conditions that can help predict whether a coup would lead to liberalization, no meaningful change, or more autocracy. Powell and Thyne have a little bit of this when it comes to the benefit (democratization) side, e.g. that democratizing coups are more likely in highly autocratic regimes with aging leaders, but the potential risks are not clear. It seems like being able to predict what change in regime type a coup would likely lead to is also something policymakers would be interest in when evaluating how to respond to a coup or the possibility of one.


Replication code and data.

  1. Jonathan Powell is doing a wonderful job, as far as I can tell, in keeping the data regularly updated. At least it has been updated every time I have looked on his website. 
  2. I would like to plot the transition matrix with a bivariate color scale so that it shows both whether a transition is to a more authoritarian/democratic regime, and also what the frequency of any given pair was. I.e. a cross between a qualitative and gradient scales, or specifically 3 separate gradient scales. But it seems that this is not possible with ggplot2. If there were only two categories I could cheat with a diverging scale, alas there are three. 
  3. If “democratization” is a word, it seems that “autocratization” should be as well. 
  4. Thank you for posting an ungated copy of the paper, along with replication materials. 
  5. Maybe he got it from somewhere else, I don’t know. 

A quick look at the public ICEWS data

The ICEWS data, including the underlying raw event data as well as some aggregations, were quietly posted on Dataverse the Friday before last. I’ve worked with the ICEWS data for several years now, first when I was working on on the ICEWS package–we deliver updated monthly forecasts for the ICEWS events of interest (EOIs) once a month–and more recently for the irregular leadership change forecasting project. The public data are formatted differently from the data I’ve worked with, so most of the code I have lying around is not that useful, but in going through the public data I did recreate a short overview that is nowhere near as complete as David Masad‘s first look (using Python), and some code that might be useful for getting started in R.

One of the nice things about the public release of these data, aside from the hope that they will start to get used in modeling (repost), is that it is very interesting to read new takes by people whose perspectives are different than mine, like, so far:

Now to the quick overview, using R rather than Python (link to code at end). The first figure below shows the daily event totals, as well as a 30-day moving average. The daily totals increase from around 500 in 1996 to a steady level of around 3,000 from 2005 on, before decreasing again around 2009/2010. As others have pointed out, this stability is a good feature to have since it makes it plausible to model without some kind of normalization to account for changes in the underlying event volume. This is in contrast to GDELT, where the story corpus and event counts increase dramatically over time.


Daily totals in the ICEWS event data.

Read the rest of this entry »

Precision-recall curves

ROC curves are a fairly standard way to evaluate model fit with binary outcomes, like (civil) war onset. I would be willing to bet that most if not all quantitative political scientists know what they are and how to construct one. Unlike simpler fit statistics like accuracy or percentage reduction in error (PRE), they do not depend on the particular threshold value used to divide probabilistic predictions into binary predictions, and thus give a better sense of the tradeoff between true and false positives inherent in any probabilistic model. The area under a ROC curve (AUC) can summarize a model’s performance and has the somewhat intuitive alternative interpretation of representing the probability that a randomly picked positive outcome case will have been ranked higher by the model than a randomly picked negative outcome case. What I didn’t realize until more recently though is that ROC curves are a misleading indication of model performance with kind of sparse data that happens to be the norm in conflict research.


Confusion matrix

Read the rest of this entry »

Archigos leader turnovers by regime

This post is about the Archigos data, which you can find here.

Political scientists, and maybe historians as well, are familiar with coups, rebellions, and mass protests as distinct phenomena that lead to the fall of regimes occasionally. Another way to view these events is from the perspective of state leaders, and how these events affect transitions between political leaders. Selectorate theory does this by considering the sets of people within a regime that a leader must rely on to remain in power, and how their relative sizes shape behavior. We do this empirically by modeling irregular leadership changes, where we draw our dependent variable from the Archigos dataset. I’ve been vaguely aware of these data for a while, but honestly did not understand well how useful they could be. In this post I’ll try to give a quick overview of the data.

Archigos is a dataset of the political leaders of states from 1875 on collected by Hein Goemans, Kristian Skrede Gleditsch, and Giacomo Chiozza. The most recent version, 2.9, has more than 3,000 leaders through 2004 and an update to 2014 is in the works. Aside from identifying leaders and when they gained and lost office, it codes how they did so (from the Archigos codebook):

Archigos codes the manner in which transfers between rulers occur. Our main interest is whether transfers of power between leaders take place in a regular or irregular fashion. We code transfers as regular or irregular depending on the political institutions and selection mechanisms in place. We identify whether leaders are selected into and leave political office in a manner prescribed by either explicit rules or established conventions. In a democracy, a leader may come to power through direct election or establishing a sufficient coalition of representatives in the legislature. Although leaders may not be elected or selected in particularly competitive processes, many autocracies have similar implicit or explicit rules for transfers of executive power. Leader changes that occur through designation by an outgoing leader, hereditary succession in a monarchy, and appointment by the central committee of a ruling party would all be considered regular transfers of power from one leader to another in an autocratic regime.

Read the rest of this entry »

Building rgdal from source

My limited knowledge of what happens in Terminal, and thus by extension shell, is mostly driven by PostgreSQL/PostGID/rgdal/RPostgreSQL install errors. In the latest variant of this, rgdal throws the following error when attempting to build from source:

checking PROJ.4: epsg found and readable... no
Error: proj/epsg not found
Either install missing proj support files, for example the proj-nad and 
proj-epsg RPMs on systems using RPMs, or if installed but not 
autodetected, set PROJ_LIB to the correct path, and if need be use 
the --with-proj-share=configure argument.

I have to build from source by the way because the default rgdal package for Mac does not include a PostgreSQL driver, meaning I have to build it against another version of GDAL that does. This was another fun thing to discover, but at least is easy to diagnose by checking whether PostgreSQL shows up when you run ogrDrivers() in R. Anyways, as far as I can tell the problem was that I installed proj via homebrew, a package manager for OS X. As a result although rgdal could find the proj binary via a symlink, it could not find the epsg and related data files that were in a little dark corner by themselves. The solution was to build the package with an option providing the file location manually:

install.packages("rgdal", type = "source", 

This is I guess exactly what the install error message told me to do.

The right kind of variance

or, How I learned to stop worrying and love event data. (This post first appeared on Predictive Heuristics)

Nobody in their right mind would think that the chances of civil war in Denmark and Mauritania are the same. One is a well-established democracy with a GDP of $38,000 per person and which ranks in the top 10 by Human Development Index (HDI), while the other is a fledgling republic in which the current President gained power through a military coup, with a GDP of $2,000 per person and near the bottom of the HDI rankings. A lot of existing models of civil war do a good job at separating such countries on the basis of structural factors like those in this example: regime type, wealth, ethnic diversity, military spending. Ditto for similar structural models of other expressions of political conflict, like coups and insurgencies. What they fail to do well is to predict the timing of civil wars, insurgencies, etc. in places like Mauritania that we know are at risk because of their structural characteristics. And this gets worse as you leave the conventional country-year paradigm and try to predict over shorter time periods.

The reason for this is obvious when you consider the underlying variance structure. First, to predict something that changes, say dissident-government conflict, the nature of relationships between political parties, or political conflict, you need predictors that change.


Predictions for regime change in Thailand from a model based on reports of government-dissident interactions (top). White noise, with intrinsically high variance, is not helpful (middle), but neither is GDP per capita (bottom).


Read the rest of this entry »

Baby steps with R Shiny

Shiny is a web application framework that lets you create interactive websites representing R data visualization and analysis. The gallery has some nice examples, and it looks like a great way to make R more accessible without having to know things like JavaScript or d3. I’ve been in trying my hand at it and it seems like a great way to visualize the models underlying the forecasts I work on in Ward Lab as well as the event data on which they are in part based.

It’s always easier to pick up new things like this with a strong motivating example, and for me it was visualizing the distribution of finish times in the SEB Tallinn Marathon in Estonia last weekend. My wife and I both ran and completed our first marathons, and one can look up the finish times and some other information on the event website. However, there was a post in the New York Times a few months ago that had a plot of the distribution of marathon times and which had spikes around the half hour marks as runners pushed themselves to meet arbitrary goals. So I was curious what the distribution of finish times was for the Tallinn Marathon. Along the way, it would also be nice to see where you fall in the distribution, and, since it is maybe not fair to lump all runners into one category, to do so by age and gender groups. Instead of producing dozens of separate plots in R, this seems like a candidate for something interactive, and hence Shiny. You can find the interactive results here, and they look like this:

SEB Marathon app

Shiny interactive visualization of SEB Tallinn Marathon finish times. The highlighted time is for me. Yes, I am slow.

Read the rest of this entry »


Get every new post delivered to your Inbox.

Join 257 other followers