Download presentation
Presentation is loading. Please wait.
Published byChristine Leslie Parrish Modified over 9 years ago
1
Introduction to PROC GMap Presentation by Andrea Boan BMTRY 789
2
Map of US with LA and NYC Too Skinny Too Fat
3
Proc GMap Produces two basic kinds of maps: Two-dimensional – choropleth maps Three-dimensional - block, prism, and surface Use to create color maps to show variations value with respect to an area SAS/GRAPH software – provides an extensive assortment of map data sets and codes Use the GMAP procedure to: Produce maps Summarize data by physical area Show geographical trends and variations Emphasize regional differences
4
Four Basic Types of Maps Block Map Prism Map Surface Map
5
Forth Type of Map (we will learn to make today) Two-dimensional Choropleth Maps
6
Finding Proc GMap in SAS Help Doc 1. SAS Help and Documentation 2. SAS Products 3. SAS/Graphs 4. SAS/Graphs Reference 5. SAS/Graphs Procedures 6. The GMap Procedure This will provide basic information and basic examples along with formatting options
7
Getting SAS Data for Maps Go to the Official SAS Website and register an account: http://www.sas.com/apps/userid/login.jsphttp://www.sas.com/apps/userid/login.jsp = MyProfile http://www.sas.com/apps/userid/login.jsp The go to: Download Software SAS/GRAPH Software Maps Online Version 6.12 Maps – Top Left Side Panel Scroll down to desired country For This example select the last US data available Select Data or Code Click Request Download Click Accept on terms and conditions
8
You Should see something that looks like this screen DescriptionFile Name Releas e Date Size GIF image, SAS Code, DATA set uscounty.z ip Oct 2002 450K B Click Download Save to a File
9
CIMPORT Procedure libname maps "C:\Data"; ***************************************************************\ | Copyright (C) 2002 by SAS Institute Inc., Cary, NC, USA. | | | | SAS (R) is a registered trademark of SAS Institute Inc. | | | | SAS Institute does not assume responsibility for the accuracy of | | any material presented in this file. | \***************************************************************/ /* Using the CIMPORT procedure to import SAS tables */ /*************************************************************** ***** * Since the transport files are created by PROC CPORT, you need to * * Since the transport files are created by PROC CPORT, you need to * * use PROC CIMPORT to process the transport file. You can import * * files to a release SAME as or HIGHER than the release used to * * create the transport file. * ************************************************************ ********/ ************************************************************ ********/ /*************************************************************** ***** * Example 1: * * Example 1: * * PROC CIMPORT uses the file given in the INFILE= option as input * * PROC CIMPORT uses the file given in the INFILE= option as input * * and writes/unpacks/copies all data sets found in the transport * * and writes/unpacks/copies all data sets found in the transport * * file to the directory referenced by the libref SASFILES. * * file to the directory referenced by the libref SASFILES. * ************************************************************ ********/ ************************************************************ ********/ After downloading and unzipping SAS tables you must take them out of transport format by running the CIMPORT procedure Change Libname to =Maps libname sasfiles 'c:\myfiles'; proc cimport infile='C:\Data\uscounty.cpt' library=maps; proc cimport infile='C:\Data\uscounty.cpt' library=maps; run; run;
10
SAS GMap Data Sets Data Set we are using: USCounty – raw plotting data Cntyname – just county name variable Proc GProject = processes traditional map data sets by converting spherical coordinates (longitude and latitude) into Cartesian coordinates for use by the GMAP procedure Choro = tells SAS which type of map to make – a Two-dimensional Map Choro = tells SAS which type of map to make – a Two-dimensional Choropleth Map
11
PROC GMap Code 1.Rename Data to get SC only from maps.Cntyname 2.To get county names 3.SC = State = 45 4.Rename Data to get SC data from maps.uscounty 5.SC = State = 45 6.Proc Gproject – map is inverted in SAS so have to project it. 7.Out = scmap by county 8.Proc GMap – gives Cholopleth map of SC colored by county 9.Choro by countynm
13
Questions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.