GMAP Procedure
Example 23: Using GfK GeoMarketing Map Data to Produce a Choropleth Map
Combining Three Map Data Sets
Features: |
MAP= required argument referring to GfK map data
DATA= argument referring to response data
ID statement
- CHORO statement options :
- STATISTIC=
- DISCRETE
- LEGEND
|
Other features: |
SAS DATA step with assignment statements
GPROJECT procedure
|
Data sets: |
MAPSGFK.AUSTRIA (map data)
MAPSGFK.CZECH_REPUBLIC (map data)
MAPSGFK.HUNGARY (map data)
|
Sample library member: |
GMPGCONC |
CAUTION:
The GfK
GeoMarketing map data set used in this example is licensed to be used
only with SAS/GRAPH.
Specify the countries to combine.
data all;
length name $18;
set mapsgfk.austria(in=k1) mapsgfk.czech_republic(in=k2) mapsgfk.hungary;
if k1 then name='Austria';
else if k2 then name='Czech Republic';
else name='Hungary';
x=long;
y=lat;
run;
Project the map and store the projection parameters.
proc gproject data=all out=map degrees eastlong parmout;
id name id;
run;
Set the graphics environment.
goptions reset=all border;
Define the title, footnote, and legend for the map.The LEGEND= statement relabels the NAME variable.
title1 "Combining 3 Map Data Sets";
footnote j=r "This map drawn with GfK map data";
legend1 label=("Country Name:");
Produce the choropleth map that combines 3 European countries. The DISCRETE= option generates a separate color
for each different response variable value. The STATISTIC= option
specifies that the GMAP procedure will match the first observation
from each of the three MAPSGFK data sets and output the response value
from that observation only. The LEGEND= option pulls in the LEGEND
statement’s label assignment.
proc gmap map=map data=map;
id name id;
choro name/discrete stat=first legend=legend1;
run;
quit;
Copyright © SAS Institute Inc. All rights reserved.