Measuring Flight Lateness and Proving a Fix Actually Works
Statistics & ExperimentsModel answerLast updated
Define lateness metrics, model how often and how badly flights run late, and choose a valid design and inference method to show an operational change reduced delays.
You are the data scientist supporting operations at a large passenger airline. Leadership has rolled out a new process intended to cut delays (for example, a revised turnaround procedure at certain airports). You have historical records for every flight, including scheduled and actual departure and arrival times, airport, route, aircraft, and weather.
Answer the following as you would in a live discussion:
- Measurement. How would you define and quantify "delay" from this data? Which metrics would you report, and what would you look at first to understand the shape of the data?
- Modeling. How would you model delays, both the probability that a flight is late and how late it is? Which features and which validation strategy would you use?
- Evaluation. How would you determine whether the new process significantly reduced delays? Name the study design, the statistical tests or confidence intervals you would pick for each type of metric, and the pitfalls that could make a naive comparison misleading.
Be explicit about assumptions, and present results as an effect size with an interval, not only a p-value.
Hints
Hint 1
Delay data is not bell-shaped: think about early arrivals, a pile-up near zero, and a long right tail. Which summary statistics survive that?
Hint 2
Splitting the question into 'how often is a flight late' and 'how late is it when it is late' suggests a two-part model, and a mitigation may help one part but not the other.
Hint 3
Flights on the same day, at the same airport, or on the same aircraft are not independent. Think about what that does to standard errors, and about a design (randomization by cluster or difference-in-differences) that handles non-random rollout.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Overview
A strong answer does three things in order: pins down the metric, builds a model that respects the odd shape of delay data, and then treats "did the fix work?" as a causal design problem rather than just a significance test.
1. Define and quantify delay
Different definitions answer different questions, so agree on them first.
| Metric | Definition | Use |
|---|---|---|
| Arrival delay (min) | actual minus scheduled arrival (can be negative) | Customer-facing |
| Departure delay (min) | actual minus scheduled pushback | Operational, drives propagation |
| On-time rate | share of flights with arrival delay of 15 min or less | Simple headline KPI |
| Tail metrics | p90/p95 delay, share delayed over 60 min | Misconnects, crew limits, compensation cost |
| Delay by cause | carrier, weather, air traffic system, late inbound aircraft | Which levers the airline controls |
First look at the data: histogram and ECDF of arrival delay (expect a spike near zero, many early arrivals, a long right tail, mean well above median); breakdowns by hour, airport, route, aircraft type, season; and autocorrelation, since a late inbound aircraft delays the next leg and bad weather hits every flight at a hub.
Main message: the mean alone misleads. Report median, on-time rate and p90 together.
2. Model delays
- Two-part (hurdle) model. Logistic regression for P(delay > 15 min | x), then a Gamma or log-normal GLM for delay size among late flights. Expected delay is the product. This separates frequency from severity.
- Quantile regression when the tail is the concern (p50, p90) with no distributional assumption.
- Mixed-effects model with random intercepts for airport, route and tail number, giving honest standard errors and shrinkage for small airports.
- Time-series model (SARIMA, Prophet, or regression with seasonal terms) on daily aggregates for weekly/holiday seasonality and as the baseline for an interrupted time-series analysis.
Features: scheduled hour and weekday, inbound aircraft delay (usually the strongest predictor), turnaround buffer, scheduled operations per hour, weather at both ends, load factor, aircraft type.
Validation: split by time (train early, test later), never randomly, to avoid leakage across correlated flights. Report MAE in minutes, and AUC plus calibration for the late/not-late probability. Do not use features only known after departure if the model is meant to predict before it.
3. Did the mitigation work?
Design first. A raw before/after comparison is confounded by season, weather and schedule changes.
-
Best: randomize by cluster (airport or route group, or alternating weeks). Individual flights cannot be randomized because they share gates, crews and aircraft.
-
If rollout was not random: difference-in-differences,
Delay = α + β·Treated + γ·Post + δ·(Treated × Post) + Xθ + ε
where δ is the effect. Control for weather, hour and route fixed effects, cluster standard errors by airport (or airport-day), and check parallel pre-trends with an event-study plot.
-
No clean control group: interrupted time series against a seasonal forecast, or synthetic control built from untreated airports.
Choosing the test by metric:
| Metric | Method |
|---|---|
| Mean delay | Welch t-test or regression coefficient with cluster-robust SEs |
| On-time rate | Two-proportion z-test, CI on the difference (Newcombe or Wald) |
| Median / p90 | Cluster or block bootstrap CI; quantile regression |
| Whole distribution | Mann-Whitney U (location shift), KS test (any change) |
| Same routes before vs after | Paired t-test or Wilcoxon signed-rank on route-level means |
Hypotheses: H0: effect ≥ 0 versus H1: effect < 0 (one-sided only if pre-registered), at α = 0.05.
4. Worked example: the clustering trap
Suppose on-time rate goes from 78% to 81%, with 20,000 flights in each period.
Naive standard error:
SE = sqrt(0.78·0.22/20000 + 0.81·0.19/20000) ≈ 0.0040, so the 95% CI is 0.03 ± 1.96·0.004, about [2.2%, 3.8%].
That looks decisive, but flights on the same day share weather. With m = 500 flights per day and intra-day correlation ρ = 0.02, the design effect is 1 + (m − 1)ρ ≈ 11, which inflates the SE by about 3.3 to roughly 0.013. The corrected CI is about [0.4%, 5.6%]. The effect is probably positive, but far less certain. Analyzing at day level, or using DiD with clustered errors, gives the same honest answer.
A good summary for leadership: "The change is associated with roughly a 3-point gain in on-time rate (95% CI 0.4 to 5.6) after adjusting for weather and season, and p90 delay fell by several minutes (bootstrap CI reported)." These numbers are illustrative.
5. Power and rigor
- Power analysis before launch for the smallest effect that matters (say 2 points of on-time rate), inflated by the design effect. This often means weeks of data, not days.
- Pre-register a primary metric. If you examine mean, median, p90, on-time rate and every airport, correct for multiple comparisons (Bonferroni or Benjamini-Hochberg).
- Regression to the mean. Fixes are often launched after a bad month, so some improvement happens regardless.
- Spillovers. Improving a hub can help downstream untreated airports, biasing DiD toward zero.
- Novelty and seasonality. Run long enough to cover weekly cycles and check the effect persists.
- Practical vs statistical significance. Translate into delay minutes saved and cost.
Common mistakes
- Running a t-test on raw flights as if they were independent.
- Reporting only the mean of a skewed, zero-heavy variable.
- Random train/test splits on time-ordered, correlated data.
- Claiming causality from a before/after comparison with no control group.
- Reporting a p-value without an effect size and interval.
- Using many metrics and cutting by many segments without multiplicity control.