GMAP Procedure

Example 8: Using Traditional Map Data When Specifying the Statistic for the Response Variable

Features:

MAP= required argument referring to traditional map data

DATA= required argument referring to response data

ID statement

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

SASHELP.ZIPCODE (response data)

Sample library member: GMPSTAT
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 Using Traditional Map Data

Program

goptions reset=all border;
title1 "Number of ZIP Codes per State";
proc gmap map=maps.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 for the map.
title1 "Number of ZIP Codes per State";
Produce the block maps. These include Puerto Rico and the District of Columbia. 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.
proc gmap map=maps.us data=sashelp.zipcode all;
   id state;
   block zip / statistic=frequency
               levels=5 relzero;
run;
quit;