One Chart that Explains Why Ukraine was Vulnerable to Revolution

After months of protests, Ukraine slipped into violence last week as government forces attacked protesters in Kyiv. Then, in a frantic 48 hours, President Viktor Yanukovych’s government collapsed, rival politician Yulia Timoshenko was released from prison, and Yakukovych fled into hiding.  It was a stunning victory for the “maidanovtsi”, those protesting on Kyiv’s Maidan and those supporting the protesters around the county and the world.

I’m reading Bruce Bueno de Mesquita’s The Predictioneer’s Game, which is about analyzing incentives to make political forecasts. This book got me thinking about Ukraine. Why did Yanukovych fall? Sure, he was corrupt, but so are many leaders in the region.

What happened in Ukraine was very complex. But it seems to me that at a basic level, the obvious corruption of the Yakukovych government,  combined with Ukraine’s relatively open and democratic society, led to an unstable situation.

To test this intuition, I looked at data from The Economist’s Democracy Index and Transparency International’s Corruption Perception Index. This plot shows where the former Soviet republics fit on the corruption – authoritarianism plane (click on the image for interactive version):

demo cor2

It is instructive to divide this plot into quadrants. The lower left quadrant shows those countries that are both very corrupt and authoritarian. These governments have survived very high levels of corruption in part because they resort to anti-democratic means of staying in power, such as restricting citizens’ political and civil rights.

The upper right quadrant contains nations with lower levels of corruption and authoritarianism. Chief among these are the Baltic states, which have enjoyed a high degree of stability. Georgia, although it experienced a revolution in 2003, has been more politically stable in recent years.

The lower right quadrant is a null set. We just don’t see countries that are very authoritarian but not very corrupt in this region. An example of a non-Eurasian country that sits in this quadrant would be the United Arab Emirates.

And then there’s the upper left quadrant: states that are less authoritarian but have high levels of corruption. Countries occupying this space have experienced lots of political instability. Kyrgyzstan has had two revolutions in the last decade: the Tulip Revolution of 2005, and the more violent second Kyrgyz revolution in 2010. Moldova suffered widespread unrest in 2009 (the so-called Twitter Revolution), although recent trends point to a more democratic and pro-European direction. And Ukraine had the Orange Revolution in 2004 before the political order was upended again last week as a result of Euromaidan.

Of course, there are many other factors that determine how likely a government is to fall. Economic growth and inequality surely play a part, as do the personalities and governing styles of individual leaders. Yakukovych, for example, was indecisive and incompetent, and many of his allies quickly abandoned him.

So what are the lessons here? Well, if you are going to blatantly siphon money away from your constituents while ignoring many of their basic needs, you better rule with an iron fist. If not, they are going to rise up and throw you out. Or better yet, don’t run a corrupt regime in the first place.

The events in Ukraine illustrate how a relatively democratic society, with a strong civil society and a (mostly) free press can be an important check on corruption in government. Although far from being “fully democratic” in the eyes of international indices, Ukraine was democratic and open enough for Euromaidan to take root and ultimately succeed.

From Miracle Metal to Global Health Risk: A 100-Year History of Mercury Prices and Production

I want to write a series of posts about mercury production, prices, and trade. Although this may seem like a rather esoteric subject, I hope to convince readers that it’s actually pretty interesting. I have a professional interest in mercury as a global pollutant, having worked on negotiations for the Minamata Convention. These posts will also be good opportunity to practice data manipulation, graphics, and analysis in R, a powerful programming language for statistical computing.

Mercury is a pretty amazing substance. It’s the only metal that is a liquid at room temperature, a property that has long been a source of fascination to people, and led to a wide range of applications in industry. Unfortunately, mercury is also a toxin that has harmful effects on both people and the environment.

In this post I’ll examine the price and global production of mercury over the last hundred years or so using data from the U.S. Geological Survey. First, let’s look at the price of mercury in constant 1998 dollars since 1900:

mercury price

You can see that prices have fluctuated quite a bit. Let’s examine the three prominent peaks in the time series and try to figure out what caused them. Now, high prices could mean increased demand, tight supply, or a combination of both. We need to look at global mercury production over the same time period to help shed light on the variations in mercury price:
global mercury production
The first price peak occurred in the late 19-teens, around the time of WWI. In fact, I would posit that it is a direct consequence of WWI. Mercury fulminate is an explosive compound that was commonly used in the last century as a primer for small arms ammunition. They probably used a lot of it during the First World War.

Incidentally, you may recognize mercury fulminate from the TV show Breaking Bad. Walt made some and used it to blow up a group of rival drug dealers. There’s even a MythBusters segment about it.

The second price spike occurred during WWII. This was likely a result of increased demand for use in fulminate explosives, and perhaps in switches and other such products for wartime equipment. Mercury production actually increased quite a bit during the war, but it was apparently not enough prevent high prices. In response to the German invasion, the Soviets moved their main center of mercury production from Nikitovka in Ukraine to Khaidarkan in Kyrgyzstan. I’ll talk about both of these places in a later post.

The last price peak occurred in the 1960s. The causes are a bit more complex. My guess is that a combination of industrial and military uses were driving up demand, and production, although increasing, could not keep up. During this time the United States was building up its national defense reserves of mercury, and other countries were probably doing the same. One defense-related use of mercury was to separate lithium isotopes for use in hydrogen bombs. Hundreds of tons of mercury were spilled at Oak Ridge National Laboratory during isotope separation, and environmental contamination remains to this day. Another use of mercury that never came to be was as a coolant (to replace water) for nuclear reactors.

These were heady days in the mercury business, before the human health and environmental impacts were widely know. This fascinating newsreel from 1955 gives you a flavor of what the times were like:

Mercury prices (and production) started dropping in the 1970s as alternatives to industrial uses were found and the health risks started to become clear. But prices have been growing rapidly in recent years. In the next post I’m going to examine this and look at the degree to which artisanal gold mining might be responsible.

DIY Animation with Census Explorer

Recently, I attended the ESRI Federal GIS conference here in Washington DC. I was canvassing the vendor exhibits looking for free pens, and maybe, if I was lucky, notebooks, when I came across the U.S. Census Bureau display. The nice people there showed me a very cool tool for viewing basic U.S. demographic data over time and at a variety of spatial scales. It’s called Census Explorer.

I have used Census data before to do some analysis (and write a post) on age and income in U.S. counties, but I had to download the data and map it myself. But Census Explorer is an online map interface. You can zoom from State to census tract level, and toggle between data from 1990, 2000, and 2012.

I zoomed in on the Milwaukee, WI metro area and looked at the percent of population age 65 and over at the census tract level. Toggling from 1990 to 2012, I could make out a clear pattern – the suburbs were becoming older at the expense of the central city – but I had no way to export this as a single image. So I went low tech. I took screenshots of each image, aligned then, and made a GIF using a free online service.

age animation

It’s not perfect, but the demographic change over time is clearly visible. Actually, I was surprised to see such a clear pattern in Milwaukee over the last 22 years. Any idea why this is happening?

Global Map of (In)tolerance

The Winter Olympics in Sochi begin today. I hope the games are safe and successful, and I also hope they serve to shine a global spotlight on anti-gay attitudes and policies in Russia.

On that note, the Martin Prosperity Institute has put together this map showing the percentage of populations surveyed who believe their country is a good place to be gay or lesbian.

Click to read about how this map was made

By Martin Prosperity Institute. Click to read about how this map was made

The authors also compared these findings with national economic and social indicators, and found that tolerance of homosexuality is correlated with all sorts of good things. For example, the correlation with economic output per person is 0.72. That’s pretty high. It’s interesting to think about why this is, and whether there is causality involved, and, if so, which way(s) it go(es). Something to ponder during the figure skating.

What if Ukraine split in two?

If you’re interested in Ukraine, you are probably aware of the country’s east-west political and enthno-linguistic divisions. I wrote about this in a couple of recent posts. Not long ago, I began to wonder what Ukraine would look like if it split into two nations. Now, I don’t think this is going to happen, nor do I think it would be in the best interest of Ukraine. But with protests continuing in Kyiv and in many of  the regions, it’s worth investigating what these two hypothetical nations would look like.

For this exercise, I used data on Ukraine’s oblasts (regions) that I had gathered for an earlier post, and plugged them into Tableau Public. First, I had to decide where to put the new border. I took the vote shares for Yanukovych in the 2010 elections for each region and plotted them in ascending order:

two ukraines vote share

There is a sharp break where the vote share jumps to above 50% – a natural place for the division. Incidentally, it is interesting and unexpected that Zakarpatskaya region, in the far west of the country, had the highest level of Yanukovych support of all the Timoshenko-majority regions. What is going on there?

Transferring that division to the map produces the following result:

two ukraines map2

Let’s look at the key features of these two imaginary countries:

two ukraines table

West Ukraine is a bit larger, and has a slightly higher population – ~24 million versus ~21 million. It’s landlocked, and shares borders with all of Ukraine’s current neighbors. East Ukraine has a higher per capita income, and occupies  all of Ukraine’s Black Sea Coast.

Sheet 6

The chart above illustrates some additional features of the countries. East Ukraine is much more urban than the west, and contains many more Russian speakers (although it has a large minority of Ukrainian speakers). West Ukraine has a much smaller minority of Russian speakers.

I encourage you to take a look at the entire interactive visualization in Tableau by clicking on the image below.


Amazingly Detailed Map of the Struggle in Kyiv

Here is an incredibly detailed map of the situation in Kyiv as of January 27. It comes from Dmitri Bortman and was published on Ilya Varlamov’s livejournal page, which has lots of on-the-ground details about what is happening on the Maidan (central square and environs) in Kyiv. If you want to read about what it’s actually like in Kyiv right now and see some amazing pictures, have a look at this recent post by Varlamov.

Basically the reddish shading shows the area occupied by the protesters, and the blue shading shows land occupied by government police forces. The red lines show barricades built by the protesters to keep riot police from clearing the demonstrations. The red dots give an idea of the density of clusters of protesters. Here’s the legend.

These Visualizations Will Spice Up Your Football Viewing this Weekend

Millions of Americans and a few dozen people from other regions of the globe will sit down this weekend to watch the NFC and AFC Championship games. Both games should be pretty good, but no matter how interesting they are, you’ll still need something to do during the commercials besides go for chips and beer and bathroom breaks. I’ll share with you two companions that I plan to have with me during the games. And they both involve attractive visualizations.

The first is the New York Times 4th Down Bot. This is a web site that compares every 4th down situation in the game with a model developed by Brian Burke of The Bot will then tell you whether the coach should choose to go for it, punt, or kick a field goal. The model was built from 10 years worth of football statistics and calculates how each decision impacts the number of expected points for that team. The idea is that coaches should be trying to maximize expected points (how many points they score minus how many points the other team scores) when the make their 4th down decision. This sounds incredibly obvious but according to the 4th Down Bot coaches are much more conservative than the model would predict.

For example, look at the graphic below. For each position on the field and 4th down distance to go, the graphic shows what decision would maximize expected points. If you are on the opponents 20 yard line and it’s 4th and 15, you should kick the field goal. So far so good. But look at what the model recommends for 4th and 1 at your own 11 yard line. It says you should go for it! I don’t think there’s ever been an NFL coach who’s gone for it in that situation, unless it’s very late in the game and you’re behind. You can see how much more conservative actual coaches are by looking at the right side of the graphic.

4th down

Click on the image to view the interactive version and learn more about the model used to develop it

One explanation that’s commonly given for this discrepancy is that coaches are not simply trying to maximize the chances of winning. They are also risk averse and fear making a controversial decision to go for it, which, if it fails, would incite the rage of the fans and media. There is something to this, but I don’t think it can explain the whole phenomenon. You would think that a maverick coach who starts going for it on 4th and 1 deep in his own territory would eventually start winning more games, and other coaches would feel safer and start copying him.

So I don’t know why coaches seem to play more conservatively than models would suggest they should. But as a fan I can say that intuitively I do think my team should go for it more often on 4th.

It’s fun to watch the game, and when a 4th down comes up, pretend you’re the coach and decide what to do. Then check what the Bot says. You can follow it on twitter at @NYT4thDownBot .

The second tool is seismic analysis of the vibrations caused by the crowd at the Seattle Seahawks stadium. The Pacific Northwest Seismic Network installed three seismometers under the stadium, which is legendary for its crowd noise. They are planning to make near real-time seismographs available during the NFC Championship game, so you can follow all the action during the game. If you’re a Seahawks fan, but you get too nervous to watch the game, you can just wait until you see a big spike in the seismometer, and then turn on the game to watch the replay.

We know that it is possible to pick up seismic waves produced by the roar of the crowd in Seattle because of the famous Beast Quake. This event was measured during Marshawn Lynch’s ridiculous touchdown run against the Saints in the 2011 playoffs. Here it is:

beast quake


And here’s the run:

Have We Already Reached Peak Whisker?

Courtesy of the Nathan Yau’s Flowing Data blog, here is a fascinating look at the prevalence of different types of facial hair from 1840 through the early 1970s:

This is so interesting! I naively assumed that male facial hair fashions came and went through the decades, but here you can plainly see that whiskers have been on a secular decline since a peak that occurred in about 1885. What happened? Was it an improvement of razor technology? Indoor plumbing? It’s incredible that almost 100% of men had facial hair at the turn of the century.

Other mysteries beckon. What’s going on with mustaches in the 19-teens? They shoot up to a peak and then decline almost as quickly. Does this have anything to do with Charlie Chaplin?

And how were these data collected? The only way I can think of is by analyzing old photographs. But wouldn’t that introduce a selection bias? Also, are these data from the U.S.? Europe? What would a worldwide whisker time series look like?

This graph comes from a scholarly article, and I’m sure  it sheds some light on these questions. But I have not read it. As interesting as it must be, I just don’t have time to read journal articles about facial hair.

Finally, there’s the question about what has happened since the 1970s when this was published. We all know that beards are enjoying a bit of a fashion renaissance (although I do suspect that their popularity has reached an inflection point, if not a local maximum). But do they approach the lofty highs of the 1890s?

Maybe in Portland: