Life expectancy changes

I played around with D3 some more. This time I used data from The World Bank to look at life expectancy over time and by country. The data goes back to 1960 and up to the most current estimates for 2009. Each line represents a country, and you can see a few more details by rolling over each one.

More usefully, you can select regions, as defined by The World Bank, and see how groups of countries have changed or compare with other regions. For example, the shot above shows East Asia and Pacific in pink and Sub-Saharan Africa in green.

The major dips for some of the countries jumped out at me immediately. A few quick searches suggest that they coincide with war, such as the Bangladesh Liberation War in the 1970s, the Iran-Iraq War in the 1980s, and the Rwanda Civil War in the 1990s. There's also a smaller dip for Iraq starting in early 2000.

Some countries, such as Seychelles, didn't have data that went back to 1960. In this case, the line starts where annual data became available.

There are a few interactions that I'd add to make the graphic more complete, but don't have time to get to right now. For example, as I clicked around, I wanted to keep a selected country highlighted to see how it compared to others. It'd be informative to point out periods of war on the graphic, too.

Two more suggestions: 1) an extra layer of context-dependant tabs for country would be great, so people can find a country of interest by name rather than by data, 2) I wonder if you can find a way to get D3 to simulate Illustrator’s ‘Multiply’ blend mode, so you could see density and unusual curves (e.g. Puerto Rico) amid that thicket of lines towards the top of the chart?

I was wondering the exact same thing – what happened in Southern Africa in the mid 1990s to cause almost every country in the region: South Africa, Swaziland, Lesotho, Botswana, Zimbabwae, Namibia – to all begin a decline in life expectancy at almost the same time?

The impression I get from some very shallow research suggests this is the AIDS pandemic kicking in, and that Mozambique only appears to be less affected because AIDS deaths increasing in the early 1990s co-incided with less violent deaths following the end of the civil war. I didn’t realise HIV hit the south of Africa so much harder and faster than the rest of the continent – map graphic over time, anyone?

Yes all the dips from 1990s onwards in Sub-Saharan Africa is likely to be HIV/AIDS related. I don’t think South Africa is hardest hit. Zimbabwe, Botswana etc had bigger issues. One also need to think about the quality of data for these countries. In South Africa only 80% of deaths are estimated to be reported. One would need to see how reporting in the different African countries vary as well as how the results are adjusted.

Why is spline interpolation used?!? Seriously: If there isn’t enough data, why interpolate it with a method that changes the intermediate points drastically? So according to this plot, we can predict mass murder in countries with poor data recordings by a huge *increase* in life-expectancy?!?

To answer a previous question: The plots, which are completely smooth are completely worthless as well, because there are at most a handful of data-points available (sometimes you can ‘see’ there are only 2 or 3) and those few points got interpolated non-linearly.

One more interesting observation: Slowly mouse down the chart, and note the countries with unusually spikey lines. With no exceptions I can see, these are either 1) countries with very small populations such as Malta, Seychelles (to be expected since random variation will be more pronounced here) or 2) countries from the European Soviet/Communist bloc: Russia, Czech Republic, Poland, Bulgaria, Lithuania, Latvia… Curiously, Asian soviet republics (e.g. Azerbaijan, Tajikistan) have lines as smooth as any other. Any theories as to why?

Yeah, one trick for making this easier is to use thick invisible lines in the background (with style pointer-events:all). These invisible lines are used for mouseover but don’t change the visual appearance.

Alternatively, you could create an invisible Voronoi overlay from the control points and use that, similar to the Protovis point behavior. :)

Perhaps another navigation system could be envisioned where each region was listed vertically. Selecting a region would open an accordion style listing of all the countries in that region. Then each country could be selected from this list. Might get a little long with some regions (the Europe region could be broken down further to account for this).

You could also have another selection for “all” that would allow toggling the gray lines. This would help when comparing North America, and other regions with few countries.

It’s definitely not a major point of this post, but for historical accuracy, I just wanted to note that mid-90s Rwandan dip was most likely due to the Rwandan genocide rather than the Rwandan civil war. The genocide was the murder of 800,000 people (well over 10% of the entire population) and was clearly distinct from the civil war, which was pretty inactive at that point (and in fact, the genocide only stopped once the side that had clearly lost the civil war re-activated and re-invaded the country). Wikipedia has accurate articles on both the Rwandan genocide and the Rwandan civil war for those wanting more information.