Given a publicly available dataset on airplane departures and arrivals, I had a question: are airplane delays contagious? When one plane is late, what is the effect on the next flight to leave? Will it be less late? More late? Quadratically more late? In other words, how many cinnabons can I expect to get through waiting at the gate for my plane to finally leave the airport?
Answering this question is tricky. It’s not like I can track an airport to see one late flight, then the next, and infer that the first really infected the second. What if there was a storm that made both planes late? Using this dataset, it would be difficult to figure out if and how a delayed flight infects subsequent flights at a given airport. But what about the airport where the delayed airplane lands? Would that be any easier?
It’s not a perfect solution. For one thing, there are circumstances that can affect both airports (a nationwide security scare, for example). Also, oftentimes there are conditions at the destination airport that cause a delayed airplane to be delayed in the first place. In that case, the infection is really running in reverse. The truth is–familiar to many–that with observational data, one can never control all the levers that are driving the behavior of the data. I focus on the destination airport in the hope that by and large, delays at the two airports are unrelated. By looking at a lot of airports over a long period of time (6 months), I hope that potential confounders add only noise to the results–rather than systematic bias.
I also devise a strategy to deal with the reverse infection problem. If on a given day, an airport is experiencing delays before the arrival of a delayed flight, I exclude that airport from the analysis on that day. Having prior delays is an indication that the destination airport might be having issues that could cause delays–unrelated to the delayed airplane that I’m studying. By looking only at airports without prior delays, I keep the waters as calm as I can before the ‘splash’ of the delayed aircraft.
Having decided my approach, it was time to process (i.e. wrangle in R) the data into the form required to answer the question at hand. I’ll spare you the gory details and fast-forward to the interesting part–when I could finally put the variables I was interested in into a scatter plot. When I did that, however, I was left scratching my head…
My data looked like a a strange multi-armed monster. It seemed as though there were two (even three?) trends happening at the same time–one shooting horizontally out along the x-axis, another strange unicorn horn sticking out diagonally, and then (maybe) another trend along the y-axis. My first move was to pore over my code to make sure I did everything correctly. As far as I could tell, the code was working fine. So I was left with a puzzle–how to account for this strange pattern? The explanation turned out to be rather simple. Can you guess the answer without scrolling down for the spoiler? If you can, let’s work together next time 🙂
Thankfully, the dataset includes a variable for the tail number of each aircraft. At first, I didn’t think I was going to use this variable, but after a lot of time staring at the unicorn horn, I thought why not give it a try. It turned out that all the data points in that diagonal trend occur when the two flights are the same plane. In retrospect, it seems rather obvious. And I realize I definitely have a bias in my thinking about airports. Namely, I always think of airports as busy places where tons of planes are landing and taking off all the time. Maybe it’s because I’m from Chicago, which laid claim to having the busiest airport for many years (damn you, Atlanta). It appears that quite often, however, a plane lands and the next plane to take off from that airport is. the. same. plane. Mind = blown.
So the flights that involved the same plane were clearly related, but what about the ones that weren’t? I don’t think they are. I didn’t do anything terribly rigorous to prove this, but I did run several simulations where I shuffled around the x and y values of the scatter plot around at random. When two random variables are independent of each other, you can do this to their values and it shouldn’t change the appearance of the plot very much. I ran nine simulations using the data, which are displayed in the graph to the left. The one on the top-left is the original data–with the diagonal unicorn horn removed.
While it didn’t seem that flight delays were contagious in general, there was a clear trend when consecutive flights involved the same aircraft. Now, this is quite obvious, but what is interesting is that we can comment on the nature of the relationship and try to estimate the size of the effect. In other words, for each minute your aircraft was delayed coming out of its prior airport, how long can you expect to wait at the gate?
From the graph below, we can see that the nature of the relationship is clearly linear. That is good news for air travelers. Why? You’d prefer a linear relationship as opposed to one that was parabolic–or even worse–exponential. At least with a linear relationship, you know that for each minute the aircraft is delayed, you’re paying a constant price.
Since the relationship is linear, I fit a linear model to estimate that price. I controlled for as many factors as I could using fixed effects for airport, day, carrier, and the difference in schedule between arrival and next departure (in 5 minute time blocks). The last effect was important to account for the variation in time between the two flights. Even when the next airplane scheduled to take off from an airport is the same airplane, there are still varying lengths of time until the plane is scheduled to take off again. The other fixed effects in the model can account for idiosyncratic behavior on a particular day across all airports, at a particular airport across all days, or for a particular carrier (across all days and airports). The model I fit included no interaction effects. To cut down on the risk for confounding, I only had one observation per airport per day. As a tradeoff, I couldn’t have interaction effects, because there was no additional variation within an airport on a given day.
In the end, the linear model estimated a significant effect for the variable of interest with a coefficient equal to 0.89. This again is good news for air travelers. Granted, it would be better if there was no effect (or better yet a negative effect) on the delay of the next flight. But as it stands, it’s good that the coefficient is less than 1. That means that for every minute your airplane is late, if your plane is the next plane scheduled to leave the airport, you can expect to be delayed less than a minute (about 53.4 seconds to be exact). Could be worse!
One disclaimer to all of this–which I haven’t investigated further–is how generalizable these findings are to all airports. As I noted, this linear relationship holds when the next aircraft to take off at an airport is the same as the delayed plane that just landed. One might think this tends to happen more at smaller, less busy airports. Therefore, it’s a further question the extent to which intermediate flights (between the arrival and departure of the identical aircraft) might affect the subsequent delay.
If it ends up being longer than 53.4 seconds/minute, I hope your airport has plenty of these:
in your article you state “When two random variables are independent of each other” but I would claim that there is two groups of delays. Independent delays where one flight is delayed for some reason. Missing crew, technical problems etc. And the other group is airport-wide delays like congestion, bad weather etc. I’d assume this could explain the “horns”