Creating a map using death data

2

I guess most of us have a morbid curiosity about how we're going to die ... which is probably why Francis Boscoe's Causes of Death map went viral (no pun intended, of course!). This blog post shows how to create such a map...

But first, to lighten up the mood a bit for this somewhat dark blog topic, here's a picture of a medical skeleton I recently bought at the Raleigh flea market, and have been repairing/restoring - I've nicknamed him Fast Eddie (bonus points if you know where I got the name!)

skeleton

And now, on to the death map ...

Below is a snapshot of Francis' death map. The map has a lot of colors in the legend. And since people would have a difficult time matching the colors in the map to the colors in the legend, he also uses letters of the alphabet. The letters confused me a little at first, but once I realized what they were for, it made sense.

But, as with most maps, I wanted to try my hand at creating my own version, doing things a little differently. The first step was finding the data. Rather than using the 2001-2010 data, I thought it would be more interesting to just use the most recent data I could find (which was year 2013). The data was on the CDC website, in a pdf file (which is a bit difficult to use directly - ugh!) Here's what the pdf data looked like:

death_data_pdf

I copy-n-pasted the data into text files, and here's what they looked like:

death_data_txt

I wrote some code to import the 5 text files into SAS, and then merged them (horizontally) with a data step.

death_data_sas

I then transposed the data, split it into 2 datasets (one for the individual states, and one for the US average), and then joined them together again so that each state/cause pair also had a variable for the US average for that cause.

death_data_tran

I calculated the % above or below average using the following equation: above_below_avg = (rate/cause_avg_rate)-1, and then for each state I selected the cause of death with the highest rate above average. Here's a glimpse of the final data:

death_data_highest

As you can see, data preparation plays a *big* role in creating maps and graphs!

And now, what you've been waiting for - my map! Mine has fewer causes of death in the legend, and therefore I felt I didn't need to include the alphabet letters in the legend and on the map (which gives it a much cleaner look). And also, if you click the image below, you can see the interactive version of my map - it provides hover-text over each state so you can see the actual data values, and you can click the states to see more information on that cause of death. Similarly, the legend color-chips have hover-text and drill-down.

mortality_us_2013

 

So, for those of you who live in the US, how did your state do? Did any of these numbers surprise you?

Share

About Author

Robert Allison

The Graph Guy!

Robert has worked at SAS for over a quarter century, and his specialty is customizing graphs and maps - adding those little extra touches that help them answer your questions at a glance. His educational background is in Computer Science, and he holds a BS, MS, and PhD from NC State University.

Related Posts

2 Comments

  1. I'm super impressed to see our work talked about in your blog. One of your blog readers had contacted us to get the SAS code, and had mentioned about the blog. It is an honor.

    I just wanted to throw out there that 2013 mortality data is available in CDC Wonder Web (http://wonder.cdc.gov/mortSQL.html) which can be used instead of dealing with pdf format.

    I am really interested in finding out how you converted the table into the maps. Did you use SAS graph to draw the entire map with the capabilities of hover-text and drill-down? It looks really neat!

Back to Top