The sample code on the Full Code tab uses the AREA statement in PROC GMAP to color the map areas based on the value of a response variable. The BLOCK statement is used to color the blocks based on the value of the block variable.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
The graphics output in the Results tab was produced using SAS® 9.4. Submitting the sample code with releases of SAS prior to SAS 9.4 might produce different results.
/* Set the graphics environment */
goptions cback=white border htitle=12pt htext=8pt;
/* Create sample data using Census Bureau population values */
data sample;
input st $ pop2010 est2015 @@;
state=stfips(st);
datalines;
AL 4779736 4858979 AK 710231 738432 AZ 6392017 6828065 AR 2915918 2978204
CA 37253956 39144818 CO 5029196 5456574 CT 3574097 3590886 DE 897934 945934
DC 601723 672228 FL 18801310 20271272 GA 9687653 10214860 HI 1360301 1431603
ID 1567582 1654930 IL 12830632 12859995 IN 6483802 6619680 IA 3046355 3123899
KS 2853118 2911641 KY 4339367 4425092 LA 4533372 4670724 ME 1328361 1329328
MD 5773552 6006401 MA 6547629 6794422 MI 9883640 9922576 MN 5303925 5489594
MS 2967297 2992333 MO 5988927 6083672 MT 989415 1032949 NE 1826341 1896190
NV 2700551 2890845 NH 1316470 1330608 NJ 8791894 8958013 NM 2059179 2085109
NY 19378102 19795791 NC 9535483 10042802 ND 672591 756927 OH 11536504 11613423
OK 3751351 3911338 OR 3831074 4028977 PA 12702379 12802503 RI 1052567 1056298
SC 4625364 4896146 SD 814180 858469 TN 6346105 6600299 TX 25145561 27469114
UT 2763885 2995919 VT 625741 626042 VA 8001024 8382993 WA 6724540 7170351
WV 1852994 1844128 WI 5686986 5771337 WY 563626 586107 PR 3725789 3474182
;
run;
legend1 label=('Census Population in 2010');
legend2 label=('Estimated Population in 2015');
/* Map area patterns */
pattern1 v=ms c=cxedebf6;
pattern2 v=ms c=cxd1cde1;
pattern3 v=ms c=cxb5afcc;
pattern4 v=ms c=cx9991b7;
pattern5 v=ms c=cx7d73a2;
pattern6 v=ms c=cx5e528b;
/* Block patterns */
pattern7 v=s c=cx99FF99;
pattern8 v=s c=cx7BD77B;
pattern9 v=s c=cx5DAF5D;
pattern10 v=s c=cx3F873F;
pattern11 v=s c=cx215F21;
pattern12 v=s c=cx003300;
title1 'Using the AREA and BLOCK statements with PROC GMAP';
footnote j=r h=8pt 'Popultion data from the Census Bureau';
proc gmap data=sample map=maps.us;
id state;
area est2015 / levels=6 legend=legend1;
block pop2010 / levels=6 legend=legend2;
format est2015 pop2010 comma12.;
run;
quit;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GMAP Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Maps ==> Other Maps |
Date Modified: | 2010-02-10 08:54:04 |
Date Created: | 2010-02-02 14:47:07 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |||
Microsoft® Windows® for x64 | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |||
Microsoft Windows XP Professional | 9.2 TS1M0 | |||
Windows Vista | 9.2 TS1M0 | |||
64-bit Enabled AIX | 9.2 TS1M0 | |||
64-bit Enabled HP-UX | 9.2 TS1M0 | |||
64-bit Enabled Solaris | 9.2 TS1M0 | |||
HP-UX IPF | 9.2 TS1M0 | |||
Linux | 9.2 TS1M0 | |||
Linux for x64 | 9.2 TS1M0 | |||
OpenVMS on HP Integrity | 9.2 TS1M0 | |||
Solaris for x64 | 9.2 TS1M0 |