Sample 24902: Create a regional block map
/* Reset the goptions */
goptions reset=all;
/* Create map data set STATES1 */
/* by adding REGION to the US map data set */
data states1;
set maps.us;
select;
/* west */
when (state=53 or state=41 or state=16 or state=32 or state=06
or state=02 or state=15) region=1;
/* north central */
when (state=30 or state=46 or state=38 or state=31
or state=20 or state=56 or state=49
or state=08) region=2;
/* southwest */
when (state=04 or state=35 or state=48
or state=40) region=3;
/* midwest */
when (state=27 or state=19 or state=29 or state=55
or state=17 or state=26 or state=18
or state=39) region=4;
/* south */
when (state=05 or state=22 or state=01 or state=21 or state=47
or state=28 or state=13 or state=12 or state=45 or state=37
or state=51 or state=54) region=5;
/* new england */
otherwise region=6;
end;
run;
/* This sample program will generate a regional block map */
/* with one block per region. */
/* Create response data set SITES */
data sites;
input region sites;
datalines;
1 1100
2 262
3 92
4 612
5 23
6 52
;
/* Sort by REGION STATE. STATE must be included in the sort to */
/* preserve the original order of the points that comprise each state */
proc sort data=states1;
by region state;
run;
/* Remove the state boundaries since we only want one */
/* block per region */
proc gremove data=states1 out=map;
by region;
id state;
run;
/* Pattern for the bars */
pattern1 v=s r=6;
/* Pattern for the region */
pattern2 v=me r=6;
title 'Number of Sites Per Region';
/* Generate the map */
proc gmap data=sites map=map all;
id region;
/* Use areas=1 so that each region has a different pattern */
block sites / areas=1 discrete;
run;
quit;

This sample program uses PROC GREMOVE to remove state boundaries, thus creating a regional map.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GMAP Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Maps ==> Special Maps
|
| Date Modified: | 2005-08-31 03:03:07 |
| Date Created: | 2004-11-11 11:07:58 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | n/a | n/a |