Introduction

Climate change increasingly affects urban environments through flooding, extreme weather, and infrastructure strain. Beyond physical impacts, environmental stressors may influence psychological well-being and social behavior, particularly in dense urban settings such as New York City. Environmental stress theory suggests that chronic exposure to environmental risk can heighten stress, frustration, and conflict within communities.

This project investigates whether environmental risk exposure, measured through flooding-related complaints, is associated with social indicators of anxiety, operationalized as noise complaints across New York City. By utilizing publicy available NYC Open Data, this project demonstrates how open civic data can be used to explore psychological and behavioral patterns at the community level in a reproducible way.

This analysis is framed as a proposal suitable for submission to NYC Open Data Week 2026 and emphasizes transparency, reproducibility, and civic relevance.

Research Question

How does exposure to environmental risk (measured by flooding complaints) relate to social indicators of anxiety (measured by noise complaints) across New York City boroughs?

Data Sources

This project uses four datasets from the NYC Open Data Portal:

  1. 311 Service Requests (Noise Complaints subset)
  2. 311 Service Requests (Flooding-related complaints subset)
  3. E-Designations
  4. Hazard Mitigation Plan - Mitigation Actions Database

Due to the size of the full 311 Service Requests dataset, noise complaint data were accessed via the NYC Open Data API. Smaller supporting datasets were downloaded and imported as Excel files. This mixed-format approach improves efficiency while maintaining transparency and reproducibility.

Reproducible Workflow

library(tidyverse)
library(lubridate)
library(readxl)
library(httr)
library(jsonlite)

knitr::opts_chunk$set(
  message = FALSE,
  warning = FALSE
)

Loading Downloaded Excel Datasets

edesignation <- read_excel(
  "E-Designations.xlsx",
  na = c("N/A", "NA", "")
)

hazard_mitigation <- read_excel(
  "Hazard_Mitigation_Plan.xlsx",
  na = c("N/A", "NA", "")
)

street_flooding <- read_excel(
  "Street_Flooding_Complaints.xlsx",
  na = c("N/A", "NA", "")
)

Accessing NYC Open Data via API (311 Noise Complaints)

To avoid downloading the full 311 datatset, noise complaints were retrieved using the NYC Open Data API. Only relevant variables and records were requested.

get_nyc_data <- function(url) {
  response <- GET(url)
  content(response, as = "text", encoding = "UTF-8") |>
    fromJSON(flatten = TRUE) |>
    as_tibble()
}
noise_url <- URLencode(paste0(
  "https://data.cityofnewyork.us/resource/erm2-nwe9.json?",
  "$select=unique_key,created_date,complaint_type,borough,city,",
  "x_coordinate_state_plane,y_coordinate_state_plane&",
  "$where=complaint_type LIKE 'Noise%' ",
  "AND created_date >= '2018-01-01T00:00:00'&",
  "$limit=50000"
))

noise <- get_nyc_data(noise_url)

Data Cleaning and Preparation

Data were cleaned to ensure consistent borough labeling and proper date formatting. Complaint counts were aggregated at the borough-year level to allow comparisons across time and location.

noise_clean <- noise |>
  filter(!is.na(borough)) |>
  mutate(
    created_date = as.POSIXct(created_date),
    year = year(created_date),
    Borough = borough
  ) |>
  group_by(Borough, year) |>
  summarise(
    noise_complaints = n(),
    .groups = "drop"
  )

flood_clean <- street_flooding |>
  filter(!is.na(Borough)) |>
  mutate(
    created_date = as.POSIXct(`Created Date`),
    year = year(created_date)
  ) |>
  group_by(Borough, year) |>
  summarise(
    flood_complaints = n(),
    .groups = "drop"
  )

Merging Datasets

complaints <- left_join(
  flood_clean,
  noise_clean,
  by = c("Borough", "year")
)

Descriptive Statistics

summary(complaints)
##    Borough               year      flood_complaints noise_complaints  
##  Length:87          Min.   :2010   Min.   :   1.0   Min.   :    1.00  
##  Class :character   1st Qu.:2014   1st Qu.: 220.5   1st Qu.:    5.25  
##  Mode  :character   Median :2018   Median : 394.0   Median :  104.00  
##                     Mean   :2018   Mean   : 512.8   Mean   : 1470.47  
##                     3rd Qu.:2022   3rd Qu.: 765.5   3rd Qu.: 1383.00  
##                     Max.   :2025   Max.   :1571.0   Max.   :12282.00  
##                                                     NA's   :53

This summary provides and overview of variation in environmental risk exposure and social complaint behavior across boroughs and years.

Visualization 1: Flooding Complaints by Borough

ggplot(flood_clean, aes(x = Borough, y = flood_complaints)) +
  geom_col(fill = "#2a9d8f") +
  labs(
    title = "Street Flooding Complaints by Borough",
    x = "Borough",
    y = "Number of Flooding Complaints"
  ) +
  theme_minimal()

Visualization 2: Flooding and Noise Complaints

complaints <- complaints %>%
  mutate(Borough = toupper(trimws(Borough)))
ggplot(complaints, aes(x = flood_complaints, y = noise_complaints, color = Borough)) +
  geom_point(size = 3, alpha = 0.7) +
  geom_smooth(method = "lm", se = TRUE, color = "black") +
  scale_color_manual(values = c(
    "MANHATTAN" = "#2a9d8f",
    "BROOKLYN" = "#264653",
    "BRONX" = "#8ac926",
    "QUEENS" = "#56c596",
    "STATEN ISLAND" = "steelblue"
  )) + 
  labs(
    title = "Relationship Between Flooding and Noise Complaints",
    x = "Flooding Complaints",
    y = "Noise Complaints"
  ) +
  theme_minimal()

Statistical Analysis

model <- lm(noise_complaints ~ flood_complaints, data = complaints)
summary(model)
## 
## Call:
## lm(formula = noise_complaints ~ flood_complaints, data = complaints)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1846.6 -1449.0 -1261.5   -18.4 10989.5 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)
## (Intercept)      1194.6750   884.3401   1.351    0.186
## flood_complaints    0.4162     1.1039   0.377    0.709
## 
## Residual standard error: 2898 on 32 degrees of freedom
##   (53 observations deleted due to missingness)
## Multiple R-squared:  0.004423,   Adjusted R-squared:  -0.02669 
## F-statistic: 0.1422 on 1 and 32 DF,  p-value: 0.7086

Results

The regression analysis evaluates whether higher levels of flooding complaints are associated with increased noise complaints. A positive relationship would align with environmental stress theory, suggesting that climate-related disruptions may be linked to heightened social tension and anxiety-related behaviors.

Discussion

This project demonstrates how climate-related environmental stressors may influence social behavior in urban environments. Flooding represents a tangible, recurring disruption, while noise complaints may reflect increased frustration or conflict within communities. Together, these indicators provide insight into how climate risk may shape everyday social experiences in New York City.

By integrating psychological theory with open civic data, this analysis highlights the value of interdisciplinary approaches to understanding climate impacts.

Limitations and Future Directons

311 complaint data reflect reporting behavior rather than direct psychological measurement and may vary by access to city services or trust in government. Future work could incorporate demographic or spatial analyses, examine temporal patterns around extreme weather events, or integrate measures of pro-environmental behavior and peer influence.

Connection to Open Data

This project emphasizes transparency and reproducibility by combining downloaded open datasets with API-based data access. NYC Open Data enables researchers and communities to explore complex environmental and social issues using publicly accessible information, supporting informed decision-making and civic engagement.

Conclusion

Environmental stressors associated with climate change may have meaningful social and psychological consequences in urban settings. Using NYC Open Data, this project provides a reproducible framework for examining how environmental risk relates to social indicators of anxiety across New York City. These findings underscore the importance of incorporating psychological perspectives into climate resilience planning.