Examples


The following example illustrates major features of the GREDUCE procedure. Because the example uses one of the map data sets that are supplied with SAS/GRAPH , you may need to replace SAS-data-library in the LIBNAME statement with the actual location of the SAS data library that contains the Institute-supplied map data sets on your system. Contact your SAS Software Consultant for the location of the map data sets at your site. If your site automatically assigns the libref MAPS to the SAS data library that contains the Institute-supplied map data sets, delete the LIBNAME statement in this example.

Example 1: Reducing the Map of Canada

Procedure features:

  • ID statement

Other features:

  • PROC GMAP option:

    • WHERE=

Sample library member: GRDCANAD

click to expand

In this example, the GREDUCE procedure creates the DENSITY variable for the CANADA2 map data set that is provided with SAS/GRAPH . First, the map is displayed at its original density by using the GMAP procedure. Second, the map is displayed by using density values of 0 to 2.

click to expand

Assign the libref and set the graphics environment.

 libname maps '  SAS-data-library  ';  goptions reset=global gunit=pct border cback=white           colors=(black blue green red)           ftext=swiss htitle=6 htext=3; 

Define titles and footnotes for the first map.

 title1 'Canada';  title2 h=4 'Using all DENSITY values';  footnote1 j=l '  From  SAS/GRAPH  ' '02'x            ' Software CANADA2 Data Set';  footnote2 j=r 'GRDCANAD(a) '; 

Define pattern characteristics.

 pattern value=mempty repeat=12 color=blue; 

Show the unreduced map. The ID statement specifies the variable in the map data set that defines unit areas.

 proc gmap map=maps.canada2 data=maps.canada2 all;    id province;    choro province / nolegend;  run; 

The GREDUCE procedure creates a new map data set, CAN2, containing a DENSITY variable. The ID statement specifies the variable in the map data set that defines unit areas.

 proc greduce data=maps.canada2 out=can2;     id province;  run; 

Define title and footnote for the second map.

 title2 h=4 'Using only DENSITY values 0 to 2';  footnote2 j=r 'GRDCANAD(b) '; 

Show reduced map with density levels 0-2. WHERE= selects map coordinates with the appropriate DENSITY values.

 proc gmap map=can2(where=(density<3))            data=can2 all;     id province;     choro province / nolegend;  run;  quit; 



SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net