Creating Geographic Rating Area Maps: How to Combine Counties, Split Counties, & use Zip Code Boundaries Rick Andrews Office of the Actuary Centers for.

Slides:



Advertisements
Similar presentations
Get Started with GIS Mapping Part 2 of 3 Madhu Lakshmanan.
Advertisements

Zhongmin Li and Geeta Mahendra
Using ODS Regions to Create Custom Reports Kate Morrow, M.S. Statistician Vermont Oxford Network, Burlington, VT.
FROM THE TESTING TRENCHES COMMON LOGIC LAPSES AND HOW TO AVOID THEM.
Territory Mapper Copyright 2010, TTG, Incorporated General Terminology This lesson introduces the user to a partial list of basic terminology that has.
Xanthippe Stevens and Larry Hoyle Policy Research Institute The University of Kansas Visualizing Census Data.
Lecture 16: Data input 1: Digitizing and Geocoding By Austin Troy University of Vermont Using GIS-- Introduction to GIS.
Fundamentals of GIS Materials by Austin Troy © 2008 Lecture 18: Data Input: Geocoding and Digitizing By Austin Troy University of Vermont NR 143.
Basic And Advanced SAS Programming
Lesson 13 Another MACRO Example MAP Plotting. Macro Example Goal of Macro named Summary: For a given dataset give summary statistics using PROC CONTENTS,
Using Proc Datasets for Efficiency Originally presented as a Coder’s NESUG2000 by Ken Friedman Reviewed by Karol Katz.
Let SAS Do the Coding for You! Robert Williams Business Info Analyst Sr. WellPoint Inc.
PROC_CODEBOOK: An Automated, General Purpose Codebook Generator
Data Cleaning 101 Ron Cody, Ed.D Robert Wood Johnson Medical School Piscataway, NJ.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
SAS® Maps as Tools to Display and Clarify Healthcare Outcomes Barbara B. Okerson, HMC, Richmond, VA.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
GIS 1 GIS Lecture 4 Geodatabases. GIS 2 Outline Administrative Data Example Data Tables Data Joins Common Datasets Spatial Joins ArcCatalog Geodatabases.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
Fundamentals of GIS Materials by Austin Troy © 2008 Lecture 18: Data Input: Geocoding and Digitizing By Austin Troy University of Vermont.
Creating Maps with SAS/GRAPH - Drill Downs, Pop-Ups, and Animation.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Tips & Tricks MASUG02/18/2005. Multiple Graphs on One Page.
Introduction to PROC GMap Presentation by Andrea Boan BMTRY 789.
Multiple Uses for a Simple SQL Procedure Rebecca Larsen University of South Florida.
Essential ODS PDF Patrick Thornton.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
SAS Mapping functionality to measure and present the Veracity of Location Data.
1 Using American FactFinder December 4, 2008 U.S. Census Bureau U.S Department of Commerce Washington, DC
01/20151 EPI 5344: Survival Analysis in Epidemiology SAS code and output February 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.
SAS Software Version 8 The Output Delivery System.
GIS 1 GIS Lecture 4 Geodatabases Copyright – Kristen S. Kurland, Carnegie Mellon University.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Statistical Graphics for the SAS System Computing for Research I 01/29/2014 Nathaniel L Baker.
Rigid Motion in a Plane Chapter 9 Section 1.
Effective SAS greplay’ing and how to avoid stretching By David Mottershead Senior Programmer, Quanticate.
MASUG September 15, Agenda  Guest Introductions  John Boling – SAS inSchool  Tim Garton – Health Forecasts  Announcements  Tips & Tricks 
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
An Introduction to Proc Transpose David P. Rosenfeld HR Consultant, Workforce Planning & Data Management City of Toronto.
SAS ® is a very powerful tool when producing Graphics. A single graphical data step can easily create a Kaplan Meier Plot, but there is no single graphical.
Chapter 6: Modifying and Combining Data Sets  The SET statement is a powerful statement in the DATA step DATA newdatasetname; SET olddatasetname;.. run;
Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat: ,lng: },
ODS TAGSETS - a Powerful Reporting Method Derek. 2 Agenda Understanding the tagset How to use tagsets Conclusion.
There’s a particular style to it… Rob Hatton
CMS SAS Users Group Conference Learn more about THE POWER TO KNOW ® October 17, 2011 PROC GMAP, HTML and You Thomas Kornfield, CMS.
Online Programming| Online Training| Real Time Projects | Certifications |Online Classes| Corporate Training |Jobs| CONTACT US: STANSYS SOFTWARE SOLUTIONS.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapter 26 By Tasha Chapman, Oregon Health Authority.
Where in the World are SAS/Graph® Maps? An Exploration of the Old and New SAS® Mapping Capacities Louise S. Hadden Abt Associates Inc. Cambridge, MA.
Behind the Scenes with SAS®: Using Customer Graphics in SAS® Output Louise Hadden Abt Associates Inc.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Geocoding Chapter 16 GISV431 &GEN405 Dr W Britz. Georeferencing, Transformations and Geocoding Georeferencing is the aligning of geographic data to a.
Geocoding Chapter 16 GISV431 &GEN405 Dr W Britz. Georeferencing, Transformations and Geocoding Georeferencing is the aligning of geographic data to a.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Android Online Training AcuteSoft: India: , Land Line: +91 (0) USA: , UK : +44.
Title page with medical image.
Using ODS Excel Migrating from DDE to ODS
Lesson 13 More SGPLOT examples MAP Plotting Questions.
Preliminaries: -- vector, raster, shapefiles, feature classes.
Creating and Editing Geographic Files
PROMPTS: TURN TO PAGE S.31 IN YOUR WORKBOOK
PROC DOC III: Self-generating Codebooks Using SAS®
Introduction to DATA Step Programming: SAS Basics II
Combining Data Sets in the DATA step.
Never Cut and Paste Again
Tips and Tricks for Using Macros to Automate SAS Reporting.
7.1 Rigid Motion in a Plane.
Hans Baumgartner Penn State University
Ungraded quiz Unit 7.
Presentation transcript:

Creating Geographic Rating Area Maps: How to Combine Counties, Split Counties, & use Zip Code Boundaries Rick Andrews Office of the Actuary Centers for Medicare and Medicaid Services Robert Allison Research and Development SAS Institute

Disclaimer The opinions of the speaker(s) are their own and may not reflect those of the Centers for Medicare and Medicaid Services. This lecture is presented "as is" without warranty of any kind, either expressed or implied. Recipients acknowledge and agree that the creator shall not be liable for any damages whatsoever arising out of the use of this material.

Geographic Rating Areas Affordable Care Act Rate Review Final Rule (45 CFR Part 147) Qualified Health Plans Permitted to impose higher rates in areas where medical costs are higher Three possible scenarios Metropolitan Statistical Areas (MSAs) plus 1 By County By first 3 digits of zip code

SAS® PROCS & DATA Procedures Data Sets GMAP GPLOT GREMOVE GPROJECT MAPIMPORT Data Sets MAPS.USCITY MAPS.COUNTY MAPS.USCOUNTY MAPS.CNTYNAME SASHELP.ZIPCODE

Obtain Rating Area Data Center for Consumer Information & Insurance Oversight (CCIIO) https://www.cms.gov/CCIIO Maryland Geographic Rating Areas Rating Area ID County Name 1 Baltimore City Baltimore County Harford County … some data not shown … 4 Washington County Carroll County Frederick County

Obtain FIPS Codes Federal Information Processing Standard (FIPS) MAPS.CNTYNAME contains county names proc sql; create table work.Rating_Area_FIPS as select T1.*, T2.state, T2.county from work.Rating_Areas as T1 left join MAPS.CNTYNAME as T2 on upcase(T1.County_Name)= T2.COUNTYNM where state = stfips('MD'); quit;

Create Map Data Set MAPS.COUNTY contains map coordinates (x,y) Be cautious of the output sequence using SQL Order of Map data is important proc sql; create table work.Temp_Map as select T1.*, T2.x, T2.y from work.Rating_Area_FIPS as T1 inner join MAPS.COUNTY as T2 on T1.state = T2.state and T1.county = T2.county; quit;

Remove County Boundaries Sort data by State and Rating Area GREMOVE combines unit areas By State and Rating Area ID statement removes county boundaries proc sort data= work.Temp_Map; by state Rating_Area; run;   proc gremove data= work.Temp_Map out= work.Gremove_Map; id county; run; 

Project Rating Area Map GPROJECT converts spherical coordinates into Cartesian (x,y) coordinates y x proc gproject data= work.Gremove_Map out= work.Rating_Area_Map dupok; id state Rating_Area; run;

Projected vs. Un-projected MAPS.USCOUNTY projected using all states MAPS.COUNTY is un-projected work.Rating_Area_Map projected using MD only proc gmap data= MAPS.USCOUNTY map= MAPS.USCOUNTY all; where state = stfips('MD'); id state county; choro county / woutline=1 nolegend; run; quit; proc gmap data= work.Rating_Area_Map map= work.Rating_Area_Map all; id state Rating_Area; choro Rating_Area / woutline=1 nolegend; run; quit;

Maryland Example First map uses MAPS.USCOUNTY Second map Projected using all states Second map Projected using only Maryland coordinates

Add Major Cities MAPS.USCITY coordinates for major cities data work.Major_Cities; set MAPS.USCITY ( drop= x y );   where state = stfips('MD') and city = 'Baltimore'; retain function 'label' style 'Albany AMT/bold' xsys '2' ysys '2' size 2 color 'black' when 'a'; text = city; * Text value = city name; position = '2'; * Above center of X,Y; * Convert degrees to radians *; x = atan(1)/45 * LONG; y = atan(1)/45 * LAT; Major_City = 1; * Flag for projection; OUTPUT; * Output record for city names; * Prepare city marker values; text='V'; style='marker'; position='5'; OUTPUT; * Output record for markers; run; MAPS.USCITY coordinates for major cities Annotate variables Convert degrees to radians Two OUTPUT statements

City Markers STYLE = 'MARKER' – SAS/GRAPH Font TEXT = 'V' – Star Image

Combine & Project Combine map data and major cities Project the combined data Separate map data and city data Major_City = 1 data work.Combined; set work.Gremove_Map work.Major_Cities; run;   proc gproject data= work.Combined out= work.Projected dupok; id state Rating_Area; data work.Rating_Area_Map set work.Projected; if Major_City = 1 then output work.Major_Cities; else output work.Rating_Area_Map;

New Map with City Set Labels and Cities tables together data work.Annotate_Data_Set; set work.Anno_for_Labels work.Major_Cities; run;   proc gmap data= work.Rating_Area_Map map= work.Rating_Area_Map anno= work.Annotate_Data_Set all; id state Rating_Area; choro Rating_Area / woutline=1 nolegend; quit;

Los Angeles (LA) LA uses first 3 digits of zip code Issue: Solution 1: Identifies East vs. West Issue: How to split county? Solution 1: Add triangle “marker”

Solution 2: Split County Annotate ZIP centroids using SASHELP.ZIPCODE %let ra15 = '906','907','908','910','911', '912','915','917','918','935';   %let ra16 = '900','902','903','904','905', '913','914','916','923','928','932'; data work.zipcodes; length function style color $8 position $1; retain xsys ysys '2' hsys '3' when 'a'; set SASHELP.ZIPCODE (rename=(x=LONG y=LAT)); where state = stfips('CA') and CountyNM = 'Los Angeles';

Annotate Zip Centroids if substr(put(zip,z05.),1,3) in (&ra15) then do; Rating_Area = '15'; color = 'red'; end;   if substr(put(zip,z05.),1,3) in (&ra16) then Rating_Area = '16'; color = 'black'; * Convert degrees to radians *; x = atan(1)/45 * LONG * -1; y = atan(1)/45 * LAT; * Create solid-filled pie; function='pie'; style='psolid'; position='5'; rotate=360; size=.2; anno_flag=1; run;

LA Zip Centroids Rating Area 16 Rating Area 15

Degrees to Radians 90o = π / 2 = 1.5707 radians 91o = atan(1) / 45 x 91 92o = constant('Pi') / 180 x 92 = 1.5707 radians = 1.5882 = 1.6057 π /2 /4 7π 3π 5π 0o/360o 45o 90o 135o 180o 225o 270o 315o

Plot Los Angeles County Project LA County Create Alt Text data work.LA_Unprojected; set MAPS.COUNTIES; where fipstate(state) = 'CA' and county = 37; LAT=y; LONG=x; run;   proc gproject data= work.LA_Unprojected out= work.LA_Projected; id state county; data work.LA_Projected; set work.LA_Projected; length My_Html $300; Original_Order = _N_; My_Html = 'title='|| quote('Original_Order: '|| trim(left(Original_Order))|| '0d'x|| 'x='||trim(left(LONG))|| 'y='||trim(left(LAT))|| ' in radians'); run;

Output Delivery System Create HTML Page Interpol = join Plot LAT * LONG Hreverse option ods html path='c:\mypath' body='mypage.html'; symbol1 value=circle interpol=join color=blue; proc gplot data=work.LA_Projected; plot LAT*LONG / hreverse html=myhtml name='mypage'; run;   ods html close;

Create New Coordinates Alt Text (4) Original start (1) Original end (168) 1st new record x=2.060 (LONG) y=0.595 (LAT) 2nd new record Upper bound (4) Lower bound (65) X X X X x=2.060 (LONG) y=0.595 (LAT)

Original Order of LA County Map Coordinates Old LA Coordinates Note original order 168 observations Original Order of LA County Map Coordinates Original Order State County LONG LAT 1 6 37 2.07362 0.60471 2 2.07508 0.60768 3 2.07489 4 2.06980 0.60770 … some data not shown … 165 2.07051 0.59810 166 2.07058 0.59850 167 2.07117 0.59972 168 2.07233 0.60208

Original Order of LA County Map Coordinates New LA Coordinates Note the six new records and new order Original Order of LA County Map Coordinates New Order Original Order Rating Area State County LONG LAT 1 n/a 15 6 37 2.06000 0.59500 2 2.06800 0.60000 3 4 2.06980 0.60770 … some data not shown … 64 65 2.06642 0.58880 16 66 67 170 168 2.07233 0.60208 171 2.07362 0.60471 172 2.07508 0.60768 173 2.07489 174 New New Copy New New Copy

New LA Plot SYMBOL statements PLOT = Rating_Area VALUE = circle & x COLOR = blue & red PLOT = Rating_Area symbol1 value=circle interpol=join color=blue; symbol2 value=x interpol=join color=red;   proc gplot data=work.New_LA; where segment = 1; plot LAT*LONG=Rating_Area / hreverse html=my_html name="&name"; run;

Result of County Split Rating Area 15 is not Centered Missing Rating Area Labels (1, 10, 13)

Modify Annotate Data Note the four OUTPUT statements data work.annotate_data_set_modified; set work.annotate_data_set;   * Move label for rating area 15; if Rating_Area='15' then do; x = x + 0.001; *<-- Offset; y = y + 0.012; end; output; *<-- Output original annotation records; * Add labels for non-contiguous areas; if Rating_Area='1' then do; x=-0.015; y= 0.016; output; end; if Rating_Area='10' then do; x= 0.005; y=-0.017; output; end; if Rating_Area='13' then do; x= 0.055; y=-0.072; output; end; run;

Rating Areas by Zip Code Three states use zip codes Alaska, Massachusetts, and Nebraska ZIP code tabulation area (ZCTA) U.S. Census Bureau ESRI® shapefile format (.shp) “Creating ZIP Code-Level Maps with SAS®” SAS Global Forum 2013 (Okerson, Barbara)

Import ZCTA Files MAPIMPORT Identify Rating Areas proc mapimport datafile='tl_2010_25_zcta510.shp' out= work.ZCTA_MA; id ZCTA5CE10; rename ZCTA5CE10 = ZipCode; run;   proc format; value $areas '010','011','012','013' = '1' '014','015','016' = '2' '017','020' = '3' '018','019' = '4' '021','022','024' = '5' '023','027' = '6' '025','026' = '7' other = 'Missing'; data work.ZCTA_MA_Modified; length Rating_Area $2; set work.ZCTA_MA; Rating_Area = put(substr(ZipCode,1,3),$areas.); run;   proc gremove data= work.ZCTA_MA_Modified out= work.ZCTA_Remove; by Rating_Area; id ZipCode; ... some code not shown ...

Project ZCTA Map GPROJECT Note EASTLONG &DEGREES data= work.combined proc gproject data= work.combined out= work.projected_map dupok eastlong degrees; id Rating_Area; run;   proc gmap data= work.projected_map map= work.projected_map anno= work.annotate_data_set all; choro Rating_Area / nolegend; quit;

Combine Map Files APPEND Project New Map libname geo_data '.';   %macro by_state ( state ); ... some code not shown ... proc append data=work.Combined out= geo_data.Geo_Rating_Area_Map force; where Major_City ne 1; run; %mend by_state; %by_state ( AK ); %by_state ( AL ); proc gproject data=geo_data.Geo_rating_area_map out=work.Geo_rating_area_map dupok; where state ne stfips('AK') and state ne stfips('HI'); id state Rating_Area; run; proc gmap data= work.Geo_rating_area_map map= work.Geo_rating_area_map all; choro Rating_Area / discrete nolegend; quit;  

Final U.S. Map

Contact Information Rick Andrews Office of the Actuary Centers for Medicare and Medicaid Services 7500 Security Boulevard Baltimore, MD 21244 Phone: (410) 786-6395 E-mail: Richard.Andrews@cms.hhs.gov Robert Allison Research and Development SAS Institute Incorporated 100 SAS Campus Drive Cary, NC 27513 Phone: (919) 677-8000 E-mail: Robert.Allison@sas.com