The Wide Reaching Effects of Commercial Airline Cancellations

Final Project
Data Science 2 with R (STAT 301-1)

Author

Jonah Rosenberg

Published

December 4, 2024

Introduction

The world of aviation is one that produces a lot of data, and it is always data that I have had a passion for exploring. After spending the previous summer at American Airlines’ Charlotte hub as a Operations Analyst intern, I became enamored with the data created by airlines and sought to discover more of it. This project serves as some of this discovery. Cancellations are a piece of data that have always fascinated me. When an airline has to cancel a flight, they have a logistical nightmare on their hands. They have dozens, often hundreds of angry passengers, an aircraft in the wrong place, a gate that is no longer cleared up, and flight crew all in locations that were not necessarily planned. Because of this, airlines go to great lengths to avoid these cancellations, but what happens when a flight gets cancelled, and what are the outreaching effects of these cancellations, both internally in the operation and externally?

In this project, we seek to answer some of these questions. For detailed data analysis, see Section 2, or Section 5 for concise data citations.

Data Overview and Quality

Flights Dataset

The main dataset used in all parts of this analysis is a mutated dataset of all domestic commercial flights in 2023. The raw data was obtained from the Bureau of Transportation Statistics, and is called Reporting Carrier On-Time Performance1. We combined the dataset to include all months. In addition, I add a couple of additional columns, but most notably, a column that gives the flight code, but considers subsidiaries with separate IATA codes to be under the parent company. I evaluate the data like this because while the airline code is separate, a subsidiary of a parent company is still the responsibility of the parent, and poor performance in a subsidiary will be reflected back on the parent company. Likewise for positive performance. For more details about the data manipulation that went into the all flights data set, see the data cleaning script.

1 Data from Reporting Carrier On-Time Performance, US Bureau of Transportation Statistics, Accessed 4 December 2024

Looking at Figure 1, we can see there is some missingness in places where we expect it. Our first two columns represent a classic cancelled flight, one of which also has a tail number missing, which likely suggests the flight was cancelled before it was even assigned a tail number. The next three cases are slightly more ambiguous, and require individual investigation, but it is likely the case that the final three columns are cases where the aircraft departed from the gate and later came back, thus why it is not missing a departure time. This information becomes irrelevant, however, because we look to cancellations for our analysis, which is given by an indicator variable in our dataset.

Figure 1: Exploring Joint Missingness in Flights Dataset

In terms of size, our flights dataset has 6,847,899 observations representing over 6 million commercial domestic flights in 2023. It features 8 numeric variables, 4 character variables that are usually coerced into either time or numeric variables for calculations involving flight time, 5 character variables, 2 more numeric variables that are indicator variables for cancellations and diversions, which are treated as factors during evaluation, and finally, one date variable.

Stock Datasets

In addition to the above, I create two datasets to evaluate stock data. Both are considering American Airlines group stock, (AAL), because it was the most readily available. The first is a dataset with 365 rows representing 365 days in 2023, and columns representing AA’s operational performance, as well as AA’s stock performance. It has columns such as stock change over that day, as well as the change over the next three days. In terms of operational performance, we look mostly at cancellations as a number, and the proportion of AA’s cancellations compared to the industry. It pulls raw AA stock data from Kaggle2. There are 8 variables in this dataset, including 1 date variable, and 7 calculated numeric variables.

2 Data from American Airlines Group Inc. (AAL) Stock Perforance, Kaggle, Nitiraj Kulkarni, Accessed 4 December 2024

3 Data from S&P 500 Stocks (daily updated), Kaggle, Larxel, Accessed 4 December 2024

Another similar dataset created is the same as above, except instead of just looking at AA’s stock price in a vacuum, we attempt compare it to the market as a whole, or in this case, we normalize it against the S&P 500 index. In this dataset, you’ll find operational columns to be the same, still with 365 rows, but instead of AA stock price performance, there are metrics about AA’s over or under performance compared to the S&P 500. The motivation for this is given in Section 3.2.3. The raw data for S&P stock prices are pulled from Kaggle3. There are 5 variables in this dataset, including 1 date variable, and 4 calculated numeric variables.

Explorations

Cancellation Spikes

One could likely infer that cancellations are not uniformly distributed, but exactly how are they distributed? In this section we explore the distribution of cancellations throughout the year and throughout different airports.

Proving the existance of “cancellation spikes”

Looking at Figure 2, we can see that throughout the year, the cancellation of commercial flights is not uniform. This should not come as surprising, as weather is likely the most intuitive reason flights would be cancelled at different rates at different times of the year. Indeed, Figure 2 confirms this because some of our highest spikes are in the winter months with snow, and the summer months with rain.

Figure 2: US Domestic Flights Cancelled by Day

Looking at one airport in particular, LGA, the airport with the most cancellations in 2023, we can see that their cancellations are have even higher peaks and valleys than the national trends. (Figure 3)

Figure 3: LGA Domestic Flights Cancelled by Day

The next steps are to see if airports in differing climates and that serve different major US airlines spike together.

Airports spike together

So we just observed that cancellations spike. Thus, there is no uniform distribution of cancellations. As a somewhat stronger conclusion, though, Figure 4 implies that a lot of the most cancelled days of the year were bad days for many airports together. Perhaps that can indicate weather, perhaps that can indicate outages elsewhere in the system.

Figure 4: Cancellations by Day among the top 9 most cancelled airports in 2023

Case Study - United Airlines in the Summer

Zooming in on a particular example, we can see that in June of 2023, United’s four biggest hubs shared a spike in cancellations right around the end of June. (Figure 5) Does this signify bad weather at all four of these hubs? Possibly. What it more likely signifies, however, is a collapse in the United network. We verify this latter claim by comparing this performance to the performance of non-United flights at these same airports.

Figure 5: United has a major spike in cancellations in late June at their 4 most major hubs

Figure 6 shows that what we see here is that likely that the spike in United cancellations on those late June days is representative of EWR having a bad performance day, which impacted the system as a whole because aircraft have to go from one airport to the other. While those days were just another day for IAH and ORD as a whole, with a slight spike in DEN, the number of United cancellations is completely not proportional in any of the other cases.

Figure 6: United and Non_United cancellations in Summer 2023 at United’s Big 4 Hubs

Saying something about this trend at large

Based on the correlations in Table 1, we can see that considering both the airline and airport cancellations is much more valuable than considering either one.

Table 1: Correlation Between Airline, Airport, Both, and the number of Cancellations
Variable Cancellations Total Airport Cancellations Total Airline Cancellations Total Airline + Airport Cancellations
Cancellations 1.0000000 0.1370066 0.0332604 0.2662942
Total Airport Cancellations 0.1370066 1.0000000 -0.0835913 0.5153551
Total Airline Cancellations 0.0332604 -0.0835913 1.0000000 0.1264691
Total Airline + Airport Cancellations 0.2662942 0.5153551 0.1264691 1.0000000

Summary

The key takeaway from this section is twofold. First, and more basically, is that cancellations are not uniform. From a customer perspective, this means that a passenger should not go to the airport and expect that the chance their flight gets cancelled today is exactly the same that it was yesterday. The second takeaway is how to best guess cancellation chances. Obviously, one should be looking at weather to predict if their flight may get cancelled, but perhaps just as indicatively, one should be looking at performance of the airline around the country, because bad weather in another major hub could have just as detrimental of an effect.

We build on what else should be taken into account from a customer perspective in future sections, but from a business perspective, the takeaway here is that to maximize the spread of cancellations, it may be best to spread out aircraft across hubs, rather than operate out and back routes starting and ending at the same hub. This of course depends on whether or not spreading cancellations across the system is an optimal strategy for a given airline, but if it is, than out and back routes are certainly not ideal.

Stock Performance

Is it possible that a bad day for an airline has affects on their stock price? If yes, what qualifies as a bad day? Surely it will have something to cancellations, but are we looking at days with a lot of cancellations, or where the airline in question led the industry in delays by a significant margin? In my analysis, I work towards analyzing both of these qualifications. Furthermore, is it possible that we do not see an immediate fall in stock price? Perhaps we see a lagging stock price fall effect, where after looking several days ahead, there is a fall in stock price. This information could be used to tell investors whether a particular airline is experiencing a temporary fall due to a bad cancellation day, or if they should actually consider selling or buying stock. Before we look at any of that, however, it is critically important to understand what we are testing.

Understanding what we’re testing

So we can see in Figure 7 it is super variable. On some days, American Airlines makes up over 80% of the cancellations for that day, while it averages out around 20%.

Figure 7: Daily Proportion of American cancellations against the Industry

Using Correlation Testing

The logical next step to test if operational performance in the form of cancellations impacts stock price is to compare stock prices on days with high and low volumes of cancellations. After a lot of cleaning, we can dissect Figure 8. We can see that there are positive correlations between the difference in the price of a stock after one and three days, and the proportion and total number of cancellations had by AA. This is actually the opposite of what we would like to prove. This seems to suggest, that at a very weak level, as cancellations are prevalent, the stock price over three days is more likely to improve. The strongest correlation (of those relevant) is between the stock difference three days out and the number of cancellations, but the proportion of cancellations also has a slightly positive correlation with both one day stock change and three day stock change. Graphically, this is marginally confirmed. None of the graphs look particularly strong in terms of a linear relation, but they also do not look strong enough to have any other non-linear relation. We can realize that one element we may want to take into account is the AA stock performance relative to some sort of index. Maybe AA stock had a great increase one day because that is the direction the market as a whole moved. What we really should be looking at is if AA market underperformance is a sign of cancellations.

Figure 8: Correlation Testing between AA Stock Data and Cancellations

Normalizing against the S&P 500

After we do our analysis of AA stock data outperformance of the S&P 500 Index, which we can assume to be representative of the market as a whole, we still do not quite get the correlations we’re looking for, and in fact, still get the opposite (Figure 9). This graph can be read largely the same as the above, except instead of looking at stock metrics for AA stock alone, we are comparing AA stock with the S&P Index for one and three day windows.

Figure 9: Correlation Testing between AA Outperformance of the S&P and Cancellations

So it turns out even when comparing AA stock data to the S&P 500, when AA stock outperforms, it is both more likely to have been a bad AA cancellation day, and have been a bad day for AA compared to the system. This is counterintuitive and we offer no solution as to why this is, but it would be a source for further research.

Summary

It is very simple in this case. Only relevant for investors, do not base airline investment decisions on operational performance, or at least not on cancellations.

Flight Length effect on Cancellations

The purpose of this exploration will be to see if an airline is more or less likely to cancel a longer haul flight as opposed to a short hop. Because we are only looking at domestic flights, it is likely that there will not be too many Ultra Long Range (ULR) flights, with exceptions being given to flights outside of the contiguous United States. In any case, it is a worthy investigation because we can see if passengers on shorter or longer flights ought to worry more about their flight getting cancelled.

Because we are given times in terms of local times, we can not evaluate flights by scheduled departure and arrival times, because that does not take time zone jumping into account. Instead, we will examine only flight distances.

In Table 2, we can see that flights that are cancelled have slightly shorter distances in all places on the distribution. This difference is confirmed by Figure 10. While there certainly is a trend for shorter flights to be the more likely ones to get cancelled, this is overall a much weaker relationship than some of the other ones that have been discussed and will be discussed, as the distances are much closer to each other than what would be required to draw a very strong conclusion from this.

Table 2: Exploring the Flight Distance Distribution between Cancelled and Non-Cancelled Flights
Cancelled Indicator Median Distance Mean Distance First Quartile Distance Third Quartile Distance
0 679 833.9564 399 1068
1 642 776.6160 358 1014
Figure 10: Denisty Plot of average Distance of Cancelled and Non-Cancelled Flights

Summary

Once again, it is quite simple in this case. From a passenger perspective, when flying on a shorter flight, one can expect a flight of this nature to more likely be cancelled. This is likely because the longer the flight, the more revenue it costs the airline to cancel it.

Upline Cancellations and Schedule Degradation

Although this is a project about flight cancellations, part of understanding how flights get cancelled is their delay path that they take earlier in the day. For example, I hypothesized that it is more likely for a flight to get cancelled if the aircraft it is operated on had already been delayed earlier in the day. We will build up to proving or disproving this claim in this section.

Schedule Degradation

A very standard industry term, schedule degradation refers to the phenomenon that throughout the course of the day, flights will be more greatly delayed as the day goes on. This is because a high proportion of aircraft are scheduled on what is called MOGT (Minimum on ground time). This means that the least possible time that the plane is required to be on the ground in order to successfully turn it is the time that the airline will allot. Because of this, if just one delay occurs early in the day, it will cause a ripple effect throughout the day for all flights on that aircraft. We prove this in Figure 11.

Figure 11: Number of Scheduled and Actual Departed Flights by Time of Day

So we can see that past the 8 pm hour, we have way more departing flights than scheduled because flights earlier in the day got delayed. Now let’s do some calculations to prove that we can correlate this to tail number.

Exploring by Aircraft

So we have looked at operations as a whole breaking down as the day goes on, but can we track individual aircrafts’ movements throughout the day? For this we need to discuss inherited delay.4 This term refers to how late or early the arriving aircraft meets the gate relative to when it was supposed to. For example, if an inbound flight arrived 30 minutes past when it was supposed to, the next flight using that aircraft, (or tail number), would have an inherited delay of 30 minutes. There is a dense congregation of flights with an inherited delay of 0, which could represent that the inbound flight arrived exactly on time, but more commonly represents the first flight of the day on that aircraft. In this case, we can still evaluate its inherited delay, but we consider it 0 minutes. We can see in Figure 12 that as the delay inherited by a flight increases, so too does their expected delay, especially when the inherited delay is above 0. This makes sense. An inbound flight arriving earlier than expected does not really have any implications on how late the outbound flight takes off, because the aircraft still has to wait for all passengers to arrive, whereas an inbound flight arriving late heavily determines when the outbound flight can take off.

4 Note, all inherited delay logic is based off of a random sample of 500 tail numbers. This is due to the computational intensity of performing computations on every flight compartmentalizing by tail number.

Figure 12: Comparing Inherited Delay with Departure Delay of Flights
Figure 13: Comparing Inherited Delay with Arrival Delay of Flights

So we can see both arrival and departure delays are heavily influenced by the inherited delay of the aircraft coming in (arrival delays claim can be seen by Figure 13). Let’s see if cancellations are also dependent on the inherited delay, but first lets examine to see if schedule degradation also has an analogous phenomenon for delays, not just cancellations.

Cancellations by Time of Day

We should look to see if a similar phenomenon to schedule degradation with delays in terms of cancellations. For this, we can observe in Figure 14 that this appears to be the case in that the later a flight gets, the more likely it is to be delayed.

Figure 14: Percentage of Flights Cancelled by Hour of Day

We omit before 4 am because there are so few flights that take off then that the data are not super relevant.

We hypothesize the reason cancellations actually go down at the beginning of the day is because a lot of early morning flights operate on ultra low load factor (ULLF), so airlines will cancel them and roll over the passengers scheduled to the next flight if there are issues, as opposed to just delaying the flight until the issues are resolved.

The Key Question

As a reminder of what we set out to do, we are looking to prove delays and cancellations in upline flights effect the downline flights.

We can see in Figure 15 that cancelled flights are much more likely than non-cancelled flights to have received a positive inherited delay, they’re much more likely to have inherited a non-zero delay. This likely means that most cancelled flights were not the first leg of the day on that aircraft to fly. Table 3 confirms this finding. We can see that while the mean inherited delay of a non-cancelled flight was only two minutes, cancelled flights had, on average, a staggering 40 minutes of inherited delay.

Figure 15: Distribution of Inherited Delay based on cancelled and non-cancelled flights
Table 3: Exploring the Inherited Delay of Cancelled and Non Cancelled Flights
Cancellation Indicator Mean (Inherited) Delay Median Delay First Quartile Delay Third Quartile Delay
0 2.270879 0 -13 1
1 41.590626 0 -4 38

In summary, it seems the amount of inherited delay is related with cancellation probability. The more delayed the inbound flight, the more likely that aircraft is to be cancelled in the next leg.

What about if cancellations on that aircraft make it more likely for the aircraft to take a downline cancellation? Let’s find out if an aircraft having previously taken a cancellation that day makes it more or less likely for it to take another one.

Table 4 and Table 5 seem to be suggesting similar information, so let’s understand the differences between the two. In Table 4, we can realize that on a flight where the previous flight using that aircraft was cancelled, over 40% of flights of this nature themselves become cancelled. These represent flights on aircraft that have likely been sitting at the gate for a while, as their previous leg was cancelled, so the aircraft could not have gone anywhere (at least commercially). Table 5 looks at the total number of cancellations an aircraft has taken on a given day, and explores the proportion of flights of that nature that themselves go on to get cancelled. What we see is that having a previous cancellation on the same aircraft should be an extreme cause for concern, as after more than one cancellation on that aircraft, it is more likely than not that the next flight on that aircraft will be cancelled.

Table 4: Exploring the Outcome of Flights where the Previous Leg was Cancelled
Previous Leg Cancelled Indicator Proportion Cancelled
0 0.0076380
1 0.4006196
Table 5: Exploring the Outcome of Flights based on How Many Cancellations the Aircraft has Taken for the Day
Aircraft Cancellations for the Day Proportion Cancelled
0 0.0019735
1 0.4117821
2 0.5388687
3 0.6882883
4 0.7487179
5 0.7358491
6 0.6538462
7 1.0000000
8 1.0000000
9 1.0000000

Summary

Perhaps the strongest relationship we have looked at thus far, passengers should be extremely wary of circumstances on that aircraft when evaluating the likelihood of their flight being cancelled. What we see, is that for passengers who want to arrive at their destination as on time as possible (and avoid cancellation chances), early morning flights should be a go to. In addition, if a passenger is on a flight that had an inbound delay, or even worse, an inbound cancellation, the passenger should adjust their expectations accordingly.

From a business perspective, it the cost of taking cancellations due to upline delays should be evaluated and the schedule should be adjusted accordingly. This means that if taking a cancellation because of an upline delay is more costly than scheduling one more flight on the aircraft for the day, the schedule should change to have one less flight on that aircraft. That would alleviate pressure, taking more flights off of MOGT status, and also save money. This question can not be answered without some serious financial reporting, however.

Conclusion

Key Insights

While each exploration provides their own insights, we can summarize them here.

Cancellations are not uniformly distributed. This becomes the basis for the entire rest of the project, but realizing this allows us to leverage certain trends in cancellation occurrences to realize wide reaching effects of these cancellations.

While internally in the operation, cancellations can lead to other operational breakdowns (the converse of this is also true), the cancellations tend not to leave the operation in terms of their affect on stock price.

While flight length certainly has a relationship with cancellations, it is not a particularly strong one. Shorter flights are more likely to be cancelled than their longer counterparts, but not by so much that it is a conclusion that we feel comfortable making.

On the contrary, a very strong conclusion is that upline flights play a huge role in a flights timeliness. Inherited delays and cancellations present a huge problem for getting a flight off the ground on time, or in some cases, getting a flight off at all. A passenger should glean from this section that to maximize punctuality, they should take an early flight.

Surprises

There was one major surprise for me, and then several smaller interesting results I was not expecting. First is the fact that there is absolutely no correlation between stock prices and operational breakdown days, and if there is, it is a positive one. After adjusting for market variation, I thought I had solved the “problem” of seeing no correlations, but I was underwhelmed to see that this did not “fix” anything. In the end, it is no problem to report that no relation was observed, but it would have been a more satisfying project if such a relationship existed.

A couple of minor fascinating conclusions was how strong Section 3.4 was as a whole. I was expecting strong relations in that section, but not as strong as what was observed. I was also surprised to see that after 60 minutes of inherited delay, departure delay actually goes down between 60 and 120 minutes of inherited delay. This is not shown in Figure 12, but the result is there nonetheless. I have no explanation for it. Finally, I was not expecting LGA to have the most cancellations of any airport. It makes a little more sense considering we are only looking at domestic departures, but I would have expected a big legacy hub like ATL, DFW or EWR to have the worst performance in this regard.

Future Work

To do future work on this project, there are two more main elements of data that can be used to draw some legitimate conclusions on our findings. First is flight Load Factor. For example, when in Section 3.4.3 we discuss how early morning flights are often operated at ULF, having load factor data would help to prove or disprove this assumption.

Secondly, having monetary data would also be preferable so we could perform some CBAs. Particularly, in sections like Section 3.1.5, and Section 3.4.5, it would be advantageous from a business perspective to know thee cost of cancellations and delays as well as the cost of these things at various airports, because they are certainly not all the same.

References

Flights Data from Reporting Carrier On-Time Performance, US Bureau of Transportation Statistics, Accessed 4 December 2024

AAL Stock Data from American Airlines Group Inc. (AAL) Stock Perforance, Kaggle, Nitiraj Kulkarni, Accessed 4 December 2024

S&P 500 Data from S&P 500 Stocks (daily updated), Kaggle, Larxel, Accessed 4 December 2024

Articificial Intelligence Disclosure

Generative AI helped with the following:

  • Help generate the idea for how to prove correlation between airport and airline + airport in Section 3.1.4. The idea was my own as was much of the coding, but the realization of the coding was the AI.

  • Generating that code to fix the lead() function bug I was experiencing in Section 3.2.2.

  • Coming up with the methodology to calculate inherited_delay in Section 3.4.2, and in Section 3.4 as a whole.