BookmarkSubscribeRSS Feed
IIIEEE
Calcite | Level 5

I've created my maps using shape files of the UK at  a postcode area level. My proc map import data set has:

 

X      Y        Postcode-area

-2     56            AB

-2    52              B

-2    53             BB

 

My response variable is called response from the response_1 dataset

 

proc gmap map=Post code areas data=response_1;
id Postcode-area;
choro response / ;
run;
quit;

I'm trying to annotate each area with the appropriate postcode-area. 

 

All the examples I've come across use  %annomac; %centroid, however I can't get it to work for my maps.

 

Any help will be much appreciated.

Thanks

1 REPLY 1
GraphGuy
Meteorite | Level 14

Here's a simple example that shows the basics:

 

data my_map; set maps.us;
original_order+1;
run;

 

proc sort data=my_map out=my_map;
by statecode;
run;

 

%annomac;
%centroid(my_map, centers, statecode, segonly=1);

 

data centers; set centers;
xsys='2'; ysys='2'; hsys='3'; when='a';
length function $50;
function='label';
text=trim(left(statecode));
run;

 

pattern1 v=s c=cornsilk;

 

proc gmap data=my_map map=my_map anno=centers;
id statecode;
choro segment / levels=1 nolegend;
run;

 

gmap1.png

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 761 views
  • 0 likes
  • 2 in conversation