Saturday, August 20, 2011

Example #8 - Publish a map of foreclosures and per capita income by zip code

We can use Tableau Public to create more complex visualizations.  Let's look at foreclosures along with per capita income in Cook County by zip code. As expected, you'll see that the lower income zip codes have a high number of foreclosures.

There's more work involved in this visualization.  Tableau Public (TP) runs on a Windows computer so you'll have to download a free copy and install it.  Getting the data ready takes some effort.  Start with the Cook County Data Portal foreclosure data set, download it,and edit it to clean it up.  I used the text editor, gVim (a vi variant), to do the clean up.  Four changes were needed:
  1. Change the Location 1 field into a five-digit zip code.  In the portal the field has zip+4 appended to a string of lat/lon.
  2. Remove the rows that represent amended foreclosures since they duplicate the original foreclosures.
  3. Remove rows that had null or zeroes for zip code.
  4. Remove the Considerations column.
We're not quite done.  TP wants an XLS file.  So, load the cleaned up CSV file into the spreadsheet or your choice (I used Lotus Symphony) and then save it as .XLS.  Crank up TP and connect it to that XLS file. Finally, we're set to make visualizations.

Here's a nice sample of what TP can create.  This map shows a blue circle for the foreclosures in each zip code in the county - the larger the circle, the more foreclosures.  TP provides built-in layers for the map.  Select the Per Capita Income layer.  Tinker with the colors and circles scale a bit to get the map below.

You can quickly generate other visualizations.  Here's a chart showing foreclosures by month.

Note:  The drop in July is not due to economic conditions.  The data set ends on 7/15/11.  We only have half of the month's data.

You can see an interact with both of these charts in the Results #8 blog entry.

Ready to watch?  Here's the link to the YouTube video.  If you have trouble reading the small fonts used, try changing the YouTube resolution to 720p and expand the video to full screen.  You'll find the controls to make those changes near the bottom of the YouTube video window when you hover your mouse over the video.

No comments:

Post a Comment