In the U.S. we have a presidential election every 4 years - and as luck would have it, 2012 is an election year!
I see a lot of election maps & graphs in the news, and I'm always subconsciously critiquing them in my mind and thinking to myself, "How would I graph this data?"
And, to that end, I've put together a few examples to show how SAS might be used to graph election data...
First, here's my most recent graphic, which I created today using the current election data. I got the idea for this graphic partly from a CNN map (data & colors), and partly from a Huffington Post map (better bar chart section). If you click on the image below, you can view the full-size interactive version where you can hover your mouse over the states and bar segments to see the number of electoral votes, and other information. This is a SAS/GRAPH GMap and a GChart bar chart, combined on the same page using Proc GReplay.
And now, two more graphs -- both of these only plot the data in one way, and neither tell the complete story...
First is a traditional map, colored by the winner of the state's electoral votes. One neat feature in this map is that I include the image of the candidate in the color legend. One weakness of this map is that it suffers from "area size bias" - the geographically big states are very prominent, and the small states look insignificant ... but as the old saying goes, "dirt don't vote!" Montana is very big in geographical size, but it only has 3 electoral votes. Massachusetts is geographically small, but yet it has 4 times as many votes as Montana. Another weakness is that it's difficult to determine which candidate received the most votes (which is the most important thing in an election).
Here's another way to look at the same (year 2000) election data - using a rectangular tree map. This technique helps overcome the area size bias, with the size of the box for each state being proportional to the number of electoral votes. But now you lose the geographical location of the states, and it's still difficult to count how many votes each candidate received.
In my opinion, there's no one "perfect" way to visualize election data - it all depends on what you want to see about the data. That being said, I do like the first graphic above (with the map & bar chart), and I think it tells the general observer a lot about the data.
If you'd like to see the SAS code for the above 3 examples, here is it:
I welcome your feedback, suggestions, questions, and ideas about plotting election data! But, of course, let's keep the discussion about the technical aspects of graphing data, and not about likes/dislikes of the candidates! :)