SAS Mapping: Technologies, Techniques, Tips and Tricks Darrell Massengill



Similar documents
SAS Mapping: Technologies, Techniques, Tips and Tricks

Tips and Tricks: Using SAS/GRAPH Effectively A. Darrell Massengill, SAS Institute, Cary, NC

Doing More with SAS/GRAPH GMAP: A New Look at an Old Procedure Barbara B. Okerson, Virginia Health Quality Center, Glen Allen, VA

Beginning Tutorials. BT005 MAPS MADE EASY USING SAS Mike Zdeb, School of Public Health

Sales Territory and Target Visualization with SAS. Yu(Daniel) Wang, Experis

Creating Maps with SAS/GRAPH - Drill Downs, Pop-Ups, and Animation Mike Zdeb, University@Albany School of Public Health, Rensselaer, NY

SAS/GIS 9.4: Spatial Data and Procedure Guide

Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

The Basics of Creating Graphs with SAS/GRAPH Software Jeff Cartier, SAS Institute Inc., Cary, NC

Pavement Management System Overview

Tips & Tricks for ArcGIS. Presented by: Jim Mallard, Crime Analysis Supervisor Arlington, Texas IACA Conference Pasadena, Ca

Scatter Chart. Segmented Bar Chart. Overlay Chart

INTRODUCTION to ESRI ARCGIS For Visualization, CPSC 178

Let SAS Write Your SAS/GRAPH Programs for You Max Cherny, GlaxoSmithKline, Collegeville, PA

Data Visualization. Prepared by Francisco Olivera, Ph.D., Srikanth Koka Department of Civil Engineering Texas A&M University February 2004

Visualizing Key Performance Indicators using the GKPI Procedure Brian Varney, COMSYS, a Manpower Company, Portage, MI

Creating Web and Mobile Maps Using ArcGIS Online. SCO Technical Paper

SAS ODS. Greg Jenkins

ESRI China (Hong Kong) Limited

Using SAS to Create Graphs with Pop-up Functions Shiqun (Stan) Li, Minimax Information Services, NJ Wei Zhou, Lilly USA LLC, IN

GIS III: GIS Analysis Module 2a: Introduction to Network Analyst

Quick and Easy Web Maps with Google Fusion Tables. SCO Technical Paper

GIS I Business Exr02 (av 9-10) - Expand Market Share (v3b, Jul 2013)

SAS/GRAPH 9.2 ODS Graphics Editor. User s Guide

ArcGIS Tutorial: Adding Attribute Data

GIS Tutorial 1. Lecture 2 Map design

Kodiak Island Borough GIS Online Tools

University of Arkansas Libraries ArcGIS Desktop Tutorial. Section 2: Manipulating Display Parameters in ArcMap. Symbolizing Features and Rasters:

TABLEAU COURSE CONTENT. Presented By 3S Business Corporation Inc Call us at : Mail us at : info@3sbc.com

Syllabus AGET 782. GIS for Agricultural and Natural Resources Management

Tutorial 3: Working with Tables Joining Multiple Databases in ArcGIS

SAS Visual Analytics dashboard for pollution analysis

Providing the Public with Data Visualization using Google Maps

GeoLytics. User Guide for Business Demographics & Historical Business Demographics

Modifying Colors and Symbols in ArcMap

R Graphics Cookbook. Chang O'REILLY. Winston. Tokyo. Beijing Cambridge. Farnham Koln Sebastopol

Geocoding and Buffering Addresses in ArcGIS

University of Arkansas Libraries ArcGIS Desktop Tutorial. Section 4: Preparing Data for Analysis

Making a Choropleth map with Google Fusion Tables

Map Navigation Controls. An Interactive, Locally Based Knowledge Resource LivingstonLive.org/maps OR gisapps/livingstonviewerinternal

GEOGRAPHIC INFORMATION SYSTEMS CERTIFICATION

Using CAD Data in ArcGIS

Getting Started With Mortgage MarketSmart

CentralMass DataCommon

The Courses. Covering complete breadth of GIS technology from ESRI including ArcGIS, ArcGIS Server and ArcGIS Engine.

Harvard Data Visualization Project

GEOGRAPHIC INFORMATION SYSTEMS

Tutorial 5: Summarizing Tabular Data Florida Case Study

Storytelling with Maps: Workflows and Best Practices

Adobe Acrobat 6.0 Professional

MetroBoston DataCommon Training

Training/Internship Brochure Advanced Clinical SAS Programming Full Time 6 months Program

Getting Started with the ArcGIS Predictive Analysis Add-In

Introduction to GIS Using ArcGIS Desktop 10

From The Little SAS Book, Fifth Edition. Full book available for purchase here.

Maplex Tutorial. Copyright Esri All rights reserved.

Spotfire v6 New Features. TIBCO Spotfire Delta Training Jumpstart

ArcGIS Server mashups

Tutorial 4 - Attribute data in ArcGIS

Data Visualization. Brief Overview of ArcMap

Introduction to Google Earth May 24, TJ Keiran Senior Planner / GIS Specialist Cowlitz-Wahkiakum Council of Governments

Microsoft Excel 2010 Pivot Tables

WEB MAPPING TOOL DOCUMENTATION

Introduction to GIS.

Realist A Quick Start Guide for New Users

Creating Figure Ground Maps in ArcMap 10.x: Basic procedures to download, open, manipulate and print spatial data

Tips and Tricks for Creating Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS. Vincent DelGobbo, SAS Institute Inc.

About PivotTable reports

ArcGIS ArcMap: Printing, Exporting, and ArcPress

From GPS Data Collection to GIS Data Display A Walk-Through Example

STEP 2: UNIX FILESYSTEMS AND SECURITY

Reporting with Pentaho. Gabriele Pozzani

Software: AutoCAD Civil 3D 2014, NRCS C3D 2014 template, ESRI ArcMap. Notation:Button to Press Displayed Text Icon Action {Text to Enter} Menu Item

QGIS LAB SERIES GST 102: Spatial Analysis Lab 6: Vector Data Analysis - Network Analysis

More Than a Map: Location Intelligence with SAS Visual Analytics Falko Schulz and Anand Chitale, SAS Institute Inc., Cary, NC

Which Reporting Tool Should I Use for EPM? Glenn Schwartzberg InterRel Consulting info@interrel.com

Using Map Views and Spatial Analytics in OBI 11g. BIWA Summit 2014

Microsoft Power Point 2007: The Basics

Activity: Using ArcGIS Explorer

Quick Start to Data Analysis with SAS Table of Contents. Chapter 1 Introduction 1. Chapter 2 SAS Programming Concepts 7

Creating and Manipulating Spatial Weights

Introduction to GIS software

Scientific Graphing in Excel 2010

GEOGRAPHIC INFORMATION SYSTEMS

6 th Annual EclipseCon Introduction to BIRT Report Development. John Ward

Realist 2.0 MLS Support (512) Monday thru Friday 9:00 am 5:00 pm

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Instagram Post Data Analysis

Transcription:

SAS Mapping: Technologies, Techniques, Tips and Tricks Darrell Massengill Every organization has location based data. The difficulty is in choosing the right technology and tool to effectively transform that data into useful information or intelligence. The Business Intelligence component of the SAS Intelligence Value Chain contains 3 powerful mapping technologies that can be used to transform your data: SAS Bridge for ESRI, SAS/GIS and SAS/GRAPH mapping. This handout should make you aware of these technologies and provide you with the resources to help you further understand and explore them. SAS Bridge for ESRI The SAS Bridge for ESRI adds the powerful analytic and business intelligence capabilities of SAS to the ESRI ArcGIS geographic information system. This product allows users to combine the full power of ArcGIS with the power of SAS by providing the following functionality: Read SAS Datasets Export SAS Datasets View Metadata for SAS Datasets Run SAS Programs (Stored Processes). 1

Resources for further information: Product information and help files: http://www.sas.com/products/bridgeforesri/index.html http://support.sas.com/rnd/datavisualization/bridgeforesri/v1/ Conference resources: Demo area. SAS/GIS SAS/GIS software provides an interactive Geographic Information System (GIS) within the SAS System. SAS/GIS software provides a variety of tools, features, and capabilities that are specific to the business geographics market and can be used to build powerful decision support systems, including: 2

direct link to the full breadth of SAS System software thematic mapping (color-coding) tools multi-layer maps to display streets, ZIP code boundaries, census boundaries, landmarks, or any other point, line or area layer geocoding (address matching) down to street level locations map customization tools, including labels, legends, symbols and more map importing tools supporting a variety of data sources map printing tools and support for a wide variety of graphical output formats Much of the functionality available interactively through the graphical user interface can also be accessed in batch with the GIS Procedure. PROC GIS also uses the SAS Output Delivery System (ODS) to generate html pages containing clickable gif images of maps created with SAS/GIS. Resources for further information: Product Information, web examples, FAQs: http://www.sas.com/products/gis/index.html http://support.sas.com/download http://support.sas.com Look for SAS/GIS in the SAS Online Help. Conference resources: Demo Area. SAS/GRAPH Mapping The SAS/Graph mapping functionality allows you to create choropleth, prism, block and surface maps. This includes the GMAP, GREMOVE, GREDUCE, GPROJECT and MAPIMPORT procedures. Three key techniques are highlighted to deliver powerful SAS/GRAPH maps: Map Data, Annotate and the Output Delivery System (ODS). Twelve map examples will be examined that uses these techniques. Map Data As you will see in the examples, having the right map data is the key to transforming your data into useful information. The following items will aid you in creating and manipulating your map data. 3

Proc Mapimport. This proc allows you to import ESRI Shapefile data into a SAS Map dataset. Syntax: PROC MAPIMPORT OUT= traditional-map-data-set DATAFILE= 'path-to-shapefile' <CONTENTS> <CREATE_ID_>; <SELECT <'>field-identifier-1<'><...<'>field-identifier-n<'>>>; <EXCLUDE <'>field-identifier-1<'><...<'>field-identifier-n<'>>>; <RENAME <'>field-identifier-1<'>=sas-variable-name-1<... <'>field-identifier-n<'>=sas-variable-name-n>>; PROC MAPIMPORT OUT=sasuser.newmap DATAFILE= e:\nc.shp ; run; See the SAS 9.0 Online Help for additional information. Maps OnLine website SAS Maps Online shows maps for various regions throughout the world. These maps make it easy to locate and identify world regions by each of the following categories: world maps, continents, countries, and maps of political groups. This site continues to evolve and grow, so check it periodically for changes. See http://www.sas.com/mapsonline Procs GREDUCE, GREMOVE, and GPROJECT. These PROCs are for reducing the number of points, removing shared line segments and projecting spherical coordinates into Cartesian coordinates for your map data. See SAS Online Help for additional information. Annotate The Annotate facility enables you to generate a special dataset of graphics commands from which you can create graphics output. The annotate output can be combined with PROC GMAP output to create custom maps that reflect your needs. The annotate facility is documented in the SAS/Graph documentation. You can either create your data manually or use the annotate macros to aid in the creation and manipulation of your data. Two new macros were added in SAS 9.0 and are available for users to download with earlier versions: 4

CENTROID For a map, it creates a new dataset with the centroid of each polygon. %CENTROID (input-data-set, output-data-set, list-of-id-variables); input-data-set - specifies a map data set. output-data-set - contains the id variables and the X and Y variables. list-of-id-variables - specifies the variables each of which is to be assigned the centroid coordinates of each observation in the input-data-set. There will be one observation for each unique set of ID values MAPLABEL Creates a new annotate dataset with a label at the centroid. %MAPLABEL(map-dataset, attr-dataset, output-dataset, label-var, id-list, font=font_name, color=n, size=n, hsys=n); map-dataset - the name of the map to be annotated. attr-dataset - the name of the dataset containing the text to be shown on each ID value. output-dataset - the name of the annotate data set created by the macro. label-var - the name of the label variable to place on the map (the text for annotate). id-list - the list of ID vars that you would issue in PROC GMAP to create the map. These values need to be on both the map and the attribute data sets. If you also supply the SEGMENT variable, then every polygon will get a value. Without the SEGMENT variable, only one label per ID set will be shown over the collection of polygons. For instance, Hawaii with SEGMENT gets a label on each island, whereas without SEGMENT, there is only one label centered on the entire set of islands. font - specifies a font name for the STYLE Variable (Fonts) variable. color - specifies a value for the COLOR Variable variable. size - specifies a value for the SIZE Variable variable. Defaults to 2. hsys - specifies a value for the HSYS Variable variable. Defaults to 3. These are available for download at: http://ftp.sas.com/techsup/download/public/graph See SAS Online Help for additional information on Annotate. Output Delivery System (ODS) The Output Delivery System gives you greater flexibility in generating SAS/GRAPH output with a wide range of formatting options. This handout will focus on some very basic features to give you a feel for what is possible with ODS. We will focus on basic ODS HTML statements, graphics styles and graphics output devices. 5

Basic ODS Syntax: Statements used in the examples: GOPTIONS DEVICE=gif; /*specify the device to use*/ ODS LISTING CLOSE; /*Close in case of back to back programs*/ ODS HTML PATH= c:\mydir /*Directory path for the output file*/ BODY= graph.html /*HTML file being created */ STYLE=banker; /*Use the BANKER graph style*/ PROC GMAP statements ODS HTML CLOSE; /*Close the output files*/ ODS LISTING; See the SAS Online Help for complete details on ODS. Devices Different devices can impact the look of your maps. We will focus on 6 devices: GIF, METAJAVA, JAVA, JAVAIMG, ACTIVEX, ACTXIMG. GIF and Metajava produce output that looks like the default output in SAS. The remaining devices produce newer style output and have some newer features available. Styles are an example of a feature that is only available on the client devices. JAVA and ACTIVEX create interactive graphs that run the Java applet or ActiveX control to view the graph. JAVAIMG and ACTXIMG create a static image of the graph through JAVA or ACTIVEX and can also be used with ODS RTF and ODS PDF output. Styles Graphics styles are only available on the newer devices. A style combines map colors, background colors, images and fonts into a package along a particular theme and provides a consistent look for your entire ODS output. There are currently 16 styles: Analysis Astronomy Banker Blockprint Curve Education Electronics Gears Magnify Money RSVP Science Sketch Statistical Torn Watercolor Resources for additional information: http://www.sas.com/technologies/bi/visualization/index.html - product information http://support.sas.com/usergroups/sugi/proceedings/index.html - SUGI Proceedings. http://support.sas.com/download - download examples http://www.sas.com/mapsonline MapsOnLine website. http://support.sas.com - Support web site (FAQs, Examples, more) http://support.sas.com/techsup/ftp/download.html http://ftp.sas.com/techsup/download/public/graph - New annotate Macros. http://support.sas.com/techsup/ftp/download.html - Tech Support examples. 6

See SAS Online Help. Download Examples in this presentation: ftp://ftp.sas.com/pub/sugi28/sasmapping_src.zip Conference Resources: Demo area. Example maps We will examine 2 sets of example maps. The first group will demonstrate new ways to think about and develop standard geographic maps and will demonstrate the features previously covered. The second group will help you think about location based data in a new way and will demonstrate some non-geographic maps. The programs are available for download from: ftp://ftp.sas.com/pub/sugi28/sasmapping_src.zip Geographic maps. Macro Demonstrates how to us the new centroid and maplabel macros. Styles Illustrates the use of several different ODS Graph styles. 7

Mapimport Demonstrates the use of Proc MAPIMPORT to read 2 shapefile datasets and create a map dataset and annotate dataset. This program: 1) Imports 2 shapefiles and creates 2 datasets: NC zipcode dataset and NC highways dataset. 2) Processes the Highway dataset into an annotate dataset with only Interstates. 3) Reduces the density of the map data with GREDUCE. 4) Displays a map with Customers per zipcode area and Interstates annotated on the map. Multiplebar Demonstrates how to create multiple bars on a state and label the bars. This program: 1) Reads the uscities database and extracts the 3 Florida cities that we are interested in. It then creates a tiny triangle at the location of each city. 2) Extracts Florida from the US map. The map of triangles is then merged in. This makes each city a tiny state within the state. 3) Gets the response data (Tons Shipped) for the cities. 4) Creates an annotate dataset for the labels using coordinate system 3. Note that the label location will vary between different devices with this coordinate system. 5) Displays the block map of Florida and annotated labels. 8

USDivisions Demonstrates how to modify the map data to divide the map into regions. This Program: 1) Creates a new map dataset that assigns states to divisions and divisions to regions. 2) Modifys the map data by creating a gap between regions by offsetting the data and moving Alaska and Hawaii. 3) Creates Mouse over/drill down. 4) Creates Annotate data for labeling states, divisions and regions. 5) Creates annotate data for legend. 6) Creates annotate data for darker division lines. 7) Combines all annotate data. 8) Displays map. 9) Creates Drill down tables. Weathermap Demonstrates how to create a weathermap looking map. This program: 1) Reads county response data and adds chart tips and drill down. 2) Reads the US Counties map and a) Removes all county boundries and b) Creates an annotate dataset with the State boundries. 3) Displays the map and adds the annotated state boundries. 9

Sizeddots Demonstrates how to use annotate to create multiple size and color markers to represent your data. This program: 1) Extracts the zipcode data from your response data. 2) Creates a dataset of unique zipcodes with a count people at that zipcode. 3) Adds the X/Y coordinates of each City in the zipcode (using sashelp.zipcode). 4) Creates an annotate dataset of dots of different sizes and colors based on count. 5) Sorts smaller dots on top. 6) Reduces the map size with GREDUCE. 7) Removes Alaska and Hawaii. 8) Creates a fake legend. 9) Displays the map and annotated dots. TwoValues Illustrates how to represent 2 values on a map with the choro color and markers. This program will only work with Java, javaimg, activex and actximg devices. This program: 1) Reads the response data (Census data). 2) Merges county names into the response data. 3) Displays a block map using block= and area=. Proc gmap ; block pop00 / shape=cylinder area=pctchg ; 10

Non-Geographic maps: Thinking outside the country. Not all location data is located in a state or country map. You could be dealing with the location inside a building, the location of a part on a piece of equipment, or other similar locations. Weave This illustrates how the location might be the location of yarn in a weave in a piece of fabric. You might be concerned with quality control issues such as the thickness of the yarn. You don t want it too thick or too thin. Wafer The location of failure rates on a semiconductor wafer is another example of non-geographic location data. Wafer3D You may also want to examine your Wafer failure rates interactively and in 3D by using java or ActiveX. 11

Calendar In this example, your location data is the placement in the calendar. Summary of Resources: Presentation handout: ftp://ftp.sas.com/pub/sugi28/sasmapping_notes.zip SAS Bridge for ESRI Product information and help files: http://www.sas.com/products/bridgeforesri/index.html http://support.sas.com/rnd/datavisualization/bridgeforesri/v1/ Conference resources: Demo Area. SAS/GIS Product Information, web examples, FAQs: http://www.sas.com/products/gis/index.html http://support.sas.com/download http://support.sas.com Look for SAS/GIS in the SAS Online Help. Conference resources: Demo Area. 12

SAS/GRAPH Mapping Product information, downloads, FAQs: http://www.sas.com/technologies/bi/visualization/index.html - product information http://support.sas.com/usergroups/sugi/proceedings/index.html - SUGI Proceedings. http://support.sas.com/download - download examples http://www.sas.com/mapsonline MapsOnLine website. http://support.sas.com - Support web site (FAQs, Examples, more) http://support.sas.com/techsup/ftp/download.html http://ftp.sas.com/techsup/download/public/graph - New annotate Macros. http://support.sas.com/techsup/ftp/download.html - Tech Support examples. See SAS Online Help. Download Examples in this presentation: ftp://ftp.sas.com/pub/sugi28/sasmapping_src.zip Conference Resources: Demo area. Suggestions and comments to: mapping@sas.com Tech Support suggestions to: Suggestion@sas.com 13