Giter Site home page Giter Site logo

newyorkcitycouncil / lead_hearing Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 19.23 MB

Data Analysis & Visuals for April 2023 Lead Hearing

Home Page: https://council.nyc.gov/data/lead-in-nyc-homes/

CSS 0.02% TeX 0.01% R 0.01% HTML 99.77% JavaScript 0.20% Jupyter Notebook 0.01%
dohmh hpd lead-poisoning children-under-3 violations litigations webpage

lead_hearing's Introduction

Lead in NYC Homes

Data analysis and visuals for NYCC 04.25.2023 'Oversight - Lead-Based Paint Hazards' hearing.

An associated webpage for this analysis can be found on the council website.


Data Sources

Methodology

Summary & Intention

As required under state law, only 50% of NYC’s toddlers are being tested for lead. Therefore, the NYC Council is putting in place more protections for these vulnerable children. Now, 80% of NYC's children under three are being tested at least once.

The data team analyzed local law 57 data in order to:

  • Conduct analysis on the presence of lead paint violations and litigations in NYC over time
  • Identify areas in NYC where lead paint violations and litigation are particularly prevalent

Main Takeaways

  • Upper Manhattan and the Bronx are the areas with the greatest number of lead violations and litigations. As of March 2023, 45% of all lead-related court cases in New York City were in the Bronx.
  • The Bronx and Upper Manhattan had the most HPD lead litigation cases between 2006 and March 2023. Since 2006, District 14 in the Bronx has filed more than 500 litigation cases.
  • City-wide, Staten Island and Queens have the fewest HPD lead-based paint violations and lead litigations.

Recommendations

A traunch of bills was passed previously to address lead paint in NYC Homes that:

  • Require the investigation and remediation of lead hazards in spaces where children routinely spend 10 hours or more/week. Read the Bill: Int 464-B
  • Require the Department of Environmental Protection (DEP) to track all lead water supply mains and service lines and provide that information to the public in the form of an online interactive map. Read the Bill: Int 709-A
  • Lower the blood lead levels, lead-based paint threshold, and lead dust threshold that trigger inspection and/or remediation requirements. Read the Bill: Int 865-A
  • Require linguistically and culturally competent outreach/education campaign to increase awareness of childhood lead poisoning prevention. Read the Bill: Int 881-A
  • Strengthen the City’s enforcement ability to ensure landlords are complying with the City’s lead laws, and expand lead reporting requirements for the Department of Health and Mental Hygiene (DOHMH) and the Department of Housing Preservation and Development (HPD). Read the Bill: Int 918-A
  • Extend current requirements for daycares to test for lead-based paint annually to other facilities with children under the age of 6, including preschools and nursery schools. Read the Bill: Int 920-A
  • Increase landlord requirements to inform tenants about building owners’ responsibilities under the City’s lead laws. Read the Bill: Int 1117-A

lead_hearing's People

Contributors

fryenycc avatar juliafredenburg avatar ravram193 avatar rhirotacouncil avatar romartinez-nycc avatar

Watchers

 avatar  avatar  avatar

lead_hearing's Issues

nm code comments

  • add dplyr, ggplot2 (or tidyverse) to 00_load_dependencies.R
  • source("code/utils/00_load_dependencies.R") still doesn't work out of the box for me. the rmd file is located in the code folder and that is getting set as the working directory. can change to source("utils/00_load_dependencies.R") or source("../code/utils/00_load_dependencies.R"). But I'm having the problem for all file paths loading and writing.
  • 01_litigations_lead.rmd line 74: there is no existing lead_lit_cd variable
  • 01_violations_lead.rmd line 16: the data file data/lead_data_hmcv_4_11_23.csv doesn't exist
  • 01_violations_lead.rmd line 52: the data file data/City Council Districts/ doesn't exist. Also if using a downloaded file just make sure to put in readme where the file was downloaded from.

01_violations_lead.rmd review

  • File folder location changed, update to source("../code/utils/make_cd.R")

    source("code/utils/make_cd.R")

  • For Make_cd.R, it uses the new council district boundaries instead of the old ones. Here is some code to use the previous CDs

council_districts = unzip_sf("https://www.nyc.gov/assets/planning/download/zip/data-maps/open-data/nycc_21d.zip") %>% st_read() %>% st_transform(st_crs(4326))

  • Data not in found, please add it! 😅 I'm unable to run the code for reproducibility.

    hmcv_sub <- fread("data/lead_data_hmcv_4_11_23.csv")

  • It would be helpful to add comments for non-datatable folk.

    hmcv_sub[, inspectiondate := as.Date(inspectiondate)]
    hmcv_sub[, yearinspect := year(inspectiondate)]
    # check nas
    hmcv_sub[streetname %in% "FOREST AVENUE" & housenumber %in% "861", councildistrict := 49]
    hmcv_sub[streetname %in% "BEACH 88 STREET", councildistrict := 32]
    hmcv_sub[streetname %in% "GRAND CENTRAL PARKWAY SOUTH", councildistrict := 24]
    hmcv_sub[streetname %in% "ADAM CLAYTONPOWELL JR BOULEVARD", councildistrict := 9]
    lead_paint <- hmcv_sub[grep("SECTION 27-2056.6", novdescription, ignore.case = TRUE), .(violationid, inspectiondate, CounDist=councildistrict, yearinspect)]
    # number of violations per year by cd
    lead_paint_cd <- lead_paint[, .(vios_cd = length(unique(violationid))), by = .(CounDist, yearinspect)]
    # number of violations per day citywide
    lead_paint_vios_day <- lead_paint[, .(vios_day = .N), by = .(inspectiondate)]

01_litigations_lead.Rmd Review

Some of these Nick commented on as well, sorry for the duplication!

  • This works for me source("../code/utils/00_load_dependencies.R") instead of
    setwd("/Users/rhirota/Documents/GitHub/lead_hearing")
    source("code/utils/00_load_dependencies.R")
  • Option to use vroom(). Vroom library has faster reads than fread, if the data is really large, I recommend using vroom & then converting it into datatable.
    litigations <-fread("https://data.cityofnewyork.us/resource/59kj-x8nc.csv?$limit=99999999999")
  • Please comment the code here for non-datatable folks
    litigations[, yr := year(caseopendate)]
    litigations <- litigations[, yr := year(caseopendate)]
    litigations <- litigations[litigations$yr>2005,] # not complete data
    ```
    ```{r}
    # ---- CLEAN DATA ----
    lead_litigations <- unique(litigations[grep("lead", casetype, ignore.case = TRUE), ])
    lead_litigations <- unique(lead_litigations[!grep("non-lead", casetype, ignore.case = TRUE), ])
    lead_litigations[, lit_bbl := length(unique(litigationid)), by = .(bbl)]
  • I added dplyr as a required library in load_dependcies to run the following:
    temp <- lead_litigations %>% group_by(yr) %>% summarise(count_lead=n())
    temp2 <- litigations %>% group_by(yr) %>% summarise(count_total=n())
    temp <- temp2 %>% full_join(y = temp, by = 'yr')
    temp <- temp[temp$yr <= 2023 & !is.na(temp$yr) & !is.na(temp$count_lead), ] # not sure why NA/2030 is in there... data entry error?
  • I added ggplot to run the plots below,
    # ---- plot number of lead litigations by year
    I recommend breaking out each plot as its own code chunk and spacing out the lines to increase readability.
  • Lets move this to the bottom or remove (but please save it somewhere else for future work!)
    Possible interest: Open judgement (yes) or harassment found or penalty assigned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.