Hello SAS community, might someone please help me with creating a map graph for a country besides USA?
So I was going through the example in http://support.sas.com/kb/44/428.html, in which a map of both USA and Mexico is generated. I attempted to modify the code so that it would only contain Mexico, but it was unsuccessful. For example, consider a data:
data have;
input state $ income @@;
datalines;
Aguascalientes 100
BajaCalifornia 99
BajaCaliforniaSur 98
Campeche 55
Chiapas 60
Chihuahua 77
Coahuila 51
Colima 66
Durango 78
Guanajuato 66
Guerrero 74
Hidalgo 85
Jalisco 63
México 101
MexicoCity 105
Michoacán 95
Morelos 43
Nayarit 67
NuevoLeón 84
Oaxaca 63
Puebla 53
Querétaro 78
QuintanaRoo 77
SanLuisPotosí 69
Sinaloa 68
Sonora 48
Tabasco 59
Tamaulipas 68
Tlaxcala 77
Veracruz 95
Yucatán 64
Zacatecas 88
;
run;
data have;
set have;
if income <= 70 then incomelevel='low';
else if 70<income<=90 then incomelevel='average';
else if income>90 then incomelevel='high';
run;
I would like to compute just a simple map graph of Mexico, and color the states by incomelevel variable. My attempt:
/* Create a map data set for Mexico */
data mexico(rename=(long=x lat=y));
set maps.mexico(drop=x y);
run;
/* Project the map data */
proc gproject data=mexico out=mexico_graph;
id id state;
run;
quit;
/* Generate the graph */
title 'Map of Mexico';
proc gmap data=have map=mexico_graph;
id id state;
choro incomelevel/ discrete coutline=graybb;
run;
quit;
Something is just wrong. May I please have some assistance or advice from your expertise? Thank you in advance!