BookmarkSubscribeRSS Feed
juliajulia
Obsidian | Level 7

hello,

 

I have an analysis result that I want to display it on the map. The result include 9 US regions and their VL suppression rate categorized by two groups: durable suppressed and never suppressed. the dataset looks like this:

US Region  Durable   Never

1                   84          23

2                   79          56

3                   67          23

........

I am new to the SAS proc gmap and I am not sure how to write a sas code to display those numbers on the map. I am thinking to either create two maps or one map to display these results.

anybody can help me. thanks.

2 REPLIES 2
ballardw
Super User

@juliajulia wrote:

hello,

 

I have an analysis result that I want to display it on the map. The result include 9 US regions and their VL suppression rate categorized by two groups: durable suppressed and never suppressed. the dataset looks like this:

US Region  Durable   Never

1                   84          23

2                   79          56

3                   67          23

........

I am new to the SAS proc gmap and I am not sure how to write a sas code to display those numbers on the map. I am thinking to either create two maps or one map to display these results.

anybody can help me. thanks.


Do you have a map set of the regions? That would be the first thing. You would want to have a variable in the map data that matches your example data with the region identification values.

 

Do you want to display different colors or patterns for the region based on the value of a variable?

You have two variables neither named "VL suppression rate". Which value is the "rate". Or do you want to display both numbers in the region?

 

With proc gmap the approach is to create an Annotate data set which would have the text value you want to display, the x,y coordinates and a function call to say "display text". There are a set of SAS supplied macros to help with that.

There is an example in the GMAP documentation. You would use:

 

%annomac; to make the macros ready to use and then call

%maplabel. to create the annotate data set.

The syntax for %MAPLABEL (map-dataset, attr-dataset,output-dataset,label-var,id-list,font=font_name,color=n,
size=n,hsys=n);

 

You would reference the output-dataset created with the macro as an annotate= dataset on either the specific plot type requested (Choro Block Prism Surface) or on the Proc Gmap statement. (You can have two or more annotate sets for some purposes if requesting more than one plot).

Reeza
Super User

You probably want to use the newer SGMAPs if you have the appropriate version and license. 

https://blogs.sas.com/content/graphicallyspeaking/2017/12/14/sgmap-now-in-base-sas/

 


@juliajulia wrote:

hello,

 

I have an analysis result that I want to display it on the map. The result include 9 US regions and their VL suppression rate categorized by two groups: durable suppressed and never suppressed. the dataset looks like this:

US Region  Durable   Never

1                   84          23

2                   79          56

3                   67          23

........

I am new to the SAS proc gmap and I am not sure how to write a sas code to display those numbers on the map. I am thinking to either create two maps or one map to display these results.

anybody can help me. thanks.


 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 403 views
  • 0 likes
  • 3 in conversation