@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).