Producing Maps with SAS Enterprise Guide

Download Report

Transcript Producing Maps with SAS Enterprise Guide

Producing Maps with SAS
Enterprise Guide
Harmon L. Jolley
Introduction
 SAS Enterprise Guide has a wizard
(Graph|Map) to plot data onto a map.
 SAS/GRAPH is a required product for
maps.
 SAS/GRAPH includes SAS datasets that
contain geographic data such as ZIP and
FIPS codes.
 An important variable for mapping is
_MAP_GEOMETRY_.
Time to Digress for a Trivia Question:
What does the acronym ZIP stand for
In ZIP Code?
Answer:
The Zone Improvement
Plan of the early 1960’s
defined 5-digit postal
codes to replace 1-digit
codes.
Example:
Chattanooga 9, Tenn.
became
Chattanooga, TN 37409
Mr. ZIP
We now rejoin
the presentation
that was in progress.
Step 1 – Prepare Data
 Identify appropriate map in the MAPS library.
 Select Data | Filter and Query from the SAS
EG drop-down menu bar.
 Select the analysis variable from your data.
 Select other variables of interest.
 Join your data to MAPS dataset(s).
 Filter the data to achieve result.
Step 1 – Example
In the following example, the Prepare Data
process flow was created by using Data |
Filter and Query.
The input datasets (USCITY, US2, and
CNTYNAME) are found in the standard
MAPS library of SAS/GRAPH.
The input datasets in the example provide
both the analysis variable (POP or
population) and the geocoding variable
_MAP_GEOMETRY_.
There are three SAS datasets joined, but no
Filter or Sorting.
Step 2 – Produce Map
 Select Map | Graph from the SAS EG
drop-down menu bar.
 Select the type of map.
 Assign the analysis variable to Column to
Chart.
 Review the Appearance and Title section,
and make changes as needed.
Step 2 – Example
In the next process flow of the example, a
United States map was produced to show
population levels by state.
Under Graph | Map, a 2d choropleth map was
selected.
The population is assigned to the role Column
to Chart, and the _MAP_GEOMETRY_
variable is assigned to map geometry.
Step 2 – Example
The following State View process flow allows
the user to select a state, then display a map
of that state’s data.
The selection function was constructed using
the Parameters of SAS EG.
Step 3 – Enhance Results
You can create a Code object, then edit to
add SAS/GRAPH code to add functions not
supported in the SAS EG map wizard.
Right-click on the Map object, then select Add
as Code Template.
Step 4 – Publish Results
SAS EG has many formats available in the
Export function.
PDF and HTML are good choices for maps.
Step 4 – Publish Results
SAS EG has many formats available in the
Export function.
PDF and HTML are good choices for maps.
Right-click on the Map object, then Properties | Results to set the Report Format.
Contact Information
Harmon Jolley
[email protected]