The GREDUCE Procedure

# Using the GREDUCE Procedure

• the maximum number of observations for each DENSITY level

• the minimum distance that an intermediate point must lie from a line between two end points to be included in the level.

If you do not explicitly specify criteria, the procedure computes and uses default values.

Points in Data Set before Reduction illustrates how to use the minimum distance parameter to determine which points belong in a particular density level. At density level n, only point C lies at a distance greater than the En= value (70) from a line between points A and B. Thus, after reduction only point C remains between points A and B at density level n, and the resulting reduced boundary is shown in Points in Data Set at Density n after Reduction. See Douglas and Peucker (1973) for details of the algorithm used.

If this distance function is not suitable for the coordinate system in your input map data set, transform the X and Y values to an appropriate coordinate system before using GREDUCE. An example of inappropriate coordinates is latitude and longitude values around one of the poles. In this case, the data values should be projected before they are reduced. See The GPROJECT Procedure for more information on map projection.

If you specify both Nn= and En= values for a density level, GREDUCE attempts to satisfy both criteria. However, the number of points for any level is never reduced below the number of points in density level 0. If you specify a combination of Nn= or En= values such that the resulting DENSITY values are not in order of increasing density, a note is printed in the SAS log, and the DENSITY values are calculated in increasing order of density.

```data smallmap;
set map;
if density <= 2;
run;```
```proc gmap map=map(where=(density<=2))
data=response;```

Note:   GREDUCE does not reduce the size of the output map data set compared to the input map data set. By default, the output map data set from PROC GREDUCE will be larger than the input map data set because it contains all of the variables and observations from the original data set, with the addition of the DENSITY variable if it was not present in the original data set. If the input map data set already had a DENSITY variable, the output map data set will be the same size as the input map data set.