Spot a slow zone yourself
Use the daily segment times to watch a slow zone begin, with the same rules the site uses, in one SQL query.
The subway slow zones table is built from subway segment times with a few simple rules. Here we apply them by hand to one segment, so you can test the rules or try your own.
The segment: the E train southbound from Jackson Heights-Roosevelt Av (G14S) to Queens Plaza (G21S), in spring 2023.
The query
Section titled “The query”ATTACH 'https://data.transitlab.nyc/v1/transitlab.duckdb' AS transitlab (READ_ONLY);
WITH daily AS ( SELECT service_date, mean_seconds, n_trips FROM transitlab.subway_segment_times WHERE a_stop = 'G14S' AND b_stop = 'G21S'),scored AS ( SELECT *, -- A good typical day: the 10th percentile of the previous 120 weekdays quantile_cont(mean_seconds, 0.10) OVER ( ORDER BY service_date ROWS BETWEEN 120 PRECEDING AND 1 PRECEDING ) AS baseline FROM daily)SELECT service_date, round(mean_seconds) AS seconds, round(baseline) AS baseline, mean_seconds >= baseline * 1.10 AND mean_seconds >= baseline + 10 AND n_trips >= 20 AS slowFROM scoredWHERE service_date BETWEEN '2023-04-10' AND '2023-05-05'ORDER BY service_date;What you’ll see
Section titled “What you’ll see”| service_date | seconds | baseline | slow |
|---|---|---|---|
| 2023-04-20 | 373 | 355 | false |
| 2023-04-21 | 375 | 355 | false |
| 2023-04-24 | 393 | 355 | true |
| 2023-04-25 | 435 | 355 | true |
| 2023-04-26 | 395 | 355 | true |
| 2023-04-27 | 423 | 355 | true |
From Monday, April 24, trains took 40 to 80 seconds more over this stretch, day after day. Four slow weekdays in a row make a slow zone, so this one starts on the 24th. It ran until July 20 and cost riders more time than any other since 2022.
Trains were already a little slower the week before (373 to 381 seconds) but under the 10% line. Thresholds always trade early warnings against false alarms; change 1.10 and 10 to see how the start date moves.
Try another segment
Section titled “Try another segment”Pick a row from transitlab.subway_slow_zones and put its a_stop and b_stop into the query, with dates around its start_date. Stop IDs end in N or S for the direction.
Why the 10th percentile?
Section titled “Why the 10th percentile?”A median baseline would rise with every slow spell and slowly hide it. The 10th percentile tracks a good day, which moves only when something lasts for months, like a new timetable. The method has the full rules, including how disruptions and service changes are told apart.