BookmarkSubscribeRSS Feed
N_C
Calcite | Level 5 N_C
Calcite | Level 5

Hi,

 

Can anyone help me understand how to create a heat map of the UK please?  I've tried using Tasks/ Graphs / Map Chart and using the SAS.maps.uk as my Data Source but I don't know how to link this to my data to show how many customers we have in each region.  I expected to find a common field such as Postcode.  I've tried several different options but just end up confusing myself each time so thought I'd ask for help.....

 

Thanks.

6 REPLIES 6
ballardw
Super User

If I understand the Maps.UK dataset I have then the variable ID represents something called a Division which looks like it should be a geographical region. Your response data would need to have a variable named ID with numeric values that match those division variables and should be indicated as the ID variable for the data.

Maps.UK would be the MAP source and your response data would be the DATA source.

 

Are you getting any map or just errors? If you are getting some sort of map post the generated code and we may be able to provide more hints.

 

The generated code that should get you started would look something like this:

proc gmap data=yourdata map=maps.uk;
  id id;
  choro customercountvariable;
run;
quit;
N_C
Calcite | Level 5 N_C
Calcite | Level 5

I'm not coding it as I'm using the task funtion so I don't have anything to show you.  I don't understand what the divisions / regions relate to though.  I think that I'd need something to explain what they are so that I can create something in my dataset based on postcodes.   

ballardw
Super User

I have attached a map of the divisions as they appear in the maps.uk dataset that I have. You may also have a maps.UK2 which is a feature data set and has the value of the ID variable, a region and and variable IDNAME that names the ID except for the islands in the boxes which are only refered to as "BOX"

 

EG should generate code if asked to.

 

 


gmap82.png
CaseySmith
SAS Employee

If you are using the Map Chart task (in Tasks->Graph), the Data page is where you specify the map data source and your response data source.  The two data sets have to have a column of the same name that identifies the regions in the map.  For example, you would probably use MAPS.UK as the map data source in this case (unless you are looking for different regions).  Your response data source needs to have one record for each region (ID variable) you want to plot response data for, that corresponds to the IDs in the map data source.  The easiest way to get your response data in this format is to join it with the feature table (ex. MAPS.UK2), since it already has corresponding ID column.

 

Attaching a few overlayed screenshots, showing a process flow joining response data to feature table (MAPS.UK2), then using the result as the response data input along with the map (MAPS.UK) to the Map Chart task, and the end result.

 

usingMapChartTask.png

 

Casey

 

ps- You can see the code generated by tasks by clicking the Preview code button in the bottom-left corner of the task dialog.


usingMapChartTask.png

Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

djrisks
Barite | Level 11

Hello,

 

I was wondering if it's possible to do a similar map, but within London, and the different boroughs within London are shown? Similar to the image below please.

 

greater_london_authority_boroughs_map_lg.jpg


Many thanks,

 

Kriss Harris

SASKiwi
PROC Star

SAS Visual Analytics has mapping capabilities like this. Is VA available to you?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 3102 views
  • 0 likes
  • 5 in conversation