GMAP Procedure

Example 16: Using Traditional Map Data When Specifying Midpoints in a Prism Map

Features:

MAP= required argument referring to traditional map data

DATA= required argument referring to response data

ID statement

FORMAT statement

PRISM statement options:
MIDPOINTS=
CDEFAULT=
Other features:

SAS DATA step with assignment statements

Data sets: MAPS.AFRICA (map data)

SASHELP.DEMOGRAPHICS (response data)

Sample library member: GMPMIDPT
This example specifies a set of midpoints that are used to create the response levels.
Specifying Midpoints in a Prism Map with Traditional Map Data

Program

goptions reset=all border;
title1 "Adult Literacy Rate";
data africa;
set maps.africa;
by id segment;
if first.id then lake=0;
if x=. then lake+1;
retain lake;
run;
proc gmap data=sashelp.demographics(where=(cont=94))
          map=africa(where=(lake=0)) density=low all;
   id id;
   format adultliteracypct percentn7.2;
   prism adultliteracypct / midpoints=.1 to .9 by .2
                            cdefault=yellow;
run;
quit;

Program Description

Set the graphics environment.
goptions reset=all border;
Define the title for the map.
title1 "Adult Literacy Rate";
Identify lake regions in the map data.
data africa;
set maps.africa;
by id segment;
if first.id then lake=0;
if x=. then lake+1;
retain lake;
run;
Produce the prism map. 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.DEMOGRAPHICS does not include an observation for the map area. The output shows 3 such areas. The MIDPOINTS= option specifies the response levels for the map. The CDEFAULT= option sets the color of map areas that have missing data.
proc gmap data=sashelp.demographics(where=(cont=94))
          map=africa(where=(lake=0)) density=low all;
   id id;
   format adultliteracypct percentn7.2;
   prism adultliteracypct / midpoints=.1 to .9 by .2
                            cdefault=yellow;
run;
quit;