Click here to see the SAS code.
Click here to see the example.
See my blog for more information about this graph!
This example uses real data that I downloaded from the World Health Organization website.
The data was in an excel spreadsheet, and I read it into a sas data set
using sas/access to pc file formats (specifically, proc import).
I create my own copy of the maps.world sas/graph map data set,
and use the glcnsm. format to convert the numeric country fips
code into a text name, so that I can match up the text names
from the WHO data with the numeric country fips codes in
our maps.world map. (Note that you have to add sashelp.mapfmts
to your fmtsearch, in order for this format to be available).
I set up 12 pattern statements with varying shades of red to yellow,
so my map will have the look of "gradient" shading.
I use "proc gmap" to draw the map, and color each country according
to the amount of alcohol consumed, and I use the html= option to
identify a variable that contains html title= charttip/flyover-text
(so you can hover your mouse over the countries to see the amount
of alcohol consumed).
Scroll down, and you'll see 4 variations of the map:
Total Alcohol, Beer, Wine, and Spirits.
The southern half of africa seems to prefer beer.
Russia drinks spirits (probably vodka :) and not much wine & beer.
Australia drinks more beer & wine than spirits.
China drinks much more spirits than beer & wine.
Back to Samples Index