I recently saw a cool graph showing the US import/export trade deficit. But after studying it a bit, I realized I was perceiving it wrong. Follow along in this blog, to find out what the problem was, and how I redesigned the graph to avoid it.
I was looking through dadaviz.com and happened upon a cool graph showing the US imports & exports over time, and the deficit between the two. I didn't like that they used an animation to alternate between the two graphs, but I did like what the data was showing.
I decided to create my own version of their graph, and make a few little changes to improve it. I found the data on the US Census website, saved it in Excel spreadsheet format, and imported it into SAS. I then used PROC SQL to merge the import and export data into a single dataset, so I could graph them together.
Rather than packaging the two graphs as a gif animation, I created them separately. The biggest change I made was in cleaning up the time axis a bit, and extending some reference lines from it. I also made it clear (in the title) that it is a plot of monthly data (which wasn't 100% clear in the original graph). Here are my two graphs:
I thought smugly to myself, "Now those are some nice looking graphs!" ... But then it jumped out at me - I was misperceiving the data! (And most likely other people would too!)
The problem is that the deficit for any given month is the vertical distance between the two lines. Measured like the red lines I've added to this graph, for example:
But instead of the vertical distance between the lines, my brain had been perceiving the deficit as the ~perpendicular distance between the lines (something more like the red lines I added to the graph below). During the big recession of ~2008, for example, when there was a big drop in both imports and exports, I was visually misperceiving that the trade deficit was very small (the perpendicular distance between the lines). And I bet many other people were making the same mistake!
So I set about creating a better graph, which shows the trade deficit without any visually misleading traps the viewer can fall into. I chose a simple bar chart, showing just the deficit - the graph is not nearly as 'sexy' but it is very unlikely that anyone will misperceive the data! :-)
As always, I recommend plotting the data in several different ways, to get a better understanding of it. What other ideas do you have that might improve the graph? Perhaps it would be good to show the deficit as a percent of the total trade(?)