Mapping NYC restaurant grades by household income


Maps, Visualization

Introduction

While browsing through the NYC OpenData website, I came across a dataset that contains NYC’s restaurants inspection grades. As someone that that is very fond of eating out at restaurants, I thought that this would be the perfect dataset for me to work with. The dataset includes the restaurant’s name, address, type of cuisine, grade, notes of reason for grade, and other interesting characteristics. The data in the dataset is constantly updated and only active restaurants are included.

Materials

To create this map, I used Carto, which is a cloud-based web mapping tool.

The dataset I acquired is from this NYC OpenData.

OpenRefine for data cleaning.

Dataset from Professor Chris Sula, containing estimated average household income of NYC residents based on census tract data.

Method and Process

The process for creating this map was quite simple. The first thing that I needed to do was to clean my dataset. I uploaded the data into OpenRefine and deleted any restaurant that did not have a grade. I also found that there was an additional grade that was not listed on NYC OpenData description of the dataset. This grade was “G” and there were five restaurants with this grade that were also removed. The dataset’s description explicitly mentions that this dataset is compiled from several large administrative data system so it may contain some illogical values or errors.

Fig. 1: Screen shot of cleaned dataset uploaded to Carto

The next step was to upload the dataset into Carto. I found Carto is be incredibly user-friendly while adjusting colors, pop-ups and layers. After uploading my file, I was able to adjust the colors of each grade for the restaurants as well as adding the ability to click on a restaurant and see the information about it. For the color choice for the grades, I used the same colors that are currently being used with NYC restaurant inspections for grades A, B, C, and Z. For grade P, I used red because this grade represents a restaurant that opened after previously failing inspection. For N, I used white since it has not been graded as of yet. After adjusting the color and the legend, I felt that the map did not reveal anything particularly interesting. 

Fig. 2: Map representing NYC restaurant inspection results

I discussed with Professor Sula about examining the map with an additional layer to account for socio-economic status and he provided me an additional dataset. This dataset included average estimated household income for NYC resident based on census tract data. The dataset does not include estimates for areas such as parks or cemeteries so some areas may have restaurants but not household income. I uploaded this dataset and decided to use a color scheme gradient from light green to darker, where light green represented areas with lower household income and darker green represented areas with high household income. 

Results

Fig. 3: Map of NYC restaurant grades by average household income.

The idea of examining restaurant grades by household income is definitely interesting, but I do think that due to the number of restaurants that are being examined, it can be difficult to pull trends out. The two most apparent trends that I have observed are:

  1. Most NYC restaurants have a grade of A.
  2. Manhattan has the densest population of restaurants.

Another observation would be that, simply due to the spread across restaurants with different grades in all areas, I would say that household income does not directly affect restaurant inspection grade. However, that it just a general claim based on what I’m seeing on the current map. 

To view this map click here.

Reflection

I enjoyed creating this map significantly more than I expected and I’m a slightly disappointed that I was not able to pull out any trends as I would’ve liked to. I think that this is project that I would like to dig deeper into. It would be incredibly useful to filter the map by different grade levels or income ranges. Additionally, maybe looking at different cuisine types in different areas or grades by cuisine type could reveal some intriguing findings.