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

This map was created as the launching-point for one of 
Jim Goodnight's demos.  He used it at an analyst conference
in spring 2005, and also plans to use it at the Opening
Session of SUGI, and maybe other presentations.

The map is created with SAS/Graph 'proc gmap'.

The baseballs are created using an annotated polygons & lines.
(The baseball is a white polygon, and the stitching is made
from red dashed lines.)

The annotated baseballs are placed (geocoded) on the map by
taking the zipcode of each team, and looking up the longitude
and latitude location in sashelp.zipcodes, and then "gprojecting"
these coordinates with the US map, so they both get transformed
into an X/Y coordinate system that lines up correctly.

Since the canadian locations are not in sashelp.zipcode, I 
cheated and used a US zipcode that was *very* close to the
canadian border.  Close enough for baseball! ;)

The MLB image/logo is placed in the background using 
"goptions iback".

When you click on the baseballs, it launches a sas/intrnet job
which queries all the game attendance data for that team, and 
plots it using box plots by the following on the horizontal axis: 
day-of-week, month-of-year, year, day-vs-night games, number of wins, 
and number of losses.  (Note that you have to be on the sas internal 
network to access this SAS/IntrNet server).

For Goodnight's demos, they're planning to have the baseball
drilldowns launch a stored process that does more complex 
statistical analyses, rather than these simple box plots -
these box plots are just proof-of-concept placeholders.

Back to Samples Index