project

page

Sacha Henson | Student ID: 1930431

Does Crime Affect House Prices?

Introduction

Accepted economic theory concludes that positive changes in house prices results in more consumer spending and personal investment. As two thirds of Britain’s households are homeowners, house price inflation increases GDP through the boosted consumption generated from higher levels of confidence. As GDP is a key indicator of the economy’s performance, it is critical to assess what influences house prices.

One factor affecting house prices is crime because rates of vandalism and anti-social behaviour can be a signal to prospective buyers of the local community health and crimes such as burglary or property damage pose a risk to the property itself and personal safety. Intuitively, high crime rates make local properties less desirable and cost less.

Therefore, this project will investigate:

Is there a relationship between house prices and crime?

What is the nature of this relationship?

To carry out this investigation, this project focuses on London. Chart 1 supports this as London house prices have a greater increasing trend compared to England’s other most populated cities and Chart 2 demonstrates that there is a huge variation in house prices within London thus it is reasonable to investigate if volatile London house prices are related to local crime rates.

How data was accessed, used and notes on replication

Chart 1 was made by feeding the 20 most populous UK cities scraped from Statista into a loop in Google Colaboratory (GC) to scrape and save the average property prices for each city from the Land Registry URL base into an empty data frame (df). This df was remerged with the Statista population estimates which are revealed in Chart 1 via tooltip. Chart 2 uses data from a Land Registry CSV file and I used GC to convert the appropriate columns into numeric data.

Whilst preparing the data for Chart 2, I also logged the median house prices because this would reduce skewness towards large values. To merge house prices with crime data collected from the Metropolitan Police (MP), I converted the crime data from wide to long format and ensured the data types of corresponding columns in the house price data matched. Github hosts all the GCs, original and merged datasets.

Charts 4 and 5 update automatically and use the coordinates of Becontree and South Kensington which are underground stations in the lowest and highest average house price boroughs, respectively. These coordinates are used in the URL for the MP API of the latest crimes reported at those locations.

Challenges in data cleaning and analysis, and the tools used to overcome them

The main challenge of Chart 1 was converting the scraped city names into the correct format for the loop. For example, the cities with more than one word such as Edinburgh had to be decapitalised with hyphens to city-of-edinburgh to be fed into the URL base. Another problem is that my analysis has a limited scope of 2008-2017 due to collection processes of the data. To extend this analysis, more data is necessary.

The greatest challenge was handling the MP dataset; the crime data for each borough had a major category (e.g. burglary) with one or more minor categories (e.g. 1. in a dwelling 2. in other buildings) for each month every year, but for my analysis I only needed total major counts of crime per year. I used Pandas in GC to make new dfs for each year to individually sum the crime counts and simultaneously absorb the minor counts of crime into one parent major crime category. Finally, the annual crime counts were copied into a central df and merged many-to-one with the logged house prices to establish an all-encompassing df of annual total crime by crime type per borough with the corresponding year’s median house price.

My conclusions: is there a relationship between crime and house prices?

Using the merged crime and house price dataset, Matplolib estimated a best fit line and I then translated this into VegaLite. From Chart 3, I can conclude that there is some positive relationship between house prices and crime rates across all London. This implies that higher crime rates are associated with higher house prices. Whilst this doesn’t establish causality, this may be because lower house price areas have violent crime as a higher proportion of total crime, but higher income areas have more incidences of petty crime such as theft-from-the-person as indicated by Chart 4 compared to 5.

However, the R squared value calculated using the lingress function imported from SciPy in GC is very low at 0.05, implying that crime explains very little of median house prices. Secondly, the dropdown menu indicates that despite the existence of a general relationship, it is not borough specific; each borough’s annual crime count moves around a certain value whilst local house prices fluctuate. Both observations suggest that house prices are determined by more than local annual crime. This analysis could be extended by studying how and why some crimes are more influential on house prices than others, as explored by Gibbons.

Related files

Chart 1: UK House Prices | Original data source: Statista & Land Registry | My Google Colab: UK House Prices | CSV file: UK House Prices

Chart 2: London Borough House Prices | Original data source: Land Registry | My Google Colab: median borough house prices | My CSV file: borough house prices

Chart 3: Annual Total Crime and Median House Prices | Original data source: Land Registry & Metropolitan Police | My Google Colab: logged borough house prices merged with crime data | My CSV file: logged median borough house prices and crime

Chart 4: Crime Outside Becontree Station | Original data source: Metropolitan Police API

Chart 5: Crime Outside South Kensington Station | Original data source: Metropolitan Police API