GMAP Procedure

Example 7: Using GfK GeoMarketing Map Data When Specifying the Statistic for the Response Variable

Features:

MAP= required argument referring to GfK map data

DATA= required argument referring to response data

ID statement

BLOCK statement options:
STATISTIC=
LEVELS=
RELZERO
Data sets: MAPSGFK.US (map data)

SASHELP.ZIPCODE (response data)

Sample library member: GMPGSTAT
CAUTION:
The GfK GeoMarketing map data set used in this example is licensed to be used only with SAS/GRAPH.
This example specifies the statistic for the response variable that is displayed by the block map. The STATISTIC= option specifies that the statistic is frequency rather than the default statistic (sum).
Specifying a Statistic for the Response Variable With GfK Map Data

Program

goptions reset=all border;
title1 "Number of ZIP Codes per State";
footnote j=r "This map drawn with GfK map data";
proc gmap map=mapsgfk.us data=sashelp.zipcode all;
id state;
block zip / statistic=frequency
            levels=5 
            relzero;
run;
quit;

Program Description

Set the graphics environment.
goptions reset=all border;
Define the title and footnote for the map.
title1 "Number of ZIP Codes per State";
footnote j=r "This map drawn with GfK map data";
Produce the block maps. The ALL argument specifies that the output should include all of the map areas from the map data set, even if the response data set SASHELP.ZIPCODE does not include an observation for the map area. The STATISTIC= option specifies the statistic for the response variable. The LEVELS= option specifies the number of response levels. The RELZERO option specifies that the blocks values are relative to zero. Note that the MAPSGFK.US map data set does not include Puerto Rico or the District of Columbia. Block maps created with the traditional MAPS.US map data set will include these map areas.
proc gmap map=mapsgfk.us data=sashelp.zipcode all;
id state;
block zip / statistic=frequency
            levels=5 
            relzero;
run;
quit;