Median Age as Predictor Variable

with No Comments

There is a ton of information in the TIGER Census files at the U.S. Gov Census site.  Unfortunately, it is not easily mapped to geolocations.  I had to get the tract level shapefiles and then transform the variables in the data files so that the variables lined up with the tracts.  Once I clean up the scripts that I used to do this transformation, I will post them.

The following map shows a section of Philadelphia with zip codes labelled.  The median age is shown color coded where lighter green indicates a younger median age and blue means an older median age.  I wanted to determine if median age is correlated with homicides.  If it turns out that median age is correlated, then law enforcement could use this information to update deployment allocations when a new census comes out.  Homicides are marked using a star symbol and are shown for June 2009 to December 2009.  

withoutpred

When I included median age in my model, it came out as a significant predictor.  I generated a prediction for the following week using the model that includes median age.

heatmap

A visual inspection verifies that incidents cluster on lighter green tracts (lower median age) and the prediction falls along the same lines as median age is considered a significant predictor variable.  This analysis is a bit quick and dirty since I spent so much time transforming the census data.  I will post a more rigorous analysis of median age and other census variables as time allows.

Share this post: Facebooktwitterlinkedin
Follow CCRi:     Facebooktwitterlinkedinrss

Leave a Reply