Mapping Census Tract Data with Tableau

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to the tutorial today we'll be learning how to map census data specifically data at the tracked level using tableau now if you're at all familiar with mapping data at the county or state level in tableau then many of these steps will be familiar to you the difference here is that tableau doesn't have the files of census tracts coded into the program like it does counties and states this will require us to go and download the shape files from the census site and link it today that we have so let's get started the first step is to go and actually grab your data you may have it already or you may have to download from online source here you can see data.census.gov which is where most of your track level data will likely come from however for today's example i'm actually going to use social explorer to download data on educational attainment in the state of massachusetts so i'm going to go into the american community survey at the census tract level for massachusetts all tracks in massachusetts i'm going to look for educational attainment data and i'm going to get the collapsed version so it's less um different fields and the nice part about social explorer is that they'll just label the columns for you but other than that it's the same data from the census pulled directly from there and now regardless of where you get your data from it's likely going to have one oddly named or unintuitively named columns as you can see here and also a bunch of empty columns for the data you didn't actually need like they're all in the us so i didn't label that so i'm actually going to go in and just delete all the empty columns there's a lot of data right there actually and uh social explorer was nice and then it added these column headers of course you can just go in and if you know what scb12001 so on is then you just title it in this case it's population 25 and over so i'm going to leave this row and save this file and now that your data is cleaned up you're going to want to go and download the shape file for your corresponding region so if you just look up census shape files the first website will have the result ob where you want to go uh web interface so now when you download the census track you want to make sure that the year is the same as your your grabbing data from or your data is from so for our case it's the american community survey from 2018. and make sure it senses tracks and select the state you want to download from in this case massachusetts download it will be a zip file download that and you can just go in and extract that you got to follow the folder this is the actual shape file but you're going to want to keep it all in the same folder so tableau can use it i'm going to put it in this folder along with my data which i will rename to mass data and now you can open up tableau so now that tableau is open you're going to open your data file in our case it's in the csv format so we're going to click on text file obviously if it's in an excel file file click on microsoft excel we're going to go over to our census data mass data and open it and now you should be able to see all your data along the bottom here and you're going to want to focus on whichever field has this 11 digit identifier code in our case the title fips federal information processing standard and what this is is every census tract has its own unique identifying code and this is what's going to allow us to match our data file to the shapefile we downloaded now for some reason tableau loves making the fips codes a number but we're actually going to want to keep it as a string so just click there and make it to a string and now to add our shapefile we're going to go to connections and click add go down the spatial file go to the folder we downloaded and open the shape file and to add a connection we're just going to drag it over to the center here and tableau is going to ask you to edit the relationship so on the data file we're going to click on fips which is where our fips code was and then on the shapefile it'll typically be under geoid so just click there close and as you can see here they're linked and if you click on this one the shape file you can see under geoid is where all the fips codes for the sensor tracks are so now let's go to sheet1 and to make the map all you have to do is scroll down to the shape file and double click on geometry so map will pop up hovering over it doesn't do anything yet um what we're going to want to do is we're going to add names to the census tracts so whatever field had the names in our case qualifying name just mouse over it and double click so now when you mouse over each census tract you can see the name of the census tract along with the county and state depending on if how your data is formatted now the process is pretty similar to mapping county level data so pick whatever field you want to map in our case we're going to map percent of population over 25 with a bachelor's degree or better drag it over color and tableau will make a basic choropleth map with a continuous color scale where the minimum value is the lowest value it sees in your data and the highest and maximum value is the highest value you see in your data and this is good to do quality control making sure your data is correct for our case since we have a percentage we may want to make sure nothing goes below zero and nothing goes above 100 which it does not now for mapping census tracts especially a continuous kit a continuous scale for a choropleth map is not the best choice because sense tracks are just so small that the colors kind of just blend into each other and it's really hard to read so we're going to want to go into color click edit colors and let's go to step color and let's put it down the four categories now so here you can see more distinctly the different groups of highly educated counties and less highly educated counties and tableau will just automatically make a color scale that's equal interval so 0 to 25 25 is 50 50 to 75 and 75 to 100 and you can if you want to change the colors you can go ahead and do that you can even add a divergent color scale if you want although for single variable maps like this the diversion color scale can often be misleading just because for account for a track that say has 49 bachelor's degrees versus 51 they're gonna be really close to each other but have very different they'll have one will be orange and will be blue so we'll just keep it as automatic for now which will just be a single color and then if you wanted to do percentile you can just right click on this color uh value and get a quick table calculation just click percentile but we'll just leave it in equal interval for now so you may also notice that the center tracks include water the water the territorial waters around the state this isn't a problem for this map since all these census tracts have zero populations so they all show up as zero percent on the map and contrast well with the sensor tracks on the shore but depending on your data you may have you may you have the case where these colors are really close to the shoreline color so it's hard to see and it makes your map look strange to anyone who's familiar with the coastline of the stage you're mapping so if you want to just exclude it you can just click on the um census tracks and just control click to select or command click to select all the ones you want to exclude and just click exclude and they'll be gone and then your map will be more cleaned up and then now you can do all the other things you would normally do with tableau you can edit the tooltip if you would like change that here you can map different color you can map different fields on here if you'd like and if you wanted to add other states all you'd have to do is edit your data sheet make sure you have the fips code that's the most important part so that you can link it to your shape file and then go in and download the shape file from this shapefile of the state you wanted to add from the census website and you can add it to your map here so you can continuously add or you could just download the entire shapefile for the whole united states although doing that will just give you a huge file which it may not be unnecessary for only mapping say these three states you all you need to do is download the massachusetts connecticut and rhode island shape files and that's about it for now and you should be on your way to mapping census data sensor track level data for any data you have
Info
Channel: Gabriel Barrett
Views: 477
Rating: 5 out of 5
Keywords: Tableau, Mapping, visualization
Id: ieu0FlSjk6U
Channel Id: undefined
Length: 9min 3sec (543 seconds)
Published: Wed Aug 12 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.