The residuals of crime

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Real-estate search website Trulia has a new tool to help you in your choice of a new home: crime maps. With local police forces being much better about sharing data crime maps are nothing new, but Trulia takes it to the next level with a slick user interface for navigating US cities, a beautiful heat-map visualization of crime hot-spots and — most importantly — regularly updated data. 

There's one particularly neat aspect of the design that I want to focus on. The heat-map around our own neighbourhood in San Francisco reveals it to be less of a hot-spot than I'd expected (parts of Dogpatch are kinda rough and industrial). So it's particularly interesting to see the “More” and “Less” indicators showing the ways our locale differs from the city as a whole: 


Dogpatch (it's called “Central Waterfront” in Trulia for some reason) has more thefts than you'd expect of San Francisco as a whole, but fewer assaults. Not only does that match with my own intuitions, it's also a great example of pulling key, relevant data from a statistical model. (Incidentally, Trulia uses R for statistical modeling.) Sometimes, it's not the raw predictions from the model that are the most interesting thing — I already know what my neighbourhood is like. As in this case, it's often the deviations from the model (what statisticians call the residuals) that you care about the most. When things differ from what you expect after you've taking into account the effect of all the variables in your model, that's when it's time to take notice, and learn.

Trulia: Crime Maps

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)