…or (un)happy enough to take time out of their day to write an online review?
knitr::opts_chunk$set(echo = FALSE, collapse=TRUE)
# load libraries
library(tidyverse)
library(hrbrthemes)
library(kableExtra)
library(here)
library(markdown)
library(glmnet)
# load raw data
reviews <- read_csv(here("data", "reviews_european_airlines_clean.csv"))
# set theme for plotting
theme_set(theme_ipsum_gs())
The (perceived) quality of human interaction matters more than perks and infrastructure.
With a long-standing fascination for aviation, I was interested in the airline review data sets in the community. However, many analyses seemed to miss the essence of Data Analytics: can we gain deeper insights than descriptive distribution of numbers? Can we ask better questions?
Some analyses felt off: they suggested that a substantial amount of passengers recommended an airline despite giving them the worst rating — “huh, wait, what?”
I’ll therefore focus on these two areas below:
As with any dataset of this type and quality, the insights are limited to and by the nature of the data and results must be treated with a big grain of salt.
Yet, collectively speaking, there is an interesting overall pattern emerging.
Airlinequality.com collects reviews of airline experiences. Passengers rate individual flights on aspects such as cabin service or food, and give an overall recommendation, and can leave a text review.
Khushi Pitroda’s dataset over on Kaggle is a popular set with ~23,000+ reviews. I tweaked their code, which I describe in this Python Notebook.
Note: both airlinequality.com and the original code sadly went offline recently.
My changes & improvements to the existing approach:
The raw data contains the results from a sentiment analysis using Twitter-roBERTa-base. It contains further extracted features that were too instable or quirky for this first analysis.
All data and cleaning scripts are in my Github repository.
The overall timeline shows expected and more subtle patterns:
Whether the last observation is due to a higher proportion of critical reviewers (2016-2019), or whether the industry in general has been suffering from an increasingly negative perception from 2018 onwards is impossible to tell from this data.
It is noteworthy though that the lowest overall ratings occur during the COVID period and it’s recovery phase when disruptions to the industry were highest and customer satisfaction at its lowest.
If we treat the responses to the five main travel aspects as your typical survey response data, a Likert-type presentation will look like this.
Basically, variables that “pull” in both directions are stronger influencing factors.
Three main observations:
Cabin staff service and
Ground service pull strongly in both directions — if
airline employees are perceived as good, passengers will recommend the
airline (and vice versa).Inflight entertainment or
Wifi, if perceived as poor, favour ‘not recommended’. But
the reverse does not hold: passengers who recommend an airline may not
necessarily rate these perks as ‘good’, which suggests a weaker
importance of those factors for an overall recommendation.Value for money behaves similar to the human
aspects: a passenger who does thinks they got their money’s worth will
recommend an airline (and vice versa).For what it’s worth: wifi is generally viewed disfavourably, even in otherwise positive reviews, so either this variable is a candidate for a time-series analysis or the investment in this tech was historically not meeting its prospected target.
Do domestic customers respond differently than international ones? They do!
Three main observations:
The results are not statistically significant for half the airlines, which is likely a data amount issue.
However, the pattern that emerges is clear: It’s probably no coincidence that three of the four airlines which are seen more favourably by international customers are Swiss, and that all Swiss airlines fall into this category.
Of course, the dimensions on which passengers give responses for are individually associated with passenger (dis)satisfaction. The question is whether some dimensions of airline travel are more impactful for positive recommendation than others.
This is where a variable importance analysis comes in handy. It tries to identify the strongest predictors of a passenger recommendation, when controlled for all other factors.
We’ll keep it simple and use only the primary factors from the reviews plus a couple straightforward meta variables. That said, we exclude wifi and travel class, as it’s missing in a lot of the reviews and is also systematically absent from many airlines (e.g. Ryanair, easyJet).
Basically: the longer the bar, the higher the relevance of that factor for a recommendation. Left and right bars distinguish the direction of the effect: to the left favours negative recommendation (and vice versa).
The patterns:
In combination, the patterns for ground service,
multileg, and international customer suggest
that especially passengers who have stuff going wrong during for example
a layover have to engage more with ground and customer service, often in
another country.
While the data is really messy for many methods, there is are clear overall pattern emerging that I found quite insightful. Granted, they may not sound all that surprising, but it’s still interesting to see this clarity in the noise.
Here are my main takeaways:
The exceptions Swiss, Edelweiss & Helvetic have two possible location-specific explanations:
If that was my contribution to a decision-making process: don’t cut the funding for interpersonal and emphatic communications in the air and on the ground.
As with any data set, there are general issues with data quality. I’ll go into a bit more depth on (2):
The first issue is systematic due to the nature of the data; this needs to be kept in mind the choice of method and the interpretation of results. The third issue is the most quirky — but the value of that information for the questions I was interested in was low. Those variables might be useful in future analyses asking different questions.
The second issue is the interesting one: in rarely any of the publicly available portfolio was it identified correctly as an issue with the scraping method, instead suggesting that reviewers hadn’t understood the rating scale. If the issue had been detected at all before throwing fancy Machine Learning at the data.
The plot below shows dots from a LLM sentiment analysis of the review text: Positive-sounding reviews should be associated with high overall recommendations (in general).
This highlights the importance of critical review and extensive data exploration:
Binary ridge regression was used for the variable importance analysis predicting the outcome of ‘recommended’ (yes/no). This method isn’t for feature selection, hence the restriction to the actual review response variables, but used if many of fewer features are highly auto-correlated (when one goes up, so does another).
I use AI — in pretty much the same way I have (always) been using strackoverflow: for inspiration on how to get the code to do what I want it to do.
I am proficiently functional, bordering fluent in R, but I don’t eat and sleep its thousands of cool packages for the varied tasks I use it for alongside all my other tasks, so there’s that.
As for writing, I write all my own stuff. There was a period where I used AI for proof-reading, as to not make me look like a fool when claiming I am a thorough person with attention to detail. But I stopped doing that considering how much time I wasted undoing AI’s patronising suggestions of “style” and “conciseness” — and accepted that I’ll happily live with my own typos in the same way I happily live with everybody else’s typos. They usually result from honest attempts at making a piece of text more legible — it’s not a reflection on anyone’s carelessness.
I have been using the em-dash for decates—nothing to it.