GMAP Procedure

About Response Data Sets

Definition: Response Data Set

A response data set is a SAS data set that can contain other variables, but requires the following variables:
  • one or more response variables that contain data values that are associated with map areas. Each value of the response variable is associated with a map area in the map data set.
  • identification variables that identify the map area to which a response value belongs. These variables must be the same as those that are contained in the map data set.

Using the Response Data Set with the Map Data Sets

The map data set and the response data set must be used independently in the PROC GMAP statement, where the response data set is specified by the DATA= option and the map data set is specified by the MAP= option. The values of the map area id-variables in the response data set determine the map areas to be included on the map. Unless the ALL option is used in the PROC GMAP statement, only the map areas with response values are shown on the map. As a result, you do not need to subset your map data set if you are mapping only a small section of the map. However, if you map the same small section frequently, then create a subset of the map data set for efficiency.
If you have a response data set named WORK.SITES, then the syntax for using the GMAP procedure might resemble the following:
proc gmap map=mapsgfk.us data=work.sites;
   id state;
   choro region/discrete;
run;
quit;

About Response Variables

The GMAP procedure can produce block, choropleth, prism, and surface maps for both numeric and character response variables. Numeric variables fall into two categories: discrete and continuous.
  • Discrete variables contain a finite number of specific numeric values that are to be represented on the map. For example, a variable that contains only the values 1989 or 1990 is a discrete variable.
  • Continuous variables contain a range of numeric values that are to be represented on the map. For example, a variable that contains any real value between 0 and 100 is a continuous variable.
Numeric response variables are treated as continuous variables unless the DISCRETE option is used in the action statement.

About Response Levels

Response levels are the values that identify categories of data on the graph. The categories that are shown on the graph are based on the values of the response variable. Based on the type of the response variable, a response level can be determined by any of the following:
  • a character value
  • the MIDPOINTS= option
  • a range of numeric values
  • a specific numeric value
When response levels are determined by a character value, the GMAP procedure treats each unique value as a response level. For example, if the response variable contains the names of ten regions, each region is a response level, resulting in ten response levels.
When character response levels are determined by the MIDPOINTS= option, any response variable values that do not match one of the specified response level values are ignored.
When response levels are determined by a range of numeric values, each response level has a similar number of observations. These options are exceptions to this:
  • The LEVELS= option specifies the number of response levels to be graphed for the response variable. The LEVELS=number-of-midpoints option is ignored if either the DISCRETE or MIDPOINTS= option is used.
  • The DISCRETE option causes the numeric variable to be treated as a discrete variable.
  • The MIDPOINTS= option chooses specific response level values as medians of the value ranges.
If the response variable values are continuous, then the GMAP procedure assigns response level intervals automatically unless you specify otherwise. The response levels represent a range of values rather than a single value.
When response levels are determined by specific numeric values, and the DISCRETE option is specified, one level is created for each value. If the response variable has an associated format, then each formatted value is represented by a different response level.
The AREA, BLOCK, CHORO, and PRISM statements assign patterns to response levels. In CHORO and PRISM maps, response levels are shown as map areas. However, in BLOCK maps, response levels are shown as blocks. If you specify the AREA statement on a BLOCK map, then the response levels for AREA variable are shown as map areas. The default fill pattern for the response level is solid.
PATTERN statements can define the fill patterns and colors for both blocks and map areas. PATTERN definitions that define valid block patterns are applied to the blocks (response levels), and PATTERN definitions that define valid map patterns are applied to map areas.
See PATTERN Statement for more information about fill pattern values and default pattern rotation.