Mapping the Urban Shadow: NYC Rat Sightings Analysis

Spatial, Seasonal, and Structural Drivers of 311 Rodent Complaints

Rui-Bin Lin

STAT 440 — University of Illinois Urbana-Champaign

2026-12-01

Narrative: Why This Topic Matters

  • First-Hand Urban Observation: Visiting New York City during the holiday break sparked curiosity about the real data behind its notorious rodent reputation.
  • Public Health & Sanitation: Rodent infestations pose vector-borne disease risks and impact quality of life in neighborhoods.

Narrative: Core Research Questions

  1. Spatial Concentration: Which NYC boroughs and neighborhoods generate the highest volume of rat sightings?
  2. Seasonal Dynamics: How strongly does ambient seasonality (warm vs. cold months) drive complaint frequency?
  3. Built Environment & Response: Which building types report the most sightings, and do resolution times vary across boroughs?

Data Description: Source & Collection

  • Primary Source: Obtained from Kaggle (compiled from NYC 311 Service Requests).
  • Reproducible Hosting: Uploaded and version-controlled via my personal public GitHub Raw CSV (williamllin/nyc-rats).
  • Observation Unit: Each row represents a unique geotagged 311 rat sighting report (Unique Key).

Data Description: Variables & Dimensions

  • Dataset Size: 101,208 valid georeferenced sightings across 16 analytical features.
  • Temporal: Created Date, Closed Date, engineered resolution_days, month, and year.
  • Spatial & Categorical: Borough, Incident Zip, Latitude, Longitude, Location Type, and Status.

Data Description: Limitations

  • Reporting Bias: 311 data reflects resident reporting behavior rather than an exhaustive biological census.
  • Missing Timestamps: Open or unverified tickets lack a Closed Date, requiring right-censored handling in turnaround analyses.
  • Spatial Clustering: Multi-unit buildings generate multiple distinct complaints at identical coordinates.

Data process: Extracting

  • Selective column ingestion (col_select) via readr::read_csv() directly from HTTPS URL.
  • Eliminates local file path dependencies and optimizes cloud deployment memory.
raw_rats <- read_csv(
  data_url,
  col_select = any_of(c("Unique Key", "Created Date", "Closed Date",
                        "Location Type", "Borough", "Latitude", "Longitude"))
)

Data process: Transforming

  • Standardized inconsistent casing in Borough and filtered "Unspecified" records.
  • Parsed multi-format timestamps with lubridate::parse_date_time() to compute resolution_days.
  • Grouped granular Location Type labels into 6 clean built-environment categories via regex.

Data process: Loading

  • Interactive Dashboard: Deployed live on shinyapps.io with leaflet spatial mapping and DT tables.
  • Presentation & Paper: Rendered directly into Quarto HTML slides and an R Markdown statistical paper on RPubs.

Visualization 1: Sightings Across NYC Boroughs

Visualization 2: Strong Summer Seasonality

Visualization 3: Built Environment Breakdown

Visualization 4: Spatial Footprint Across NYC

Interesting Data Discoveries: Key Insights

  • Brooklyn & Manhattan Lead: High-density residential corridors in Brooklyn and Manhattan account for the majority of complaints.
  • Residential Dominance: Multi-Family / Apt buildings vastly outnumber commercial food venues in 311 rodent logs.
  • Summer Surge: Sightings climb steadily from May through August before declining in winter months.

Data Discoveries: Quantitative Summary

Borough Total Reports Share (%) Median Resolution (Days)
Brooklyn 34,467 34.1 10
Manhattan 26,491 26.2 9
Bronx 20,615 20.4 8
Queens 14,742 14.6 8
Staten Island 4,893 4.8 11

Conclusions: Practical Implications

  • Targeted Pre-Summer Prevention: Municipal sanitation teams should intensify containerization and baiting in April–May ahead of the summer.
  • Multi-Family Building Focus: Outreach and waste-storage enforcement in dense apartment blocks offer higher return of investment than targeting commercial streets alone.

Conclusions: Recommendations

  • Recommendations: Integrate automated 311 anomaly alerts into neighborhood inspection routing.
  • Future Work: Merge American Community Survey population density and restaurant inspection grades to model neighborhood-level infestation risk.