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
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.