All projects

NYC real estate and crime

Does local crime explain New York housing prices?

Why I built it

A student question: does local crime explain housing sale prices in New York? The honest answer turned out to be “not by itself”.

What it does

NYC property sales joined with NYPD complaint data to measure how much neighbourhood crime moves sale prices.

Worth a look

  • Crime alone does not explain prices in this data. The best decision tree puts about 60% of test sales in the right price bracket, which is weak.

Under the hood

  1. Two big datasets

    About 2 million NYC property sales (2003–2023, residential 2006–2019 kept) and 7 million geolocated NYPD complaints mapped to ZIP codes.

  2. Make crime the difference

    ZIP codes with similar mean prices were picked (an ANOVA checked it), so that crime would be the main thing that varies.

  3. Join and model

    Sales and yearly crime counts joined on ZIP code and year, then a linear regression and a depth-3 decision tree on every combination of features.

  4. Why it is weak

    Sparse complaint records before 2006, the 2008 crisis, a sales file that does not separate houses from flats, and only about 1,100 sales left after filtering.