Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

I had several people ask me if I could use SAS/Graph to do something like the
 following fancy/interactive graphic:
 
http://www.acm.org/runningonempty/roemap.html
 

When I first viewed it, I was impressed with how all the graphs were interactive,
 connected, and animated ... and then the "honeymoon phase" wore off! 

Rather than just playing with the graph, I tried to figure out exactly what the 
data was trying to tell me, and noticed several problems:
 
o What was the difference in the "Category Average" and the "Level Average"?
 (they appear to be the exact same values, therefore why list it 2 different ways?)
 
o The colors aren't really intuitive -- blueish is good, lavender is medium, and grapeish
 is bad? Although these colors look ok artistically/aesthetically together, I don't
 think that they help the user distinguish good from bad.
 
o When you click on a state in the map, to "lock in its scores", all the other states
 go to a washed-out color ... these washed-out colors now visually match up to
 the wrong colors in the legend (misleading & compromises data integrity!)
 
o They chose evenly-spaced breakpoints for the legend binning (0-20-40-60-80-100)
 but is there really a difference in a score of 80 and 81? - I think probably not.
 Smarter grouping/binning could probably be used.

o Since this uses Flash, you cannot view it with an iPhone or iPad browser!
 
o And, in general, there's just "too much going on" in the graph. It's difficult to determine
 what the graph is trying to show you, and it's easy to get lost.
 

Now, for my SAS/Graph version ...
 
My improvements:
 
o I only include the "Average" category once.
 
o I used colorbrewer.org to help pick good "diverging" colors, and I picked a color scheme
 that used the traditional 'red' for bad, and 'green' for good.
 
o The colors do not change to lighter shaded -- they are the same all the time.
 
o I use "quantile binning" for the colors, rather than hard-coding certain 
 arbitrary bins. This way, you can quickly glance at the map and determine
 what the worst (red) & best (green) 1/5 are, and so on.

o Since my version uses simple html and png files, you can view it 
 with any browser (including Mobile Safari on iPhones and iPads)!  :)
 
o And in my version, I leave out the bar charts for the individual states.
 This helps keep the graph from being "too busy", and gives the users a 
 small enough piece of the data that they can get their mind around it
 easily.
 

SAS/Graph Technology Used:
 
The selectable buttons along the top are created using a wide/short Proc Gslide,
 with annotated boxes, and annotated text labels, with html links for the drilldown.
 
I use Proc Rank to do my quantile binning.
 
I use Proc Gmap to create the map.
 
I use Proc Gplot, with the 'needle' interpolation, to create the scatter plot.
 (the x-axis is a sorted rank, and I print it as the state abbreviation using a user-defined format)
 

Back to Samples Index