Methods and limits

What is measured

For each complaint, the time to close is its closed date minus its created date, both as the city publishes them in the 311 Service Requests dataset. The answer on the main page is the median of those times: half of the complaints were closed faster, half slower. The median is used instead of the average because a few complaints stay open for months and would pull an average far away from what most people experience.

"9 in 10 were closed within" is the 90th percentile, using the nearest-rank method: line the closed complaints up from fastest to slowest and take the one 90% of the way along. It is always one real complaint's time, so at least 9 in 10 were closed at least that quickly. It is shown only when at least 10 complaints were closed.

Areas are the city's own fields on each complaint: borough, community district (community_board), and ZIP code (incident_zip). Community district codes above 18 are parks and other special areas and are not listed as districts. Rankings leave out districts with fewer than 20 closed complaints.

What it leaves out

Closed is not the same as fixed. The city marks a complaint closed when the agency finishes with it. That can mean the problem was fixed, that an inspector found nothing, that police responded and left, or that it was referred elsewhere. The time to close measures the city's process, not whether the problem went away.

Open complaints are not counted. Complaints with no closed date when the data was downloaded have no time to close yet. The main page says how many there are. Because they are usually the slow ones, the median of the closed complaints is lower than the eventual median would be.

Complaints closed before they were opened are left out. These are data entry errors; the main page says how many there were.

One period. The site currently loads one month of complaints so that it stays quick on a phone. Seasonal complaints, like heat in winter or fireworks in summer, only show up in their season.

Westchester towns

The Westchester page uses the public records of the towns that take residents' requests through SeeClickFix: Mount Pleasant, Greenburgh, Mount Vernon, North Castle and Peekskill. A request's town is the SeeClickFix organization that handles it; Mount Vernon's requests are filed under its departments' names. Times are New York local time. The page covers the latest twelve full months that ended at least 30 days before the site was built, and is refreshed monthly.

These are far fewer requests than New York City's, about 1,500 a year across the five towns, so comparisons for less common request types rest on a handful of requests; the page says when there are fewer than 20. Yonkers takes requests through its own Problem Solver form and the Mayor's Help Line, which don't publish their records, so it isn't included.

How it is computed

Everything is computed in your browser. The page downloads a snapshot of the city's data and a query engine compiled to WebAssembly, then runs each question as a small query: filter to the complaint type, filter to the area, keep closed complaints, compute the hours each took, take the median. "How this was counted" on the main page lists those steps with the number of complaints left after each one. The sentences there are generated from the query the engine ran, not written separately.

The engine keeps track of which complaints each result came from. That is how the page lists the actual complaints behind an answer, and how it can say how much any single complaint moves the answer: it computes the median without each complaint, exactly, without re-running the whole query.

Each complaint number links to the same record in the city's API, so any one of them can be checked against the source.

The data

The snapshot is built by a command-line tool that pages through the city's Socrata API, keeps the raw responses, and writes a typed, sorted, compressed Arrow file. Cleaning only changes how a value is stored, for example parsing dates. It never drops or edits a complaint because it looks wrong; judgements like "a complaint can't close before it opens" are steps in the query, where they can be seen.

Every part of the snapshot is hashed with BLAKE3, and the hashes roll up into one fingerprint shown at the bottom of the main page. Before running anything, the engine re-derives every hash from the downloaded bytes and refuses data that doesn't match, so a corrupted or altered download can't produce an answer. The fingerprint covers the values, not the file's exact bytes, so the same data compressed differently has the same fingerprint, and a change to padding that alters no value is not an error.

Source and prior work

The code is on GitHub: the snapshot tool, the query engine (plans, execution, lineage, counterfactuals), and this site. The design notes are in docs/.

Tracing a result back to its source rows is an old database problem: Cui, Widom and Wiener, Tracing the lineage of view data in a warehousing environment (ACM TODS, 2000). Asking what a result becomes when source rows are removed is deletion propagation: Buneman, Khanna and Tan, On propagation of deletions and annotations through views (PODS 2002).

Data from NYC Open Data, under the city's terms of use. This site is not affiliated with the City of New York.