BookmarkSubscribeRSS Feed
zaldarsa
Obsidian | Level 7

Hi, 

I am using SAS 9.4 through my university's portal system, Apporto.  

8 REPLIES 8
zaldarsa
Obsidian | Level 7

Hello!

I would like to make a map of the world indicating where all the participants in my study were born. I stumbled upon the proc GMAP procedure, but I am a bit confused on how to use it. I tried the following code but it didn't work. The following error message appeared:  

PROC GMAP MAP=merged
DATA=merged;
ID W_d_country;
CHORO w_D_country;
RUN;

 

Thank you in advance for your help!

FalkoSchulz
SAS Employee

Hi, you posted this in the SAS Visual Analytics forum - can you quickly confirm what SAS environment you use? If you do use SAS Visual Analytics then creating geographical maps is just a matter of loading data in your environment and drag one of the geo objects (e.g. Geo Region) to the report canvas and assign roles. If you do use a programming environment - we may have to move this discussion to the appropriate forum.

Thank you! Falko

FalkoSchulz
SAS Employee

Thank you. I have moved your question to the Graphics Programming forum - I'm sure folks here can better help you with using PROC's in order to create geo maps.

FalkoSchulz
SAS Employee
Also - you mentioned - you have seen an error message using PROC GMAP but you did not include that in your original post. Can you share more details on what exactly didn't work?

Also wanted to share the official doc for proc gmap in case that is helpful https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grmapref/n1rfysveimrpeon1gw5c8grv4hgs.htm - there are plenty of additional examples to get started.

Falko
DanH_sas
SAS Super FREQ

I think you would find this easier to create using PROC SGMAP instead of PROC GMAP. To create your example, I would probably overlay a SCATTER plot on an OPENSTREETMAP. The code would look something like the following:

 

proc sgmap plotdata=birth;

openstreetmap;

scatter x=lat y=lomg;

run;

 

Hope this helps!

Dan

GraphGuy
Meteorite | Level 14

Do you want to plot markers on the exact lat/long where they were born, or do you want to color the countries where they were born?

 

Are there any other specific things you'd like to do in the map?

 

zaldarsa
Obsidian | Level 7

Hi!

I would like to color the countries of birth. I would like to make a map like this one, except without dots on the map.

https://www.ncbi.nlm.nih.gov/core/lw/2.0/html/tileshop_pmc/tileshop_pmc_inline.html?title=Click%20on...

 

GraphGuy
Meteorite | Level 14

Here's a similar example I created, using Proc Gmap:

http://robslink.com/SAS/democd99/visa_overstay.htm

 

And here is the SAS code (there are several different ways you can control the color, using numeric or character data):

https://robslink.com/SAS/democd99/visa_overstay.sas

 

world_map.png

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 737 views
  • 0 likes
  • 4 in conversation