Analysis of NYC DOHMH Restaurant Inspection Data: Part 2, Seasons of Vermin
This is a continuation of my Analysis of NYC DOHMH Restaurant Inspection Data, with analysis presented as a Jupyter notebook here.
Examining a cleaned subset of NYC DOHMH Restaurant Inspection results from 2017 to 2019 reveals a marked seasonal effect in restaurant health inspection results. The effect manifests in the form of more citations assigned to restaurants inspected in the second half of the year, with violations related to flies and roaches appearing to be the key drivers of the incremental citations. This effect also means that restaurants inspected in the first half of the year are significantly more likely to score less than 14 points on their initial inspection, putting them on an annual inspection cycle.
This creates an unfair advantage for restaurants currently being reviewed in the first half of the year, because their inspections become less stringent and less frequent.
However, this effect will also gradually concentrate inspections in the first half of the year due to the NYC DOHMH's approach of setting inspection cycle lengths based on initial inspection scores; this appears to already be the case.
The problem appears best addressable through greater seasonal adjustment of the affected violation codes.
As noted in Part 1 of my analysis of the NYC restaurant inspection dataset, a question raised by the initial exploratory analysis is how seasonal effects impact score and grade distributions? It seems likely that populations of mice, rats and bugs fluctuate over the course of the year, meaning that their relative prevalence in kitchens should as well.
If these pests (henceforth vermin) are less present in a particular part of the year, restaurants that happen to be reviewed in the advantaged season may be inspected less frequently than restaurants inspected in other parts of the year (since initial inspection or ‘natural’ A grades result in an annual inspection cycle, while higher initial inspection scores trigger a shorter cycle), creating an unfair advantage for them, and also giving different values to the same grade depending on when it is earned. Additionally, the shorter review cycle for restaurants with higher initial inspection scores would serve to concentrate reviews in the advantaged season, unbalancing the DOHMH inspectors’ burden.
The following analysis in Python shows that this is in fact the case, and this redistribution of inspections may already be occurring, as detailed in the Jupyter notebook here.
Overall, the analysis concludes that there is marked seasonality in health code violations related to the presence of insects in NYC restaurants, resulting in worse inspection results for restaurants inspected in the second half of the year.
This seasonal effect may be redistributing the DOHMH workload over the course of the year, as restaurants that fail a health inspection are placed on a more frequent inspection schedule.
While this may suggest that this seasonal effect is self-correcting, the reality is that this represents a potentially serious flaw in the system. If sanitary standards are different depending on the seasons, consumers may have less confidence in the value of restaurant health inspection ratings, not to mention restaurants may experience higher compliance costs out of dumb luck. The DOHMH itself may end up with an unbalanced workload, leading to corner-cutting to prevent the formation of an even greater backlog in the first half of the year.
The current system has downsides for all parties involved. The DOHMH should take decisive action to reduce the seasonal impact on ratings. One potential way of doing so would be to develop seasonal modifiers for insect-related violation codes. For example, if a correlation could be found between the number of flies found in a kitchen during the first and second halves of the year, severity conditions based on seasons could be developed to level the playing field, and ensure equal sanitary standards in NYC’s restaurants year-round.