03-20-2017 12:06 PM
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.....
03-20-2017 12:30 PM
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;
03-20-2017 12:46 PM
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.
03-20-2017 02:22 PM
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.
03-22-2017 11:37 PM - last edited on 03-23-2017 08:53 AM by ChrisHemedinger
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.
ps- You can see the code generated by tasks by clicking the Preview code button in the bottom-left corner of the task dialog.
05-19-2018 06:06 AM - edited 05-19-2018 06:08 AM
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.