Science, Irving K. Barber Faculty of (Okanagan)
Computer Science, Mathematics, Physics and Statistics, Department of (Okanagan)
DSpace
UBCO
Sim, Hong-Jiang
Master of Science - MSc
University of British Columbia
The COVID-19 pandemic has wreaked financial devastation for airlines. As travel restrictions eases, it is important for airlines to gather and assess the opinions of passengers in order to meet new expectations. With the availability of online electronic platforms, it has become feasible to collect customer reviews on a large scale. Collecting, processing and deciphering textual data remain a challenge to most. This thesis details the collection of textual review data from SkyTrax and Trip Advisor. Subsequently, it demonstrates the use of quantitative sentiment scoring of the textual reviews, exploratory data analysis and statistical modelling to ascertain factors that affect passenger perceptions of airlines services. Specifically, we developed a linear mixed model with passengers and airline as random to rank various airlines with respect to sentiment scores, while confirming fixed factors which affect these scores. The application of this model allows for interpretability to the expectations and recommendations made by various passengers of airlines, measures the performance of airlines with respect to customer experience.
Sentiment Analysis of AirlinesReviewsbyHong-Jiang SimB.Sc., Simon Fraser University, 2015A THESIS SUBMITTED IN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF SCIENCEinThe College of Graduate Studies(Computer Science)THE UNIVERSITY OF BRITISH COLUMBIA(Okanagan)January 2023© Hong-Jiang Sim 2023The following individuals certify that they have read, and recommend tothe College of Graduate Studies for acceptance, a thesis/dissertation titled:SENTIMENT ANALYSIS OF AIRLINE REVIEWSsubmitted by HONG-JIANG SIM in partial fulfillment of the requirementsof the degree of Master of Science.Examining Committee:Dr. Paramjit Gill, Irving K. Barber Faculty of ScienceSupervisorDr. Fatemeh Fard, Irving K. Barber Faculty of ScienceCo-supervisorDr. Jeff Andrews, Irving K. Barber Faculty of ScienceSupervisory Committee MemberDr. Irene Vrbik, Irving K. Barber Faculty of ScienceSupervisory Committee MemberDr. Anas Chaaban, School of EngineeringUniversity ExamineriiAbstractThe COVID-19 pandemic has wreaked financial devastation for airlines. Astravel restrictions eases, it is important for airlines to gather and assess theopinions of passengers in order to meet new expectations. With the availabil-ity of online electronic platforms, it has become feasible to collect customerreviews on a large scale. Collecting, processing and deciphering textual dataremain a challenge to most. This thesis details the collection of textual re-view data from SkyTrax and Trip Advisor. Subsequently, it demonstratesthe use of quantitative sentiment scoring of the textual reviews, exploratorydata analysis and statistical modelling to ascertain factors that affect pas-senger perceptions of airlines services. Specifically, we developed a linearmixed model with passengers and airline as random to rank various airlineswith respect to sentiment scores, while confirming fixed factors which affectthese scores. The application of this model allows for interpretability to theexpectations and recommendations made by various passengers of airlines,measures the performance of airlines with respect to customer experience.iiiLay SummaryUnderstanding customer perceptions towards an airline is vital in ensuringthe longevity of the business and that customer expectations are met. Fol-lowing a travel experience, customers may provide feedback through onlinereviews. This thesis outlines the methodology of collecting and processingtextual data at large scale. Further, we utilized statistical modelling to helpus understand if customer expectation differ for the services provided byairlines. The model helped us determine and rank the performance of theairlines based on sentiment.ivPrefaceThis thesis titled “Sentiment Analysis of Airline Reviews” attempts to demon-strates the use of empirical sentiment scoring methodology on textual dataand mixed effects model to surface understanding of factors, such as seatclass and COVID, that affect airline passenger expectations and recommen-dations with respect to the services provided by the airline industry. Thework done in this thesis has been written and developed in collaborationwith my supervisor Dr. Paramjit Gill. The ideas of this thesis are origi-nated by myself and directeed by my supervisor. Dr. Gill has assisted inthe writing of the preliminaries mentioned in Chapter 1. This thesis hasbeen written to fulfill the graduation requirements of the Computer ScienceGraduate Program at the University of British Columbia, Okanagan campus(UBCO).This work started out with the collection of airlines textual review datafrom public consumer opinion portals such as SkyTrax and Trip Advisor,where I developed my own web-scraping algorithm in R to extract specificfeatures and contents of the reviews at large scale. After processing thelarge scale textual data into readable format, I then empirically scored thecontents of review using the Quantitative Discourse Package developed byTyler Rinker. Through exploratory data analysis, I discovered insights andtrends of sentiment scores over time, which helped me better understandthe differences in sentiment scores on different factor levels. The findings ofthe exploratory data analysis can be found in Chapter 2. With the directionof my supervisor, Paramjit Gill, I have explored the Linear Mixed Effectsmodels and have researched literature related to this topic. The usage oflinear mixed effects model allowed us to confirm significant fixed factors, aswell as to partition the variability of the sentiment scores of reviews. Further,we were able to rank airline performances with respect to sentiment scoresby setting airlines as a random factor. Results of the modelling efforts arefound in Chapter 3 of this thesis.vTable of ContentsAbstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiiLay Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ivPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vTable of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . viList of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viiiList of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xAcknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Sentiment Analysis . . . . . . . . . . . . . . . . . . . . . . . 41.2 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.1 The Quantitative Discourse Analysis Package (qdap) 81.3 Thesis Summary . . . . . . . . . . . . . . . . . . . . . . . . . 132 Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . 152.1 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . 152.2 SkyTrax Findings . . . . . . . . . . . . . . . . . . . . . . . . 212.3 Trip Advisor Findings . . . . . . . . . . . . . . . . . . . . . . 353 Statistical Modeling . . . . . . . . . . . . . . . . . . . . . . . . 453.1 Linear Mixed Models . . . . . . . . . . . . . . . . . . . . . . 453.2 The SkyTrax Data Analysis Results . . . . . . . . . . . . . . 473.3 Trip Advisor Data Analysis Results . . . . . . . . . . . . . . 593.4 The Combined Platform Data Analysis Results . . . . . . . . 71viTable of Contents4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864.1 Revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 90References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91AppendicesA SkyTrax Data Collection Code . . . . . . . . . . . . . . . . . 95B Trip Advisor Data Collection Code . . . . . . . . . . . . . . 105viiList of Tables1.1 List of default valence shifters contained in the qdap library . 102.1 Summary of the airline reviews data curated from SkyTraxand Trip Advisor websites . . . . . . . . . . . . . . . . . . . . 152.2 Summary of reviews counts by seat type for SkyTrax . . . . . 182.3 Summary of reviews counts by seat type for Trip Advisor . . 192.4 Total count of reviews by airline for SkyTrax . . . . . . . . . 222.5 Count of reviews by country of the reviewer for SkyTrax . . . 232.6 Summary statistics of sentiment scores by review rating forSkyTrax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.7 Summary statistics of sentiment scores by review rating andseat type for SkyTrax . . . . . . . . . . . . . . . . . . . . . . 272.8 Summary statistics of sentiment scores by seat type and COVIDfor SkyTrax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.9 Summary statistics of sentiment scores by seat type and air-line dummy for SkyTrax . . . . . . . . . . . . . . . . . . . . . 302.10 Total count of reviews by airline for Trip Advisor . . . . . . . 362.11 Summary statistics of sentiment scores by review rating forTrip Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . 382.12 Summary statistics of sentiment scores by review rating andseat type for Trip Advisor . . . . . . . . . . . . . . . . . . . . 402.13 Summary statistics of sentiment scores by seat type and COVID-19 period for Trip Advisor . . . . . . . . . . . . . . . . . . . . 413.1 Summary of the fixed-effects parameter estimates and statis-tics characterizing model fit for SkyTrax data . . . . . . . . . 503.2 95% Confidence Interval for the parameters of the randomintercept model for SkyTrax data . . . . . . . . . . . . . . . . 523.3 Variance components of the random intercept model for Sky-Trax data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.4 Variance components of the nested random intercept modelfor SkyTrax data . . . . . . . . . . . . . . . . . . . . . . . . . 53viiiList of Tables3.5 Conditional Mode of the random effects for the random in-tercept model, each airline is an intercept . . . . . . . . . . . 563.6 Summary of the fixed-effects parameter estimates and statis-tics characterizing model fit for Trip Advisor data . . . . . . 623.7 95% Confidence Interval for the parameters of the randomintercept model for Trip Advisor data . . . . . . . . . . . . . 633.8 Variance components of the random intercept model for TripAdvisor data . . . . . . . . . . . . . . . . . . . . . . . . . . . 643.9 Variance components of the nested random intercept modelfor Trip Advisor data . . . . . . . . . . . . . . . . . . . . . . . 643.10 Conditional Mode of the random effects for the random in-tercept Model, each airline is an intercept . . . . . . . . . . . 683.11 Summary of the fixed-effects parameter estimates and statis-tics characterizing model fit for the combined data of SkyTraxand Trip Advisor . . . . . . . . . . . . . . . . . . . . . . . . . 733.12 95% Confidence Interval for the parameters of the randomintercept model for the combined data of SkyTrax and TripAdvisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753.13 Variance components of the random intercept model for thecombined data of SkyTrax and Trip Advisor . . . . . . . . . . 763.14 Variance components of the nested random intercept modelfor the combined data of SkyTrax and Trip Advisor . . . . . 763.15 Conditional Mode of the random effects for the random in-tercept Model, each airline is an intercept . . . . . . . . . . . 803.16 5 airlines of each platform with the highest prediction scores . 843.17 5 airlines of each platform with the lowest prediction scores . 854.1 Summary of the fixed-effects (fitted without three-way in-teractions) parameter estimates and statistics characterizingmodel fit for the SkyTrax data . . . . . . . . . . . . . . . . . 874.2 Summary of review counts of Hainan and Aeroflot airlines byplatform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89ixList of Figures2.1 A screenshot of SkyTrax review by a passenger who flew onBusiness Class with Singapore Airlines from Singapore toBangkok. Screenshot available from https://www.airlinequality.com/airline-reviews/singapore-airlines/page/2/?sortby=post date%3ADesc&pagesize=100 . . . . . . . . . . . . . . . 172.2 A screenshot of Trip Advisor review by a passenger who flewon Economy Class with Air Canada from Canada to Finland.Screenshot available from https://www.tripadvisor.com/Airline Review-d8728998-Reviews-Air-Canada . . . . . . 202.3 Time series of review counts on the SkyTrax platform . . . . 242.4 Distribution of review counts by review rating and verificationstatus for SkyTrax . . . . . . . . . . . . . . . . . . . . . . . . 252.5 Boxplot of sentiment scores by review rating for SkyTrax . . 262.6 Boxplot of sentiment scores by review rating and seat typefor SkyTrax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282.7 Boxplot of sentiment scores by seat type and COVID pe-riod for SkyTrax. The top grid represents unverified users,whereas the bottom grid represents verified users . . . . . . . 292.8 Boxplot of sentiment scores by seat type and airline dummyfor SkyTrax. The top grid represent unverified users . . . . . 312.9 Smoothed line plot of sentiment scores by seat type and ver-ification status for SkyTrax . . . . . . . . . . . . . . . . . . . 322.10 Boxplot of sentiment scores of airlines for SkyTrax . . . . . . 342.11 Time series of review counts for Trip Advisor . . . . . . . . . 352.12 Count of reviews by review rating for Trip Advisor . . . . . . 372.13 Boxplot of sentiment scores by review rating for Trip Advisor 382.14 Boxplot of sentiment scores by review rating and seat typefor Trip Advisor . . . . . . . . . . . . . . . . . . . . . . . . . 392.15 Boxplot of sentiment scores by seat type and COVID-19 pe-riod for Trip Advisor . . . . . . . . . . . . . . . . . . . . . . . 412.16 Smoothed line plot of sentiment scores by seat type . . . . . . 42xList of Figures2.17 Boxplot of sentiment scores for each airline . . . . . . . . . . 443.1 Residual vs fitted values plot of the‘ random intercept modelfor SkyTrax data . . . . . . . . . . . . . . . . . . . . . . . . . 533.2 Residual vs fitted values plot of the random intercept modelfor SkyTrax data faceted by seat type, verification status andCOVID indicator. Select airlines highlighted in color . . . . . 543.3 95% prediction intervals on the random effects for the randomintercept model for SkyTrax . . . . . . . . . . . . . . . . . . . 573.4 95% prediction intervals on the random effects of continentfor the nested for SkyTrax . . . . . . . . . . . . . . . . . . . . 583.5 Residual vs fitted values plot of the random intercept modelfor Trip Advisor data . . . . . . . . . . . . . . . . . . . . . . . 653.6 Residual vs fitted values plot of the random intercept modelfor Trip Advisor data faceted by seat type and COVID indi-cator. Select airlines highlighted in color . . . . . . . . . . . . 663.7 95% prediction intervals on the random effects for the randomintercept model, shown as a dotplot . . . . . . . . . . . . . . 693.8 95% prediction intervals on the random effects of continentfor the nested random intercept for Trip Advisor . . . . . . . 703.9 Residual vs fitted values plot of the random intercept modelfor combined data . . . . . . . . . . . . . . . . . . . . . . . . 773.10 Residual vs fitted values plot of the random intercept modelfor combined data, select airlines highlighted in color . . . . . 783.11 95% prediction intervals on the random effects for the randomintercept model, shown as a dotplot . . . . . . . . . . . . . . 813.12 95% prediction intervals on the random effects of continentfor the nested random intercept for the combined dataset . . 823.13 Scatterplot of random effects for Trip Advisor against Skytrax. 834.1 A screenshot Trip Advisor review on August 2019 made bypassenger Donald Z who flew on Economy Class with SpiritAirlines. This review had 5-star rating but was scored -0.364by the QDAP algorithm. Screenshot available from https://www.tripadvisor.com/Airline Review-d8729157-Reviews-Spirit-Airlines . . . . . . . . . . . . . . . . . . . . . . . . 88xiList of Figures4.2 A screenshot of Trip Advisor review on July 2019 by passen-ger Pioneer823384 who flew on Economy Class with BritishAirwars. This review had 1-star rating but was scored 0.525by the QDAP algorithm. Screenshot available from https://www.tripadvisor.com/Airline Review-d8729157-Reviews-Spirit-Airlines . . . . . . . . . . . . . . . . . . . . . . . . 89xiiAcknowledgementsMy deepest gratitude goes to Dr. Paramjit Gill for his continual guidanceand unwavering support over the past years of my academic career. I amalso very grateful to my family and friends for their constant support andmotivation.xiiiChapter 1IntroductionPreliminariesThe global airline industry provides service to virtually every country in theworld and has played an integral role in the creation of a global economy(Belobaba et al., 2009). The airline industry itself is a major economy force,in terms of both its own operation and its impacts on related industries suchas aircraft manufacturing and tourism. As mentioned in the Industry HighLevel Group (2019) report, “the aviation’s global stature as an economic en-gine is evident in the statistics. If the global aviation sector were a country,its total contribution (direct, indirect, induced and catalytic) of USD 2.7trillion to the gross domestic product (GDP), and the 65.5 million jobs itsupports, would be comparable to the United Kingdom’s economic size andpopulation”. Aviation contributes to tourism, and in some countries suchas the Maldives which tourism constitutes a large proportion of their GDPfrom tourism. The provision of air transportation service is driven primar-ily by the demand for air travel, as well as the demand for the shipmentof goods by air. All of the interrelated decisions of many stakeholders inthe airline industry stem from the need to accommodate historically grow-ing demand for air transportation, leading to healthy competition amongstairlines (Belobaba et al., 2009).Traditional methods of soliciting information from the customers andconsumers of a product or service are based on consumer surveys. In atypical survey, a (random) sample from the population of consumers is se-lected and they are asked to respond to a bunch of questions. This may bedone through a personal interview such as in a door-to-door survey, througha phone survey or through an electronic communication. The traditionalsurveys are usually focused on some specific issues and are therefore, veryuseful for collecting information about those issues and concerns. However,these kinds of surveys are quite expensive and time consuming. Typically,the business or service provider hires the services of a third party such asprofessional pollsters or a call centre to conduct the survey study. It maytake too long to collect, compile and analyse the information from these1Chapter 1. Introductionsurveys to be useful for any decision making.The International Air Transport Association (IATA) routinely conductsairline customers surveys on specific issues. Recently, IATA commissioned asurvey of recent travellers to find out about the impact COVID-19 on pas-senger perceptions of the industry as well as expected traveling behaviours.The main purpose of the study was to understand better what trends to ex-pect in the near future which would shape guidelines for the industry. TheJ.D. Power North America Airline Satisfaction Study www.jdpower.commeasures passenger satisfaction among business and leisure travelers of ma-jor airline carriers in North America based on a recent flight experience.The study is continuously fielded throughout the year. However, the surveyresults are not made public but sold to the airlines.Traditional survey methods tend to be based on the knowledge of man-agement or researchers and may not mirror the customer’s actual needs,resulting in an inconsistent measurement of perceived service quality. Manyof the survey forms are completed routinely and with little interest or care,and some customers even respond randomly, leading to a fictitious under-standing of customer perception, which is more harmful to any business(Lucini et al., 2020). Another drawback to these techniques is that theylimit the response a customer can provide, and the expected structured re-sponse also distorts the customer’s intrinsic voice (Korfiatis et al., 2019).With the availability of online electronic platforms, collecting informa-tion from willing (or disgruntled) customers has become feasible on a largescale. Customer reviews are recognized as fruitful information sources formonitoring customer satisfaction levels, particularly as they convey the realvoices of actual customers. Actual customer reviews are starkly revealing asto the positive and negative aspects of a given service expressing relativelyunambiguous opinions. However, deciphering the text reviews is a monu-mental task for a machine. As a methodological means of customer reviewanalysis, sentiment analysis has come to the fore.Textual reviews provided by airline passengers is an example of user-generated content published online. This type of analysis uses the real powerof social media, its vast amount of data, to generate “sentiment indicator”with respect to a product or service. This can help track changes in theuser’s opinion over time and with respect to certain interventions such asintroduction of fuel surcharge, enhanced security checking procedures andrestrictions during natural or human caused events such as pandemic or aterrorist action etc.According to World Health Organization (WHO), China reported a clus-ter of cases of pneumonia in Wuhan, Hubei Province on December 31, 20192Chapter 1. Introduction(WHO, 2020). The novel corona disease 2019 (COVID-19) caused by thesevere acute respiratory syndrome coronavirus 2 (SARS-CoV-2) was even-tually identified. In response to the pandemic situation as a result of theoutbreak, travel restriction measures were put in place by various country,affecting domestic and international travels (Mcclanahan, 2020). Italy wasthe first country to enforce a national lockdown on March 9, 2020 (Mon-mousseau et al., 2020), after introducing an initial measure of the lockdownof the northern region of Lodi on February 21, 2020. Two days follow-ing Italy’s lockdown announcement, the United States (US) banned non-resident travelers who had been to China, Iran and the 26 member states ofthe European Union (EU) to enter the US, and later extended the ban tonon-resident travelers who had visited the United Kingdom and Ireland onMarch 16, 2020 (Mcclanahan, 2020). The EU officially closed the externalborders of its state members to almost all non-resident travellers on March17, 2020. On March 19, 2020, the US Department of State issued a Level4 Global Health Travel Advisory, cautioning all US citizens against inter-national travel. This sequence of events led to a reduction of domestic andinternational air passenger traffic, as studied using data from the Customsand Border Protection (CBP) website by Monmousseau et al. (2020). Thedaily passengers arriving at all US airports have declined from 200,000 onearly March 2020 to 10,000 on early April 2020 (Monmousseau et al., 2020),a shock to the air transportation system.COVID-19 Implications to Airlines: The discussion of COVID-19 im-pact is of high importance to policy makers. The COVID pandemic hasstrangled global economy in many ways; job layoffs, tourism crisis, low-ered consumer spending and plunging oil prices (Khan et al., 2021). BeforeCOVID-19, the most important disease outbreak in terms of impact on airtraffic was SARS in 2003. According to IATA (IATA, 2020b), in May 2003,at the height of the SARS outbreak, the monthly revenue passenger kilome-tres (RPKs) of Asia-Pacific airlines were lowered by 35% than the pre-crisislevels. COVID-19 has had an effect beyond these levels and has brought theaviation industry into uncharted territories. As of March 24, 2020, many air-lines have been brought to a complete stop, while the provisionally-observedrecovery for COVID-19 was slower than that of the SARS crisis in 2003(Suau-Sanchez et al., 2020). It is predicted that COVID-19 costed airlinesUSD 320 billion loss in worldwide revenues, as well as risking 25 million jobsdirectly and indirectly (IATA, 2020a). The airline industry remains veryfragile and one of the biggest casualties of the global COVID-19 pandemic31.1. Sentiment Analysisdue to obvious reasons such as social isolation and travel restriction (Xuanet al., 2021). It is expected that the impacts are for the long-term andrecovery would take as long as three to six years. This establishes a needto understand if traveller perception towards airlines has changed over thecourse of COVID-19.The air transportation is an essential system to understand and to studyunder pandemic situation from various perspectives. Passenger-generateddata is used to analyze the efficiency of the air transportation system toimprove passenger satisfaction Pruyn & Smidts (1998). Customer feedbackhas been one of the essential components for improving airline services. Theconventional methods of collecting customers’ feedback through distributing,collecting and analyzing questionnaires are time consuming and often inac-curate (Wan & Gao, 2015). As the internet usage grows globally, customersincreasingly use e-commerce sites for purchasing products and services. Fol-lowing a travel experience provided by an airline, customers may leave onlinereviews to provide feedback on the services they experienced. Online cus-tomer review systems are one of the most powerful channels to generate on-line word-of-mouth, where they influence customer purchasing decisions, aswell as help organizations understand and forecast service demands (Filieri& McLeay, 2014). As such, it is important to assess and understand the ef-fects of travel restriction induced by a global pandemic on airline customers.This thesis outlines an approach to analyzing air transportation system andthe effects of travel restrictions on passengers’ sentiment towards airlines asa whole.1.1 Sentiment AnalysisSentiment analysis refers to the computational study of people’s opinions,sentiments, appraisals, emotions, moods and attitudes towards entities andtheir attributes expressed in written text (Liu, 2020). The entities can beproducts, services, organizations, individuals, events, issues, or topics. Thefield represents a large problem space in many related names and slightlydifferent task - for example, sentiment analysis, opinion mining, opinionanalysis, opinion extraction, sentiment mining, subjectivity analysis, affectanalysis, emotion analysis and review mining - are all under the umbrellaof sentiment analysis (Liu, 2020). Existing research and applications ofsentiment analysis have focused primarily on written text and has been anactive research field of natural language processing (NLP). Further, the topichas also been widely studied in data mining, web mining and information41.1. Sentiment Analysisretrieval because many researchers in these fields deal with text data.Opinion, sentiment and their related concepts, such as evaluation, ap-praisal, attitude, affect, emotion, and mood, are about our subjective feel-ings and beliefs (Liu, 2020). According to Pang & Lee (2008), “what otherpeople think” has always been an important piece of information for mostof us during the decision-making process. Whenever we make a decision,we often seek out others’ opinions. For this reason, our views of the worldare very much influenced by others’ views. This is true not only for indi-viduals but also for organizations. From an application point of view, wewant to mine people’s opinions and feelings toward any subject matter ofinterest, which is the task of sentiment analysis. More succinctly, sentimentanalysis aims to extract positive and negative opinions or sentiments fromnatural language text as well as targets of these opinions or sentiments, usingcomputation methods.Although sentiment analysis studies opinions, there was almost no re-search on this topic from either the linguistics community or the NLP com-munity before the year 2000. This was, in part, because almost no opin-ionated text was recorded in digital forms before then. The Internet andthe Web have now (amongst other things) enabled us to discover opinion.The inception and rapid growth of sentiment analysis coincide with thoseof social media on the web, such as reviews, forum discussions and blogs.For the first time in human history, we have a huge volume of opinionateddata recorded in digital forms. In marketing, word of mouth (WOM) isthe act of consumers providing information about goods, services, brands,or companies to other consumers (Babic Rosario et al., 2016). Such infor-mation communicated through the Internet in the form of reviews, tweets,blog posts, images and video testimonials are now referred to as ‘electronicword of mouth‘ (eWOM) and it represents one of the most significant de-velopments in consumer behavior. By 2021, an estimated 4.9 billion peoplewere using the internet, an increase of almost 17% since 2019 (InternationalTelecommunication Union, 2021). With the explosive growth of the weband social media in the past twenty years, we now have a constant flow ofopinionated data recorded in digital forms. These data, also called user-generated content, prompted researchers to mine them to discover usefulknowledge.Over the years, mobile social media systems on the web have providedexcellent platforms to facilitate and enable audience participation, engage-ment and community, which resulted in a new participatory culture (Liu,2020). From reviews and blogs to YouTube, Facebook, and Twitter, peopleembraced these platforms enthusiastically because they enable their users51.1. Sentiment Analysisto freely and conveniently voice their opinions and communicate their viewson any subject across geographic and spatial boundaries. They also allowpeople to easily connect with others and to share their information. As akey function of the platforms is for people to express their views and opin-ions, sentiment analysis is right at the center of research and application ofsocial media. It is now well recognized that to extract and exploit informa-tion available in digital format, sentiment analysis is a necessary technology(Liu, 2020).Opinions are very important to businesses and organizations becausethey always want to ascertain consumer or public opinions about their prod-ucts and services. When an organization or a business needed public orconsumer opinions, it conducted surveys, opinion polls, and focus groups.Besides businesses and organizations, individual consumers want to knowthe opinions of others about products and services before purchasing theproducts or the services. In the past, when an individual needed opinion,they asked friends and family. If an individual wants to buy a consumerproduct, they are no longer limited to asking their friends or family foropinion because there are many user reviews and discussions in public fo-rums on the web about the product.In recent years sentiment analysis applications have spread to almostevery possible domain, from consumer products, health care, tourism, hos-pitality, and financial services to social events and political elections. Blogs,online reviews, and social networking websites are enabling customers tointeract virtually and to share information, opinions, and knowledge aboutall kinds of goods, services and brands Filieri & McLeay (2014). Accordingto Sigala et al. (2012;2016;), the Web 2.0 applications are empowering on-line user interaction and collaboration and influencing how travellers create,exchange, and use information. Individuals and organizations are increas-ingly using the content in social media for decision making Filieri & McLeay(2014). They scan online reviews published by travelers on the tourism prod-ucts, services and brands they experience as eWOM.Travelers write online reviews to share their own experience with a prod-uct and/or service and describe their level of satisfaction to help other trav-ellers (Gretzel & Yoo, 2017). Internet consumer opinion portals (COPs)enable travellers to review any aspect of a vacation such as accommodation,restaurants, destinations, and flights Burton & Khammash (2010). RelatedCOPs to the airline industry are SkyTrax and Trip Advisor. These platformsprovide potential travellers to read on past travel experiences by other trav-ellers and to inform subsequent decisions to travel with a specific airline. Inthis thesis, we focus on the sentiment of the online reviews on airlines that61.2. Methodologyare made available publicly.1.2 MethodologyThe research methodology of sentiment analysis involves text mining andextracting subjective information from the text using natural language pro-cessing (NLP) and processing this information to generate and testing re-search hypotheses. Specifically, sentiment analysis extracts the polarity ofthe expressed opinion in a range spanning from positive to negative. Wemay also refer to sentiment analysis as opinion mining (Pang & Lee, 2008).The “keywords” or “bag-of-words” approach is the most commonly usedbecause it underlies a simplistic representation of how opinions and sen-timents can be expressed. It consists, in its most rudimentary form, indetecting and counting words from a set of words labeled as “positive” or“negative”. However, single words are not sufficient to extract the senti-ments expressed in a sentence. Modifiers (words, phrases, or clauses whichfunction as adjectives or adverbs to describe a word or make its meaningmore specific) are an important part of the speech. Therefore, the use of“n-grams” can substantially enhance the sentiment extraction efforts.A sentiment can be oriented as positive, negative or neutral. Neutralusually means the absence of sentiment or no sentiment. In research liter-ature, sentiment orientation is also called polarity, semantic orientation orvalence (Liu, 2020). Polarity assignment is a form of sentiment analysis, us-ing an algorithm to determine the polarity of a given sentence or statement.Valence shifters are words that alter or intensify the meaning of a polarizedwords (Polanyi & Zaenen, 2006). Valence shifters consist of negator, ampli-fier, de-amplifier and adversative conjunction. Negators or negation wordssuch as not and never reverses the polarity of a polarized word. For exam-ple, good is +1 and not good is -1. Amplifiers and de-amplifiers change thedegree of the expressed sentiment. An amplifier (intensifier) increases theintensity of a positive or negative expression, whereas a de-amplifier (dimin-isher) decreases the intensity of the expression. Common amplifiers includevery, so, extremely, really, awfully, and so on, and common de-amplifiersinclude slightly, hardly, somewhat, barely, and so on. Adversative conjunc-tion words such as but and however indicate semantic relations of contrastand concession Zhang (2021). For example, “He is a very nice guy but notthe brightest”. Valence shifters affect polarized words in many ways, mostnotably in reversing and overruling sentences.The following text terminologies are defined to aid the quantitative pre-71.2. Methodologysentation of this thesis:• a document/review be a collection of K paragraphs denoted by D ={p1, .., pK}• a paragraph be a sequence of M sentences denoted by pi = {s1, .., sM}for all i = 1, ..,K• a sentence be an ordered bag of N words denoted by sj = {w1, .., wN}for all j = 1, ..,M• a word wk be the basic unit of discrete data from a vocabulary of Vunique terms, wk ∈ {1, .., V } for all k = 1, .., N• a context cluster be a sequence of (a + b + 1) words denoted bycl = {wk−a, .., wk, .., wk+b}, where a and b are the number of wordspreceding and following wk respectively1.2.1 The Quantitative Discourse Analysis Package (qdap)The R package qdap offers a flexible function polarity to determine thepolarity at the sentence level for a given grouping variable. The packagewas created by Rinker (2013) to automate tasks associated with quantitativediscourse analysis of transcripts. It utilizes a dictionary lookup approachthat incorporates weighting for valence shifters.For each document (a review), the algorithm in polarity function firstassigns a value of polarity to each sentence by comparing each polarizedwords in the sentence against a sentiment lexicon, and tags positive andnegative words with a value +1 and −1, respectively. Hence, the polarityscore generated is dependent upon the sentiment lexicon supplied. By de-fault, the function utilizes the Opinion Lexicon by Hu & Liu (2004). Usersmay also supply customized sentiment lexicon and optional weights to ad-dress contextual difference on subjects. For example, the word “sick” ina high school setting may mean something good, whereas “sick” used in ahospital indicates a negative annotation.The polarity function works as follows; each paragraph, pi is brokendown into element sentences sj , where each sentence is then considered asan ordered bag of words. Punctuations are removed with the exceptionof pause punctuations such as commas, colons and semicolons, which areconsidered as a word within the sentence. Whenever a polarized word isdetected in a sentence, it forms a context cluster of words with four wordspreceding and two words following the polarized word to consider for valence81.2. Methodologyshifters. The size of the context cluster may be adjusted accordingly basedon user preferences. The words in the cluster are tagged as neutral, negator,amplifier, or de-amplifier. Neutral words do not affect sentiment orientation,however, are considered as part of the total word count N in a sentence. Thepause punctuations in a context cluster (commas, colons and semicolons) areindexed and considered as lower or upper bounds for the cluster. This isbecause these punctuations indicate a change in thought process and thewords prior to the punctuation are not necessarily connected to the wordsafter the punctuation. The lower bound index of the context cluster cl isconstrained to max{k − a, 1, z}, where k is the index of the polarized wordand z is the index of the pause punctuation preceding the polarized word.On the other hand, the upper bound is constrained to min{k + b, n, y},where n = a + b + 1 and y is the index of the pause punctuation followingthe polarized word.Each polarized word is then weighted based on the score provided by thesentiment lexicon, and then further weighted for valence shifters directly sur-rounding the polarized word in the context cluster. Amplifiers increases thepolarity by 1.8 times. Amplifiers becomes de-amplifiers if the context clus-ter contains odd number of negators. Contrary to amplifier, de-amplifiersdecrease the polarity by 1.8 times. Negators flip the sign of a polarized word(positive or negative) as well as affect amplifiers and de-amplifiers. As theremay be multiple negators in a sentence (eg: “God is never not good enoughfor me.”), negators score are determined by (−1)q+2 where q is the numberof negators. A custom weight may be provided by the user to weight theamplifiers and deamplifiers differently. The de–amplifier is constrained to alower bound of –1.Default Valence ShiftersTable 1.1 presents the default negators, amplifiers and de-amplifiers con-tained in the qdap library:Polarity calculationThe following terms are defined for the calculations of the polarity sentencesj :• δj - unbounded polarity score of the sentence• N - total word count in the sentence• cl - context cluster of size a+ b+ 1 where l ∈ {1, .., N}91.2. MethodologyValence Shifter List of wordsNegatorsain’t, aren’t, can’t, couldn’t, didn’t, doesn’t, don’t,hasn’t, isn’t, mightn’t, mustn’t, neither, never, no,nobody, nor, not, shan’t, shouldn’t, wasn’t,weren’t, won’t, wouldn’tAmplifiersacute, acutely, certain, certainly, colossal, colossally,deep, deeply, definite, definitely, enormous,enormously, extreme, extremely, great, greatly,heavily, heavy, high, highly, huge, hugely,immense, immensely, incalculable, incalculably,massive, massively, more, particular, particularly,purpose, purposely, quite, real, really, serious,seriously, severe, severely, significant, significantly,sure, surely, true, truly, vast, vastly, veryDe-amplifiersbarely, faintly, few, hardly, little, only, rarely,seldom, slightly, sparsely, sporadically, very few,very littleTable 1.1: List of default valence shifters contained in the qdap library• x0 - count of neutral words in a given cluster• q - count of negator words in a given cluster• xa - amplifier word in a given cluster• xd - de-amplifier word in a given cluster• z - weight of the amplifier/de-amplifier• w - weight of the polarized word wkδj =xT√N(1.1)where:101.2. MethodologyxTi = Σ(1 + xD + xA) ∗ w ∗ (−1)2+q (1.2)xD = max(xD′,−1) (1.3)xD′= −1 ∗ z ∗ [Σxd + 1(q mod 2 ! = 0) ∗ Σxa] (1.4)xA = 1(q mod 2 = 0) ∗ Σxa ∗ z (1.5)We use the following sentence as an example to illustrate the algorithmcalculations: “The customer service for this airline is extremely horrible andthe food is not very good.”1. The algorithm first breaks the sentence down to ordered bag of words.s0 = {‘The’, ‘customer’, ‘service’, ‘for’, ‘this’, ‘airline’, ‘is’, ‘extremely’,‘horrible’, ‘and’, ‘the’, ‘food’, ‘is’, ‘not’, ‘very’, ‘good’}2. The algorithm scans for positive and negative words by comparing tothe supplied Opinion Lexicon. The polarized words in the sentencesare ‘horrible’ and ‘good’ with −1 and +1 polarity respectively.3. A context cluster is formed surrounding each polarized words to eval-uate for the xTi score. Below is the calculation for the polarity of eachcluster111.2. Methodology• cluster 1: “this airline is extremely horrible and the”xA = 1(q mod 2 = 0) ∗ Σxa ∗ z= 1 ∗ 1 ∗ 0.8= 0.8xD′= −1 ∗ z ∗ [Σxd + 1(q mod 2 ! = 0) ∗ Σxa]= −1 ∗ 0.8 ∗ [0 + 0 ∗ 1]= 0xD = max(xD′,−1)= max(0,−1)= 0xTi = Σ(1 + xD + xA) ∗ w ∗ (−1)2+q= (1 + 0 + 0.8) ∗ −1 ∗ (−1)2+0= 1.8 ∗ −1 ∗ 1= −1.8121.3. Thesis Summary• cluster 2: “food is not very good”xA = 1(q mod 2 = 0) ∗ Σxa ∗ z= 0 ∗ 1 ∗ 0.8= 0xD′= −1 ∗ z ∗ [Σxd + 1(q mod 2 ! = 0) ∗ Σxa]= −1 ∗ 0.8 ∗ [0 + 1 ∗ 1]= −0.8xD = max(xD′,−1)= max(−0.8,−1)= −0.8xTi = Σ(1 + xD + xA) ∗ w ∗ (−1)2+q= (1− 0.8 + 0) ∗ 1 ∗ (−1)2+1= 0.2 ∗ 1 ∗ −1= −0.24. The polarity for this sentence is then computed as follow:δj =xT√N=−1.8 + (−0.2)√16=−2.04= −0.51.3 Thesis SummaryIn this thesis we demonstrate the utilization of statistical modelling to ana-lyze the quantitative sentiment scoring as extracted from the online reviewsprovided by airline passengers. The statistical modelling enables us to an-swer various questions, such as:131.3. Thesis Summary1. how do different classes of passengers, such as economy and businessclass, differ with respect to their expectations and recommendations;2. how do the passengers’ reviews differ when they fly their own country’sairline versus a different country’s airline;3. how did the COVID-19 crisis affect the perception of airline passengerswith respect to the services provided by the airline industry;4. how to rank various airlines with respect to satisfaction of the passen-gersChapter 2 provides a detailed description of data mining methodologyused to extract customer reviews data. Reviews data were extracted fromtwo online platforms: SkyTrax and Trip Advisor. These two platforms op-erate very differently in the way that airline customers provide feedbackon their travel experience. Skytrax World Airline Star Rating began in1999, and is the prestigious, longest established and unique mark of QualityAchievement and a global benchmark of airline excellence. Trip Advisoris the online system for booking various aspects of travel including book-ing flights. Using data from two distinct platforms allows us to check theconsistency of airlines performance with respect to customers’ experience.Chapter 2 also includes detailed exploratory data analysis using high levelgraphics and summary statistics.Formal statistical modelling of the sentiment scoring data is detailedin Chapter 3. We use linear mixed models with customers and airlineseffects as random. This methodology allows us to make comparisons ofour choice, including comparing various airlines with respect to the rangeof negative to positive experience as provided by customers in their textreviews. In addition, the mixed modelling provides estimates of so calledvariance components with respect to variability among the customers andamong the airlines.14Chapter 2Exploratory Data AnalysisThe dataset analysed in this thesis, crawled from SkyTrax and Trip Advisorwebsites, contains reviews written by airline travellers. The curated datasetcontains 28,241 and 208,049 observations from SkyTrax and Trip Advisorplatforms respectively. The duration of the reviews spans from the years2016 to 2021. Each observation contains a review written by a traveller,describing their experience with the airline. Table 2.1 provides a summaryof the curated dataset.SkyTrax TripAdvisorNumber of Reviews 28,241 208,049Number of Airlines 85 95Review Start Date March 8, 2016 February 1, 2016Review End Date June 29, 2021 April 1, 2021Table 2.1: Summary of the airline reviews data curated from SkyTrax andTrip Advisor websites2.1 Data CollectionThe data collection was done by scraping user-generated review data avail-able publicly on SkyTrax https://www.airlinequality.com/ and TripAdvisor https://www.tripadvisor.ca/Airlines websites. Web scrapingis the process of extracting a structural representation of data from a website(Aydin, 2018). The HyperText Markup Language (HTML) is the standardmarkup language for documents designed to be displayed in a web browser.Existing web scraping techniques are based on the markup formatting ofthe webpage. As the elements of web pages are formatted in HTML code,specific pieces of the content are accessible using XPath expressions or Cas-cading Style Sheets (CSS) selectors (Munzert et al., 2020). This enablesusers to systematically describe the information to be extracted such as aspecific table or paragraphs of texts. Most elements denote parts of a page152.1. Data Collectionstructure, such as header, paragraph, or image, enclosed inside tags. Weutilized the rvest (Wickham, 2021) and RSelenium packages in R to help usaccomplish the web scraping. To process string data, we used the data.tableand tidyr packages. The code for data collection and processing is availablein the appendix at the end of this thesis.SkyTrax Data CollectionThe dataset for SkyTrax is scraped from the website https://www.airlinequality.com/ using rvest package in R. The data collection is based on a curated listof airlines. An algorithm is written to loop through each of the curated air-lines review pages and harvest information contained within the webpage.Before the collection begins, each airline pages are manually inspected toobtain the total number of pages as some airlines have more reviews thanothers. Each page of the airline has a fixed number of reviews, hence pro-viding an estimate of the total number of reviews available based on numberof pages. After obtaining the number of pages, we proceed to check if eachof the airlines provides services first, business, and economy classes. Thisallows us to prepare appropriate URLs associated with each service class fora given airline. For a given airline, we scrap through all historical reviewsavailable on the SkyTrax website. Upon meeting all conditions, the datacollection process begins for the reduced curated list. For each review, thefollowing fields are scraped for each of the flight classes:• Review rating - 1 to 10• Review author’s name• Review author’s country name• Review content• Review date• Trip verified - Indicates reviews where users supplied proof of travelwith their ticket, booking or boarding pass• Airline name• Airline rating - the overall current average rating• Airline country - name of country where airline has headquarters• Seat type - Business class, Economy class, Premium economy class,and First class• Traveller type - Solo Leisure, Family Leisure, Business, etc• Route of the flight related to the reviewFigure 2.1 depicts an example and construct of a review titled “Crew wasfriendly” made on the February 27, 2020 by passenger Wademaris who flew162.1. Data Collectionon Business Class with Singapore Airlines from Singapore to Bangkok. Thistrip is verified, which indicates that Wademaris has provided proof of travelto SkyTrax. For unverified reviews, the content will not have the checkmarkalong with “Trip Verified” indication. Several details are included alongwith the review, including the type of traveller, seat type, route, date flown,as well as service ratings. A total of 28,241 reviews have been scraped fromSkyTrax, the tabulation of reviews by seat type is presented in Table 2.2.Figure 2.1: A screenshot of SkyTrax review by a passenger who flew on Busi-ness Class with Singapore Airlines from Singapore to Bangkok. Screenshotavailable from https://www .airlinequality .com/airline -reviews/singapore -airlines/page/2/?sortby=post date%3ADesc&pagesize=100After collecting the reviews associated to each seat types for all airlines,the data sets are appended by row to be used for sentiment scoring of thereview content. The scoring of the reviews is done using the QDAP method-ology on document-level. Here, each review is considered a document. Thescores associated with each review are appended by column. Several newfields are derived:172.1. Data CollectionSeat Type ReviewsEconomy Class 20,777Business Class 5,191Premium Economy Class 1,523First Class 750Table 2.2: Summary of reviews counts by seat type for SkyTrax• COVID - An indicator 1 for COVID-19 period or 0 for before COVID-19 period• Derived seat type - Business/First Class or Economy class• Country Dummy - An indicator 1 for reviews where the reviewer andairline countries match or 0 for otherwise• Continent - The continent in which the airline is headquarteredThe COVID indicator is obtained by comparing the review date againstJanuary 1, 2020, when COVID-19 was first discovered (WHO, 2020). Anyreview written on or after Jan 1, 2020 would indicate 1 and 0 otherwise.The Economy and Premium Economy classes are combined to be ’EconomyClass’, while the Business and First classes are combined to be ’Business/-First Class’. The relabelled seat types are stored in the Seat Type field.Trip Advisor Data CollectionThe dataset for Trip Advisor reviews is scraped from the website https://www.tripadvisor.ca/ using RSelenium. RSelenium is used to scrap theTripAdvisor website because it is dynamic website, where the URL doesnot change when one selects a specific filter within a webpage. Instead,the webpage is dynamically pulling data from databases using JavaScriptand jQuery, while retaining the same URL. For instance, whenever a userselects a seat type filter such as Economy, Business or First Class, the URLdoes not change, rather the content dynamically changes according to theselection. RSelenium also allows us to make particular selection on filtersand navigate to different pages of the reviews for a given airline. Unlikethe SkyTrax website, the final page of the review is not displayed by designof website, making estimation of total number of reviews difficult. Thewebsite is navigated page by page for web scraping of reviews. As someairlines receive more reviews on a daily basis than another, it is therefore achallenge to scrape historical reviews for equal date period coverage for allairlines. We allowed the web scraping to run on R for a period of 48 hours182.1. Data Collectionand have manually checked for every individual airline to ensure proper dateperiod coverage for the purpose of our study. The data collection is basedon the same curated list of airlines as with SkyTrax. For each review, thefollowing fields are scraped for each of the flight classes:• Review rating - 1 to 5• Review date• Review content• Airline name• Airline rating• Seat type• RouteFigure 2.2 depicts an example and construct of a review written onDecember 2021, by passenger Kate who flew on Economy Class with AirCanada from Canada to Finland. This review title “Baggage delayed andleft without any communication” was made during the month of the travelby the passenger, as indicated by the ’Date of travel’ field.A total of 208,049 reviews have been scraped from TripAdvisor, thetabulation of reviews by seat type is presented in Table 2.3.Seat Type ReviewsEconomy Class 159,556Business Class 24,382Premium Economy Class 14,844First Class 5,377Basic Economy 3,890Table 2.3: Summary of reviews counts by seat type for Trip AdvisorSimilar to the SkyTrax case, the reviews associated with each seat typefor all airlines are appended by row to be used for sentiment scoring of thereview content. As well, several new fields are derived:• COVID - An indicator 1 for COVID-19 period or 0 for before COVID-19 period• Derived seat type - Business/First Class or Economy class• Continent - The continent in which the airline is headquartered192.1. Data CollectionFigure 2.2: A screenshot of Trip Advisor review by a passenger who flew onEconomy Class with Air Canada from Canada to Finland. Screenshot avail-able from https://www .tripadvisor .com/Airline Review -d8728998-Reviews-Air-Canada202.2. SkyTrax Findings2.2 SkyTrax FindingsTable 2.4 depicts the count of reviews by airline, which range from 16 to1,708. There are several noticeable airlines with the most reviews, suchAmerican Airlines, United Airlines, British Airways and Spirit Airlines. Itis plausible that passengers who fly with these airlines are more prone toleaving a review on their travel experience. On the contrary, some airlineshave very few reviews, such as Azerbaijan Airlines, Croatia Airlines, LaCompagnie and Jazeera Airways.From Table 2.5, we observe that most of the reviews originate from theUnited States, followed by Australia and United Kingdom. Passengers fromcountries such as Azerbaijan, Trinidad & Tobago, and Bulgaria providedvery few reviews.212.2. SkyTrax FindingsAirline Review Airline Review1 American Airlines 1,768 44 Vietnam Airlines 2342 United Airlines 1,251 45 EVA Air 2293 British Airways 1,126 46 Austrian Airlines 2254 Spirit Airlines 1,008 47 Oman Air 2185 Qatar Airways 804 48 Brussels Airlines 2166 Turkish Airlines 730 49 SriLankan Airlines 2077 Delta Air Lines 725 50 Air Transat 1988 Emirates 709 51 ANA All Nippon Airways 1959 Lufthansa 701 52 IndiGo 19410 Cathay Pacific Airways 646 53 Sunwing Airlines 18711 Singapore Airlines 640 54 Air Europa 17112 Etihad Airways 623 55 China Airlines 16313 Qantas Airways 596 56 Kenya Airways 16014 Air Canada 569 57 Condor Airlines 15515 KLM Royal Dutch Airlines 551 58 Porter Airlines 15416 Malaysia Airlines 551 59 Korean Air 15217 Air France 528 60 Saudi Arabian Airlines 15118 TAP Portugal 523 61 Japan Airlines 14119 Frontier Airlines 517 62 Asiana Airlines 13820 Southwest Airlines 493 63 Hawaiian Airlines 13721 Norwegian 482 64 Gulf Air 12222 Alaska Airlines 445 65 Thomas Cook Airlines 11823 WestJet Airlines 431 66 Egyptair 11624 Air India 426 67 Bangkok Airways 11425 Jetstar Airways 423 68 Royal Air Maroc 11226 Garuda Indonesia 420 69 CSA Czech Airlines 11127 easyJet 402 70 South African Airways 11128 Swiss Intl Air Lines 400 71 Air Astana 10529 Air China 389 72 El Al Israel Airlines 9930 AirAsia 388 73 SilkAir 7531 Philippine Airlines 365 74 Air Arabia 7332 SAS Scandinavian 322 75 Royal Brunei Airlines 5733 Air New Zealand 316 76 Middle East Airlines 4634 Aegean Airlines 311 77 Aerolineas Argentinas 4535 Finnair 298 78 Citilink 4336 China Eastern Airlines 296 79 Bulgaria Air 3937 Hainan Airlines 295 80 Kulula 3038 Iberia 280 81 Caribbean Airlines 2839 Aeroflot 277 82 Azerbaijan Airlines 2640 Aer Lingus 276 83 Croatia Airlines 2541 Jet Airways 275 84 La Compagnie 2542 Alitalia 264 85 Jazeera Airways 1643 Aeromexico 240Table 2.4: Total count of reviews by airline for SkyTrax222.2. SkyTrax FindingsCountry Reviews Country Reviews1 United States 6,344 27 Russian Federation 2772 Australia 2,003 28 Ireland 2763 United Kingdom 1,646 29 Italy 2644 Canada 1,539 30 Mexico 2405 United Arab Emirates 1,332 31 Vietnam 2346 China 1,143 32 Taiwan 2297 Malaysia 939 33 Austria 2258 India 895 34 Saudi Arabia 2249 Turkey 730 35 Oman 21810 Singapore 715 36 Belgium 21611 Germany 701 37 Sri Lanka 20712 Hong Kong 646 38 Kenya 16013 France 553 39 South Africa 14114 Netherlands 551 40 Bahrain 12215 Portugal 523 41 Egypt 11616 Norway 482 42 Thailand 11417 Indonesia 463 43 Morocco 11218 Spain 451 44 Czech Republic 11119 Switzerland 400 45 Kazakhstan 10520 Philippines 365 46 Israel 9921 Japan 352 47 Brunei 5722 Denmark 322 48 Lebanon 4623 New Zealand 316 49 Argentina 4524 Greece 311 50 Bulgaria 3925 Finland 298 51 Trinidad & Tobago 2826 South Korea 290 52 Azerbaijan 26Table 2.5: Count of reviews by country of the reviewer for SkyTrax232.2. SkyTrax FindingsFigure 2.3: Time series of review counts on the SkyTrax platformFrom Figure 2.3, we notice an increasing trend where passengers areleaving more reviews from year 2016 to 2018, which then plateaus by year2020. We notice that consumers are using more of the internet to spreadword of mouth of their travel experience from 2016 to 2020. The verticalred line marks the beginning of the year 2020, when the COVID-19 virusbecame a global pandemic. The airline industry was significantly affectedby the pandemic as travel restrictions took place to prevent spread of thevirus. As a result, we observe a stark decline in the number of reviews asthere were fewer travellers. The number of reviews remained at a rate of250 per month thereafter.Figure 2.4 exhibits the count of reviews by review rating and customerverification status. We observe that highest count of reviews is of rating 1(around 10,000 reviews), followed by rating 10 (around 3,500 reviews). Ofthe rating 1 reviews, 20% are unverified, the largest proportion of unverifiedreviews across all review ratings. When customers experienced good servicelevel, they often do not leave a review, as that is part of their expectation ofthe service. On the contrary, when customers experienced bad service level,they make an effort to leave a review but may not bother to go through242.2. SkyTrax FindingsFigure 2.4: Distribution of review counts by review rating and verificationstatus for SkyTraxverification process. This explains the proportion of the unverified reviewsbeing the highest on rating 1. Overall, around 85% of the total reviews areverified.Rating Min 1st Qtl Median Mean 3rd Qtl Max Std Dev1 -0.429 -0.033 0.008 0.007 0.049 0.375 0.0682 -0.375 -0.03 0.014 0.012 0.055 0.333 0.0673 -0.3 -0.024 0.02 0.016 0.06 0.306 0.074 -0.348 -0.016 0.03 0.026 0.071 0.296 0.0715 -0.2 0 0.046 0.048 0.089 0.333 0.0686 -0.186 0.029 0.07 0.073 0.116 0.316 0.0697 -0.389 0.057 0.099 0.104 0.148 0.429 0.0768 -0.105 0.087 0.129 0.134 0.176 0.471 0.0769 -0.1 0.103 0.153 0.158 0.208 0.5 0.0810 -0.103 0.115 0.17 0.174 0.227 0.529 0.086Table 2.6: Summary statistics of sentiment scores by review rating for Sky-TraxFigure 2.5 shows boxplots of the sentiment scores by individual reviewratings. We notice that distributions of the sentiment scores are fairly sym-252.2. SkyTrax FindingsFigure 2.5: Boxplot of sentiment scores by review rating for SkyTraxmetric across all review ratings. The median for ratings 1 to 4 is close to 0,an indication that around half the reviews are positive and the other halfnegative. As the ratings increase from 5 to 10, the median sentiment scoreincreases. We posit a customer’s opinion could not directly be reflected bythe review rating in of itself and there could be an opinion bias betweenthe review rating and the review content, one may infer deviant opinion ofa customer differently. Table 2.6 provides the five-number summary, alongwith mean and standard deviation of sentiment scores by review rating. Thesentiment score ranges from -0.429 to 0.529. We observe that from reviewratings 5 to 10, at least 75% of the reviews left by passengers are positive,as indicated by the 0 sentiment score of the first quartile of review rating 5.Scrutinizing into the mean, we notice that all ratings have positive averages,which is especially interesting for the lower review ratings of 1 to 4, whereone would expect negative or close to 0 sentiment score for such low ratings.That is one reason that we want to use sentiment score extracted from thedetailed reviews rather than the review rating. We remark that the reviewrating is not a reasonable representation of a traveller’s experience.When exploring the sentiment scores from the seat types of Business/-First and Economy classes, Figure 2.6 shows the sentiment score distributionacross all review ratings by seat type while Table 2.7 shows the associated262.2. SkyTrax FindingsSeat Type Rating Min 1st Qtl Median Mean 3rd Qtl Max Std DevBusiness/FirstClass1 -0.375 -0.032 0 0.006 0.047 0.258 0.0672 -0.167 -0.013 0.022 0.02 0.058 0.241 0.0583 -0.2 -0.019 0.024 0.022 0.062 0.231 0.0654 -0.261 0 0.038 0.036 0.073 0.2 0.0665 -0.132 0.01 0.051 0.051 0.088 0.333 0.0656 -0.125 0.031 0.073 0.076 0.115 0.316 0.0647 -0.1 0.06 0.099 0.104 0.144 0.364 0.078 -0.095 0.093 0.128 0.133 0.173 0.381 0.0689 -0.1 0.107 0.149 0.155 0.2 0.5 0.07410 -0.067 0.131 0.176 0.179 0.225 0.467 0.075EconomyClass1 -0.429 -0.033 0.009 0.007 0.049 0.375 0.0682 -0.375 -0.032 0.012 0.01 0.054 0.333 0.0693 -0.3 -0.025 0.018 0.015 0.06 0.306 0.0714 -0.348 -0.019 0.025 0.023 0.068 0.296 0.0725 -0.2 0 0.043 0.047 0.091 0.28 0.076 -0.186 0.027 0.069 0.072 0.117 0.314 0.0727 -0.389 0.057 0.1 0.104 0.148 0.429 0.0788 -0.105 0.082 0.129 0.135 0.179 0.471 0.089 -0.083 0.103 0.156 0.16 0.214 0.471 0.08410 -0.103 0.109 0.167 0.172 0.229 0.529 0.09Table 2.7: Summary statistics of sentiment scores by review rating and seattype for SkyTrax272.2. SkyTrax FindingsFigure 2.6: Boxplot of sentiment scores by review rating and seat type forSkyTraxfive-number summary along with mean and standard deviation. We observea similar pattern as with Figure 2.5 across both seat types where lowerreview ratings 1 to 4 have median sentiment scores close to 0 and higher re-view ratings 5 to 10 have higher median sentiment scores. All distributionsof the sentiment score across the two seat types are symmetric. Noticeably,review ratings 8 to 10 of the Economy class category have higher variabilityas compared to other review ratings within the seat type category. Thereview ratings in the Business/First Class have similar variability across allreview ratings. When comparing between the seat types, we notice that theBusiness/First Class has higher median sentiment scores as compared to theEconomy Class. We infer that customers who travel on Business/First Classhave a higher propensity to provide reviews with higher sentiment scores, ascompared to the Economy class. The Business/First Class category natu-rally has lesser allotted seats in the cabin, while the Economy Class categoryhas more seats. It is plausible with a limited cabin crew, the Business/FirstClass passengers gets more attention and care.Figure 2.7 depicts the overall distribution of sentiment scores by seat type(Business/First, Economy class) and customer verification status (0 = no, 1= yes). The top grid represents unverified reviews whereas the bottom grid282.2. SkyTrax FindingsFigure 2.7: Boxplot of sentiment scores by seat type and COVID period forSkyTrax. The top grid represents unverified users, whereas the bottom gridrepresents verified usersBusiness/First ClassTrip Ver. COVID Min 1st Qtl Median Mean 3rd Qtl Max Std DevNo0 -0.161 0 0.056 0.068 0.128 0.373 0.0991 -0.074 0.013 0.062 0.072 0.118 0.318 0.084Yes0 -0.375 0.028 0.094 0.096 0.159 0.5 0.0951 -0.2 0.018 0.078 0.088 0.151 0.412 0.1Economy ClassTrip Ver. COVID Min 1st Qtl Median Mean 3rd Qtl Max Std DevNo0 -0.273 -0.021 0.033 0.044 0.095 0.529 0.0971 -0.278 -0.011 0.038 0.044 0.089 0.435 0.088Yes0 -0.429 -0.005 0.045 0.057 0.115 0.5 0.0991 -0.389 0 0.042 0.051 0.1 0.526 0.096Table 2.8: Summary statistics of sentiment scores by seat type and COVIDfor SkyTrax292.2. SkyTrax Findingsrepresents verified reviews. The green colored boxplots represent reviewsleft by passengers before January 1, 2020 while the red colored boxplotsfor reviews during or after January 1, 2020. Additionally, Table 2.8 depictsthe five-number summary, along with mean and standard deviation of thesentiment scores by seat type, customer verification status and COVID cat-egories. When comparing between seat types, both seat types have mediansentiment scores above 0 and we observe that the median sentiment scoresfor the Business/First Class category is higher than the median sentimentscores for the Economy Class category. Verified reviews have higher mediansentiment score than unverified reviews on both seat categories. It is plau-sible passengers who have verified status take time to write longer reviewswith more positive content as compared to passengers with unverified status.For all verification status and seat type, the variability of sentiment scoresis lesser during COVID-19 period (red) as compared to before COVID-19period (green), while maintaining a symmetric distribution. Overall, over75% of the reviews are positive, agnostic of review ratings, supporting ourfindings on Figure 2.5 and Figure 2.6 such that there is a positive bias ofsentiment scores on the higher review ratings.Business/First ClassTrip Verified Airline Dummy Min 1st Qtl Median Mean 3rd Qtl Max Std DevNo0 -0.161 0.004 0.056 0.074 0.135 0.364 0.0971 -0.133 0 0.059 0.062 0.111 0.373 0.09Yes0 -0.375 0.03 0.097 0.097 0.159 0.467 0.0941 -0.191 0.021 0.081 0.09 0.155 0.5 0.098EconomyNo0 -0.259 -0.015 0.043 0.053 0.107 0.529 0.1011 -0.278 -0.018 0.031 0.038 0.083 0.484 0.088Yes0 -0.429 0 0.048 0.061 0.12 0.526 0.11 -0.389 -0.012 0.038 0.049 0.101 0.481 0.097Table 2.9: Summary statistics of sentiment scores by seat type and airlinedummy for SkyTraxFigure 2.8 presents the overall distribution of sentiment scores by seattype (Business/First, Economy class) and Airline Dummy (1 = reviewerand airline countries match, 0 = otherwise). Table 2.9 presents the five-number summary statistics along with mean and standard deviation of sen-timent scores by seat type and airline dummy. On both the verified andunverified grid, we notice the green boxplots have lower median sentimentscores than the red boxplots on both seat type categories. Passengers whosecountries match with the airline countries tend to leave reviews with lowersentiment scores than that of passengers whose countries are different than302.2. SkyTrax FindingsFigure 2.8: Boxplot of sentiment scores by seat type and airline dummy forSkyTrax. The top grid represent unverified users312.2. SkyTrax Findingsairline countries, agnostic of seat types. Overall, passengers are more criti-cal of airlines within their countries. Passengers of the Business/First Classprovided reviews with higher median sentiment scores as compared to theEconomy Class passengers. We have previously observed from Figure 2.7that passengers whose trips are verified have provided reviews with highermedian sentiment scores than that of passengers whose trips are unverified,the same observation can be noted for Figure 2.8.Figure 2.9: Smoothed line plot of sentiment scores by seat type and verifi-cation status for SkyTraxFigure 2.9 shows a smooth plot of the sentiment scores. There are fourseparate lines of smooth; 1. Business/First Class and Verified Customers(represented by the dark blue line), 2. Business/First Class and UnverifiedCustomers (represented by the green line), 3. Economy Class and VerifiedCustomers, 4. Economy Class and Unverified Customers. Overall, for allfour lines, sentiment scores have been on a downward decline from 2016 to2021. Specific to the Business/First Class category, there is a difference ofabout 0.2 across all years between unverified and verified reviews, wherethe verified reviews for Business/First Class is consistently higher than thatof the unverified reviews. On the other hand, the Economy class exhibit a322.2. SkyTrax Findingsunique pattern where the sentiment scores experience a steep decline fromthe year 2016 to early 2019, where it picks up. The vertical red line marksthe start of COVID-19. There seem to be an upward trend of sentiment scorefor the economy class, perhaps there is a lag in the COVID-19 restrictions.We observe that somewhere mid-2020 is when the sentiment score starts todecline. There does not seem to be a big difference between the pattern ofthe verified and unverified reviews of the Economy Class, as compared tothe Business/First Class.Figure 2.10 depicts boxplots of sentiment scores for each airline, sortedfrom the highest median to the lowest median. We notice that almost allof airlines have a median sentiment score of at least 0, implying that atleast 50% of the reviews for each airline are positive. We observe thatthe variability of sentiment scores appears to be rather similar across allairlines, with more emphasis on positive sentiment scores. Scrutinizing intoindividual airlines, we found that most reviews of Hainan Airlines are scoredexceptionally higher compared to other airlines, where its 25th percentileof sentiment score exceeds the other airlines. The airline with the lowestmedian score is Air Arabia. Noticeably, American Airlines (6 rows up frombelow) has low variability judging from its interquartile range, with the mostoutliers as compared to the other airlines.332.2. SkyTrax FindingsFigure 2.10: Boxplot of sentiment scores of airlines for SkyTrax342.3. Trip Advisor Findings2.3 Trip Advisor FindingsPresenting in similar fashion as in Section 2.2, Table 2.10 depicts the countof Trip Advisor reviews by airlines. American Airlines has the most reviewson this platform, followed by British Airways and United Airlines. Smallerairlines such as Air Nostrum, Air Macau and Air Busan.Figure 2.11: Time series of review counts for Trip AdvisorFigure 2.11 depicts the monthly review counts from the year 2016 to2021. Due to limitations of the web harvesting methodology, we observethe review counts were close to 0 until early 2019; the collection of thedata happens from the most recent timeframe to the oldest and does notimpact the study as we are not analyzing review historics. From 2019, wenotice a few spikes of review counts, in particular for the months of July2019 (23,000), September 2019 (17,500), December 2019 (18,600) and March2020 (13,000). As COVID-19 started in January 2020 (represented by thevertical red line), we notice a decline in the number of reviews as travelrestrictions took place. The review counts remained steady at around 1,500reviews per month thereafter.Figure 2.12 presents the distribution of the review rating, ranging from352.3. Trip Advisor FindingsAirline Reviews Airline Reviews1 American Airlines 18,165 49 Kenya Airways 8472 British Airways 12,514 50 Bangkok Airways 8123 United Airlines 12,444 51 Saudi Arabian Airlines 7654 Southwest Airlines 10,566 52 AirAsia 7425 Spirit Airlines 10,405 53 Royal Air Maroc 7106 easyJet 9,177 54 Condor Airlines 6977 Qatar Airways 6,722 55 Porter Airlines 6698 Air Canada 6,282 56 Air Europa 6659 Singapore Airlines 5,844 57 Aerolineas Argentinas 66010 Turkish Airlines 4,992 58 China Airlines 65911 Norwegian 4,847 59 Asiana Airlines 65512 WestJet Airlines 4,799 60 SilkAir 63213 Lufthansa 4,775 61 CSA Czech Airlines 63014 Qantas Airways 4,714 62 Gulf Air 61815 Alaska Airlines 4,469 63 Kulula 61616 KLM Royal Dutch Airlines 4,341 64 Royal Brunei Airlines 57017 Etihad Airways 3,318 65 Hainan Airlines 55818 Air New Zealand 3,115 66 Edelweiss Air 53319 Air France 2,970 67 Jet Airways 51020 Cathay Pacific Airways 2,934 68 Caribbean Airlines 50721 Delta Air Lines 2,897 69 Finnair 50022 Thomas Cook Airlines 2,730 70 Frontier Airlines 50023 TAP Portugal 2,718 71 Garuda Indonesia 50024 Aer Lingus 2,692 72 Hawaiian Airlines 50025 Sunwing Airlines 2,632 73 Iberia 50026 Thai Airways 2,547 74 Jetstar Airways 50027 Air Transat 2,510 75 Egyptair 49528 IndiGo 2,426 76 Luxair 48529 Aegean Airlines 2,248 77 Emirates 47730 Air India 2,155 78 Air Arabia 47331 Swiss Intl Air Lines 1,768 79 Middle East Airlines 46932 Malaysia Airlines 1,644 80 Croatia Airlines 46433 EVA Air 1,595 81 Cayman Airways 45534 Alitalia 1,553 82 Citilink 45135 Vietnam Airlines 1,543 83 LIAT 38536 Philippine Airlines 1,404 84 LAN Airlines 36437 Oman Air 1,322 85 Jazeera Airways 35638 SAS Scandinavian 1,273 86 Brussels Airlines 29139 Aeromexico 1,175 87 Air Astana 28540 Austrian Airlines 1,147 88 Bulgaria Air 27941 Japan Airlines 1,083 89 La Compagnie 27942 China Eastern Airlines 1,060 90 Azerbaijan Airlines 24543 Air China 1,020 91 Aeroflot 18244 EL AL Israel Airlines 1,001 92 Air Algerie 13145 ANA All Nippon Airways 947 93 Air Nostrum 7146 South African Airways 928 94 Air Macau 6247 Korean Air 921 95 Air Busan 6148 SriLankan Airlines 902Table 2.10: Total count of reviews by airline for Trip Advisor362.3. Trip Advisor FindingsFigure 2.12: Count of reviews by review rating for Trip Advisor372.3. Trip Advisor Findings1 to 5. 57% of the reviews are positive (rating 4 and 5), 13% are neutral andthe remaining 30% are negative (ratings 1 and 2). We observe that mostof the reviews are of rating 5, followed by rating 4 and rating 1. Contraryto SkyTrax, there is no verification process for proof of travel by customer.Customers who left reviews on the Trip Advisor platform tend to leave morereviews with positive ratings.Figure 2.13: Boxplot of sentiment scores by review rating for Trip AdvisorRating Min 1st Qtl Median Mean 3rd Qtl Max Std. Dev.1 -0.556 -0.035 0.011 0.008 0.057 0.636 0.0832 -0.5 -0.022 0.024 0.022 0.07 0.636 0.083 -0.5 0 0.059 0.062 0.114 0.6 0.0944 -0.417 0.069 0.134 0.147 0.214 0.778 0.1175 -0.364 0.111 0.182 0.194 0.267 0.8 0.119Table 2.11: Summary statistics of sentiment scores by review rating for TripAdvisorIn addition to giving more reviews of higher ratings on Trip Advisor,customers are also found to write more positive content on higher review382.3. Trip Advisor Findingsratings, while the converse is not true. Figure 2.13 depicts the sentimentscore distributions by review ratings and Table 2.11 provides the accompa-nying five-number summary statistics along with mean and standard devia-tion of sentiment scores by review rating. The sentiment score ranges from-0.556 to 0.8. Visually, we observe a similar pattern compared to the Sky-Trax review rating, such that the distributions are symmetric. All reviewratings have median of sentiment scores above 0. The median sentimentscores increase as the review rating increases, ranging from 0.011 on rating1 to 0.182 on rating 5. Review ratings 1 and 2 also have lower variabilityas compared to the higher review ratings. Review rating 5 has the highestvariability and median sentiment score, suggesting that customers who givehigh review ratings write content with a higher spread of positive sentimentscores.Figure 2.14: Boxplot of sentiment scores by review rating and seat type forTrip AdvisorFigure 2.14 are boxplots of the sentiment score by review ratings, facetedby seat type, with the left facet representing the Business/First Class andthe right facet representing the Economy Class. Table 2.12 provides the ac-companying five-number summary statistics, along with mean and standard392.3. Trip Advisor FindingsBusiness/First ClassReview Rating Min 1st Qtl Median Mean 3rd Qtl Max Std. Dev.1 -0.5 -0.031 0.014 0.01 0.056 0.636 0.0792 -0.333 -0.015 0.029 0.028 0.074 0.636 0.0773 -0.333 0 0.061 0.064 0.113 0.462 0.0874 -0.235 0.072 0.132 0.145 0.2 0.636 0.1095 -0.2 0.118 0.182 0.192 0.25 0.727 0.109Economy ClassReview Rating Min 1st Qtl Median Mean 3rd Qtl Max Std. Dev.1 -0.556 -0.036 0.011 0.008 0.057 0.545 0.0832 -0.5 -0.023 0.023 0.021 0.069 0.45 0.0813 -0.5 0 0.059 0.062 0.114 0.6 0.0964 -0.417 0.068 0.135 0.147 0.214 0.778 0.1185 -0.364 0.111 0.182 0.195 0.267 0.8 0.121Table 2.12: Summary statistics of sentiment scores by review rating andseat type for Trip Advisordeviation of sentiment scores for Figure 2.14. When comparing between seattypes, the distribution of the sentiment scores are visually similar across re-view ratings. For customers who leave low review ratings of 1, 2 and 3, thosewho fly on the Business/First Class category tend to leave higher median andmean sentiment score than the Economy Class category. On the other hand,for customers who leave high review ratings of 4 and 5, it is observed thatthe Economy Class has higher median and mean sentiment scores than theBusiness/First Class. It seems Economy Class passengers who give ratings 4and 5 have a higher propensity to write reviews with more positive content,as compared to Business/First Class passengers. The converse is true forthe ratings 1, 2 and 3 where Economy class passengers write reviews withless positive content as compared to the Business/First Class passengers.While scrutinizing into the standard deviations of the sentiment scores, theEconomy Class is consistently higher than the Business/First Class acrossall review ratings. The standard deviation observation on Trip Advisor isconsistent with the findings on SkyTrax (Table 2.7). We also observe pas-sengers provide reviews on the Trip Advisor platform with higher variabilityin sentiment score as compared to the SkyTrax platform.Figure 2.15 shows the distribution of the sentiment scores by seat typeand COVID-19 periods, the green represent reviews made before January 1,2020 (prior to COVID-19) and the red represent reviews made on January1, 2020 or later (during COVID-19). Table 2.13 presents the accompanying402.3. Trip Advisor FindingsFigure 2.15: Boxplot of sentiment scores by seat type and COVID-19 periodfor Trip AdvisorBusiness/First ClassCOVID Min 1st Qtl Median Mean 3rd Qtl Max Std. Dev0 -0.500 0.043 0.118 0.128 0.200 0.727 0.1241 -0.417 0.034 0.103 0.116 0.186 0.600 0.122EconomyCOVID Min 1st Qtl Median Mean 3rd Qtl Max Std. Dev0 -0.545 0.021 0.096 0.112 0.190 0.800 0.1321 -0.556 0.009 0.081 0.100 0.172 0.727 0.132Table 2.13: Summary statistics of sentiment scores by seat type and COVID-19 period for Trip Advisor412.3. Trip Advisor Findingsnumerical statistics to support the figure. From this figure, we notice thatmore than 75% of the reviews are positive for both seat types, agnostic ofCOVID, as indicated by the positive sentiment scores of the first quartile.Further, we notice the standard deviation of sentiment scores before andafter COVID periods are very close to each other, if not similar. Althoughwe observed an overall decline in the red boxplots that represent sentimentscores of reviews left by passengers during COVID-19, the decline differsbetween the two seat type categories. Most notably, the first quartile ofsentiment scores for Economy Class decreased by 57% during COVID whilethe Business/First Class decreased by 21%. It is perhaps the safety measuresput in place due to COVID-19 that led to customers frustrations. As a result,these customers provide reviews with lower sentiment scores as they wouldhave before COVID-19, although these sentiment scores differ between seatclasses.Figure 2.16: Smoothed line plot of sentiment scores by seat typeWhile exploring the trend of sentiment scores over time, in particular be-fore and during COVID-19, the trends of sentiment scores are representedby the smoothed lines in Figure 2.16. The blue line represents the Business/-First Class category whereas the brown line represents the Economy Class.422.3. Trip Advisor FindingsThe vertical red line is drawn on January 1, 2020, splits the periods beforeand during COVID-19. In general, we observe that Business/First Class hasa higher sentiment score trend as compared to the Economy Class. BeforeCOVID-19, the sentiment scores of both Business/First and Economy Classhover around 0.08 to 0.13 from early 2016 to late 2019. At the start of2020, there is stark decline of sentiment scores throughout the year wheresentiment scores dropped below 0.08. Such discovery led us to believe thatCOVID-19 had a negative impact on the sentiment scores of the reviews leftby passengers on Trip Advisor.Figure 2.17 contains boxplots of sentiment scores for each airline, sortedfrom the highest median to the lowest median. In the case of Trip Advi-sor, all airlines have positive median sentiment scores. While observing theinterquartile ranges (IQRs) of the top 5 airlines, it seems the Middle EastAirlines have the highest variability of sentiment scores with no outliers. Itis plausible the service offerings of the airline vary between tiered seat classessuch as business, first and economy class; the Business and First Class pas-sengers typically gets better service as compared to the Economy Class.Besides that, we observe visually that the variability of sentiment scores foreach airlines appear to be rather similar to each other by visually compar-ing the length of the IQRs in the figures. Overall, almost all of the airlineshave positive 25th percentile sentiment scores, meaning that over 75% of thereviews for these airlines are positive in sentiment scores. While examiningthe individual airlines, we found that Aeroflot has exceptionally high mediansentiment score, where it exceeds 75th percentile sentiment scores of mostairlines. Further, the 25th percentile sentiment score of Aeroflot exceedsthe median sentiment score of all other airlines, meaning that 75% of thereviews left by travellers on Aeroflot contain higher sentiment score than50% of the reviews left by travellers on any given airline. Based on this datapoint, it is in our opinion that Aeroflot provides exceptional service offering.The airline with the lowest median sentiment score is Frontier Airline, hasthe smallest variability compared to other airlines.432.3. Trip Advisor FindingsFigure 2.17: Boxplot of sentiment scores for each airline44Chapter 3Statistical ModelingIn this chapter, we study the relationship between sentiment scores andthe factors explored in Chapter 2, such as individual airlines, seat type,and covid period. Section 3.1 gives a short description of the statisticalmethodology adopted for this purpose. Detailed results of the model fittingare described in Sections 3.23.1 Linear Mixed ModelsLinear mixed models are an extension of simple linear models, which al-lows for both fixed and random effects to be incorporated. A linear mixedmodel is capable of handling data where observations are not independent,or rather correlated in some sense. In linear modelling, uncorrelated error isan important but often violated assumption of statistical procedures in thelinear model family. This particular violation occurs when the error termsare not independent but instead clustered by one of more grouping factors.For example, given a set of Grade 9 student test scores, the errors arise fromestimating test score changes may be clustered by factors such as classroomteachers, school and municipality (Garson, 2013). As such, the errors areinaccurately represented and may be misinterpreted.Linear mixed models are a generalization of the general linear models tobetter support analyses of continuous dependent variable for several reasons.Firstly, to account for the random effects for when a set of levels in a factorare seen not as complete but rather a sample of all possible values. Forexample, when a factor such as car brand has data from only 20 of thepossible 100 brands. Random effects allow researchers to infer over a widerpopulation, in contrast to having a fixed size population as with the linearmodels. Secondly, when factors are measured at more than one level, thiscreates a hierarchy of effects. The linear mixed model captures the nestedrandom intercept effects of higher levels on the intercepts and coefficients atthe lowest level.The core of mixed models’ methodology is the incorporation of fixed andrandom effects, which are unobserved random variables. A linear mixed453.1. Linear Mixed Modelsmodel is expressed in the following form:y = Xβ + Zu+ (3.1)where y is a N ×1 column vector of samples of observations on the outcomevariable; X is a N ×p design matrix of the p predictor variables; β is a p×1column vector of the fixed-effect regression coefficients; Z is the N × qJblock matrix for the q random effects and J groups; u is a qJ ×1 vector of qrandom effects (the random complement to the fixed β) for J groups (levelswithin the random effects predictor); and is a N × 1 column vector of theresiduals or errors, that part of y is not explained by the model Xβ + Zu.Typically, Z is a N × qJ sparse matrix containing 0s and 1s, each columnrepresenting the random effects term, each row representing an observation.To recap:N × 1︷︸︸︷y =N × 1︷ ︸︸ ︷X︸︷︷︸N × pβ︸︷︷︸p× 1+N × 1︷ ︸︸ ︷Z︸︷︷︸N × qJu︸︷︷︸qJ × 1+N × 1︷︸︸︷ (3.2)In the frequentist statistical methodology, we do not estimate u (Intro-duction to Linear Mixed Models, n.d.). Instead we assume u is normallydistributed with mean 0 and variance-covariance matrix G: u ∼ N (0, G)As fixed effects are directly estimated (including the intercept), the ran-dom effect complements are modeled as deviations from the fixed effects,hence, having 0 mean. G is a q × q matrix containing many redundant el-ements. G may be a diagonal matrix when random effects are assumed tobe independent. Furthermore, G = σ2uI when random effects are assumedto be identically distributed each with variance = σ2u, called the variancecomponent representing variability in the response variable across factorsrepresented by random effects.The variance-covariance matrix of the residuals or rather the variance-covariance matrix of the conditional distribution of (y|β; u) is of the form:R = Iσ2 , where I is the identity matrix and σ2 is the residual variancecomponent. This structure assumes homogeneous residual variance for allobservations and they are conditionally independent.To model the data, we utilize the lme4 package developed by Bates et al.(2015). The lme4 package provides functions to fit and analyze linear mixedmodels, generalized linear mixed models and nonlinear mixed models. Thespecific function that will be used is the lmer function, which takes on thefollowing parameters:463.2. The SkyTrax Data Analysis Results1 lmer(formula, data = NULL, REML = TRUE, control = ...lmerControl(), start = NULL, verbose = 0L, subset, ...weights, na.action, offset, contrasts = NULL, ...devFunOnly = FALSE)3.2 The SkyTrax Data Analysis ResultsThe SkyTrax data as described in Chapter 2 contains 28,241 reviews pro-vided by travellers across 85 airlines and 4 derived continents (America,Europe, Asia, Africa/Middle East). Our outcome, y is a continuous vari-able representing sentiment scores for all reviews. Further, we have 3 fixedeffects predictors, Seat Type (Economy, Business/First Class), Trip Verified(0 = no, 1 = yes), COVID (0 = before COVID, 1 = during COVID), anda fixed intercept. The seat type factor contains two levels; Economy whichincludes the Regular Economy and Premium Economy classes, as well asBusiness/First Class which includes the Business and First classes. TheTrip Verified is a boolean factor which indicates reviews where users sup-plied proof of travel with their ticket, booking or boarding pass at the ofwriting a review. The COVID predictor is a boolean where 1 representsreviews after January 1, 2020 and 0 for reviews before that date.In Section 2.2, we discovered differences of sentiment scores between theseat types Business/First Class and Economy as depicted in Figure 2.6. Inparticular, we noticed the passengers flying Business/First Class had highermedian sentiment scores as compared to the Economy Class. We have in-ferred that customers who purchased Business/First Class tickets have ahigher propensity to provide better review rating. Figure 2.9 revealed adrastic change in sentiment score when travel restrictions were put in placeas a result of COVID-19. Additionally, it is observed that trip verifiedcustomers who flew on Business/First Class tend to provide substantiallyhigher sentiment scores than that of the unverified customers. On the con-trary, there is not a noticeable difference of sentiment scores between verifiedand unverified Economy class customers. We noticed a slight increase in thesentiment score across all the Economy Class right after COVID-19 wasdiscovered, which then declined in late 2020. It is perhaps a lagging effectof COVID-19 travel restrictions that resulted in such trend. Figure 2.10revealed that some airlines have higher median sentiment score that otherairlines. We observed airlines such as American Airlines and United Airlineshave more outliers. Based on Table 2.4, we know that some airlines havemore reviews than others and that services are correlated within a particular473.2. The SkyTrax Data Analysis Resultsairline. As a result, there are differences in the variability of the sentimentscores across different airlines. The differences in sentiment scores by fac-tors such as seat type, trip verification and COVID, combined with airlineto airline variability, has led us to utilize linear mixed models below:• Random Intercepts ModelIn this model, we expect the sentiment score within airlines to be cor-related, hence setting it as a random intercept, as within a particularairline, customers are similar. This model allows us to estimate thevariability of the sentiment scores between the different airlines, aswell as review to review differences.We have allowed the fixed-effect predictors Seat Type, Trip Verifiedand COVID to interact with each other, to which we expect coefficientsof each individual predictor and all possible combination of interac-tions between these predictors. These coefficients are fixed across allairlines, with the coefficients of the random intercept the only varyingcoefficient. The Seat Type predictor compares the average sentimentscores of reviews by Economy and Business/First Class travellers. TheTrip Verification predictor compares the average sentiment score ofreviews by verified and unverified travellers. The COVID predictorcompares periods before and during COVID. The following code isutilized in R to produce the nested random intercept model using theSkyTrax data1 lmer(sentiment.score ∼ seat.type * trip.verified * ...covid + (1|airline), data = skytrax, REML = T)The full model is as shown28241× 1︷︸︸︷y =28241× 1︷ ︸︸ ︷X︸︷︷︸28241× 8β︸︷︷︸8× 1+28241× 1︷ ︸︸ ︷Z︸︷︷︸28241× 85u︸︷︷︸85× 1+28241× 1︷︸︸︷ (3.3)• Nested Random Intercepts ModelIn this model, airlines are nested in continents in such a way thatevery airline is associated with only one continent. The continentsare derived from the country where the airline is headquartered in.We have configured the nested model as we expect that sentimentscores within continents and airlines may be correlated. We positthat airlines operating in specific continent has a certain baseline of483.2. The SkyTrax Data Analysis Resultsservice level, or rather customers who flew with those airlines have setexpectations that differ from continent to continent, in addition to thedifference in service level from airline to airline. This model allows usto assess deviation of sentiment scores between airlines and continent,as well as obtaining a baseline for individual continents. As a result,this structure captures the variability of sentiment scores between andwithin continents, in addition to the variability from review to review.Similar to the Random Intercepts Model, we have allowed the fixed-effect predictors Seat Type, Trip Verified and COVID to interact witheach other, to which we expect coefficients of each individual predictorand all possible combination of interactions between these predictors.These coefficients are fixed across all airlines and continents, with thecoefficients of the random intercept the only varying coefficient. Weexpect 89 random coefficients, 4 of which from the continents and theremainder 85 from the airlines. The Seat Type predictor compares theaverage sentiment scores of reviews by Economy and Business/FirstClass travellers. The Trip Verification predictor compares the averagesentiment score of reviews by verified and unverified travellers. TheCOVID predictor compares periods before and during COVID. Thefollowing code is utilized in R to produce the random intercept modelusing the SkyTrax data1 lmer(sentiment.score ∼ seat.type * trip.verified * ...covid + (1|continent/airline), data = skytrax, ...REML = T)The full model is as shown28241× 1︷︸︸︷y =28241× 1︷ ︸︸ ︷X︸︷︷︸28241× 8β︸︷︷︸8× 1+28241× 1︷ ︸︸ ︷Z︸︷︷︸28241× 89u︸︷︷︸89× 1+28241× 1︷︸︸︷ (3.4)Fixed-effects: The summary of the fixed-effects parameter estimates andmodel fit statistics for both the random intercept and nested models arepresented in Table 3.1. In the first column, we have the predictor labels ofthe model. As both models have the same dependent variable, SentimentScore, they share a joint column within the Model section. For each param-eter estimates, we have the associated coefficients, along with the standarderrors of the coefficients (in parenthesis) below each of them. Significant493.2. The SkyTrax Data Analysis ResultsTable 3.1: Summary of the fixed-effects parameter estimates and statisticscharacterizing model fit for SkyTrax dataModelFactor Random Intercept NestedIntercept 0.076∗∗∗ 0.072∗∗∗(0.007) (0.012)Seat Type −0.015∗∗ −0.015∗∗(0.006) (0.006)Trip Verified 0.017∗∗∗ 0.017∗∗∗(0.006) (0.006)COVID 0.010 0.010(0.010) (0.010)Seat Type * Trip Verified −0.018∗∗∗ −0.018∗∗∗(0.006) (0.006)Seat Type * COVID −0.008 −0.008(0.011) (0.011)Trip Verified * COVID −0.017 −0.017(0.011) (0.011)Seat Type * Trip Verified * COVID 0.015 0.015(0.012) (0.012)Sample Size 28,241 28,241Log Likelihood 26,759.000 26,774.000Akaike Inf. Crit. (AIC) −53,498.000 −53,525.000Bayesian Inf. Crit. (BIC) −53,416.000 −53,435.000Note: ∗p<0.1; ∗∗p<0.05; ∗∗∗p<0.01503.2. The SkyTrax Data Analysis Resultscoefficients are indicated by the asterisks on the right (more asterisks meansignificance at a lower level). For a given predictor, significance of a coeffi-cient indicates association between the predictor and the outcome variable(Sentiment Score), that is whether the beta coefficient of the predictor issignificantly different from 0.The fixed-effect coefficients and standard errors for both the models aresimilar with the exception of the intercept, where the random interceptmodel has an intercept estimate of 0.076 (with standard error of 0.007), ascompared to the nested model with an intercept estimate of 0.072 (withstandard error of 0.012). This difference is due to the fact that the nestedmodel includes the continent factor as part of its multi-leveled modellingand therefore reducing the intercept coefficient to account for continent.Notably, the standard error of the intercept for the nested model is 0.005higher than that of the random intercept model because the nested modelincludes additional continent factor as part of its variability. The interceptis also a significant parameter and represents a reference group for the meansentiment score of unverified customers that fly before the COVID-19 periodon Business/First Class.For the remainder fixed-effects coefficients, there are several notable onessuch as the Seat Type, Trip Verified and the interaction between Seat Typeand Trip Verified, all of which are significant at a significance level of atmost 0.05. We conclude that, overall, the customers who have their tripverified on the SkyTrax website leave higher (positive) sentiment reviewswith an average of 0.017 sentiment score more than that of customers withan unverified status on SkyTrax. It is plausible that customers who havesomewhat worse experience are less likely to go through the trip verification.It can be seen that customers who fly with Economy is significantly associ-ated with an average decrease in sentiment score of 0.015, as compared tocustomers who fly on Business/First Class. Generally, customers who fly onBusiness Class or First Class get better service, in terms of boarding prior-ity, seat comfort, and food, as compared to customers who fly on EconomyClass. Hence, we posit travellers who fly on Business/First Class tend toleave higher sentiment score in reviews. When considering the interactioncoefficient of Seat Type and Trip Verified, we discover that customers whohave their trip verified is significantly associated with an average decreaseof 0.033 (0.015 + 0.018) for those who fly in Economy class relative to theBusiness/First Class before the COVID period. Economy class customerswhose trips are verified seem to be more critical in that they leave reviewswith lower sentiment scores as compared to unverified customers on Econ-omy class. We observe there is no difference in sentiment scores before and513.2. The SkyTrax Data Analysis Resultsduring COVID-19 period.Table 3.2: 95% Confidence Interval for the parameters of the random inter-cept model for SkyTrax dataParameter 2.5% 97.5%σu 0.026 0.035σ 0.092 0.094Intercept 0.063 0.089Seat Type -0.027 -0.003Trip Verified 0.006 0.029COVID -0.010 0.030Seat Type * Trip Verified -0.030 -0.006Seat Type * COVID -0.029 0.013Trip Verified * COVID -0.038 0.005Seat Type * Trip Verified * COVID -0.008 0.038Confidence Interval of Fixed-effects: Table 3.2 provides the numeri-cal summary of the 95% confidence interval of the parameters. We noticesome of the confidence intervals of the parameters cover 0, in particularthe COVID-19 along with its interaction parameters. This indicates non-significance of the parameter association to the outcome variable; in otherwords, there is no strong evidence that COVID-19 period is associated withthe sentiment score of the reviews, as compared to the period before COVID-19. On the other hand, we notice several parameters that confidence inter-vals do not cover 0 - Intercept, Seat Type, Trip Verified, and the interactionbetween Seat Type and Trip Verified. This agrees with the results of thefixed-effects parameter estimates presented in Table 3.1.Table 3.3: Variance components of the random intercept model for SkyTraxdataGroup Variance Std. DeviationAirline 9.12E-04 3.02E-02Residual 8.69E-03 9.32E-02Total 9.61E-03Variance Components: The variance components of the random inter-cept and nested random intercept models are presented in tables 3.3 and 3.4,523.2. The SkyTrax Data Analysis ResultsTable 3.4: Variance components of the nested random intercept model forSkyTrax dataGroup Variance Std. DeviationAirline:Continent 5.74E-04 2.40E-02Continent 3.93E-04 1.98E-02Residual 8.69E-03 9.32E-02Total 9.66E-03respectively. For the random intercept model, the total variability is 0.00961(0.000912 + 0.00869). Airlines account for 9.5% of the total variability, whilethe remaining 90.5% of the variability is explained by the residuals (reviewto review differences). The nested model, on the other hand, has a totalvariability is 0.00966. The variability of the continent constitutes 5.9% ofthe total variability, while airline constitutes 4.1%. The remainder 90% ofthe variability is explained by the residuals.Figure 3.1: Residual vs fitted values plot of the‘ random intercept model forSkyTrax dataFigure 3.1 illustrates the residuals versus the fitted values of the random533.2. The SkyTrax Data Analysis ResultsFigure 3.2: Residual vs fitted values plot of the random intercept model forSkyTrax data faceted by seat type, verification status and COVID indicator.Select airlines highlighted in colorintercept model. The fitted values span from 0 to 0.2 whereas the residualvalues span from -0.5 to 0.5. As the fitted values get larger, the residualsdepart from 0 in a fairly symmetric manner. However, we do notice a mild“funnelling” effect, that is the residuals spread out for small fitted valuesand gets closer to 0 for larger fitted values. Reviews with higher fittedsentiment scores seem to have smaller spread in residual values than thereviews with lower fitted sentiment scores. We also notice that the pointsof the plot line up in a vertical line and we attribute this to have residualvalues that vary on a singular fitted value. Additionally, there is a smallgap between 0.16 and 0.18 where there is only 1 fitted value. Upon furtherinspection, we come to realize this gap arise from the data points of HainanAirlines with high fitted values. Figure 3.2 facets the residual plot by seattype, verification status and COVID indicator, as well as highlights the datapoints of Hainan Airlines in green and ANA All Nippon Airways in yellow.We observe the “funnelling” effect is more visible under the Economy Class.Hainan Airlines appears to have higher fitted values than the other airlines,543.2. The SkyTrax Data Analysis Resultsrepresents an outlier in the SkyTrax dataset.Comparison of Airlines:Table 3.5 exhibits the predictions of random effects for the random interceptmodel represented by conditional mode. We observe that the predicted val-ues vary from -0.045 to 0.095, with the sum of the conditional modes equalto -0.002 due to rounding error. We notice the top 5 airlines with highestconditional mode to be Hainan Airlines (0.095), ANA All Nippon Airways(0.067), EVA Air (0.06), Air Astana (0.057) and Garuda Indonesia (0.056).All of these airlines operate in the Asian region. It is plausible that travellersin Asia have lower expectations from airlines, hence, leaving mostly positivereview sentiment scores. Noticeably, most airlines with positive conditionalmodes are Asian airlines. The bottom 5 airlines with the lowest conditionalmode are La Compagnie (-0.04), Sunwing Airlines (-0.04), Frontier Airlines(-0.042), American Airlines (-0.043) and Jetstar Airways (-0.045). The ma-jority of the bottom 5 airlines (Sunwing, Frontier and American) are basedin America. Contrary to the Asian airlines, perhaps customers who fly withairlines in other regions such as America and Europe have higher expecta-tion. We observe most airlines that have negative conditional modes areeither from the American or European continents. Figure 3.3 presents theairline conditional modes along with the corresponding 95% prediction in-tervals, the black dots are the estimated conditional mode and the lines arethe prediction interval. Several airlines have wide prediction intervals, suchas Azerbaijan Airlines, Croatia Airlines, La Compagnie, Caribbean Airlines,and Jazeera Airways (widest).Figure 3.4 illustrates the continent conditional modes along with thecorresponding 95% prediction intervals, the black dots are the estimatedconditional mode and the lines are the prediction interval. The Asia conti-nent stood out with a predicted sentiment score of 0.271. This agrees withour findings on the predicted random effects of the random intercept model,where the top 5 airlines with highest conditional mode are all Asian airlines.Other continents such as Africa/Middle East, Europe and America havenegative predicted sentiment scores. In particular, the America continenthas the lowest predicted sentiment score, with a predicted 95% upper boundof less than 0. We attribute this low continent predicted sentiment score tothe negative conditional modes of sentiment score for airlines based in thatcontinent, such as Sunwing Airlines, Frontier Airlines, American Airlines,Air Canada, etc.553.2. The SkyTrax Data Analysis ResultsTable 3.5: Conditional Mode of the random effects for the random interceptmodel, each airline is an interceptAirline Conditional Mode Airline Conditional ModeHainan Airlines 0.095 Emirates -0.005ANA All Nippon Airways 0.067 Aerolineas Argentinas -0.005EVA Air 0.060 Air India -0.007Air Astana 0.057 Saudi Arabian Airlines -0.007Garuda Indonesia 0.056 Southwest Airlines -0.010Bangkok Airways 0.054 Thomas Cook Airlines -0.010Aegean Airlines 0.048 WestJet Airlines -0.011Qatar Airways 0.048 Hawaiian Airlines -0.011Japan Airlines 0.042 Aer Lingus -0.011Asiana Airlines 0.042 South African Airways -0.014Azerbaijan Airlines 0.040 Caribbean Airlines -0.014Singapore Airlines 0.036 Alitalia -0.015Korean Air 0.033 Air Transat -0.015Citilink 0.031 Spirit Airlines -0.015IndiGo 0.030 Alaska Airlines -0.018China Airlines 0.027 British Airways -0.018SriLankan Airlines 0.022 Turkish Airlines -0.020Cathay Pacific Airways 0.021 Air Canada -0.020Philippine Airlines 0.020 Delta Air Lines -0.020Royal Brunei Airlines 0.016 China Eastern Airlines -0.021Middle East Airlines 0.015 easyJet -0.021SilkAir 0.015 Brussels Airlines -0.023KLM Royal Dutch Airlines 0.012 Jet Airways -0.023Royal Air Maroc 0.011 Aeromexico -0.024Qantas Airways 0.010 Kenya Airways -0.026Swiss Intl Air Lines 0.009 Etihad Airways -0.027El Al Israel Airlines 0.008 Air China -0.028Aeroflot 0.008 Jazeera Airways -0.028Oman Air 0.007 TAP Portugal -0.029Austrian Airlines 0.007 Porter Airlines -0.031Croatia Airlines 0.007 Air Europa -0.031Air New Zealand 0.006 CSA Czech Airlines -0.032Malaysia Airlines 0.005 Condor Airlines -0.033Vietnam Airlines 0.005 Kulula -0.033Bulgaria Air 0.004 Iberia -0.034Norwegian 0.003 Air Arabia -0.035Finnair 0.003 United Airlines -0.037Air France 0.001 La Compagnie -0.040Lufthansa 0.000 Sunwing Airlines -0.040Egyptair 0.000 Frontier Airlines -0.042Gulf Air -0.002 American Airlines -0.043AirAsia -0.004 Jetstar Airways -0.045SAS Scandinavian -0.005563.2. The SkyTrax Data Analysis ResultsFigure 3.3: 95% prediction intervals on the random effects for the randomintercept model for SkyTrax573.2. The SkyTrax Data Analysis ResultsFigure 3.4: 95% prediction intervals on the random effects of continent forthe nested for SkyTrax583.3. Trip Advisor Data Analysis Results3.3 Trip Advisor Data Analysis ResultsTrip Advisor data is described in Chapter 2 containing 208,049 reviewsacross 95 airlines and 4 continents (America, Europe, Asia, Africa/MiddleEast). We have 2 fixed effects predictors, Seat Type (Economy, Business/-First Class), COVID (0 = before COVID, 1 = during COVID). Contraryto the SkyTrax dataset, the Trip Advisor platform does not have a reviewverification feature for customers. The Seat Type and COVID predictorsfor Trip Advisor have similar levels to that of SkyTrax. The seat type factorcontains two levels; the Economy Class which includes Economy and Pre-mium Economy, the Business/First Class which includes the Business Classand First Class. The COVID predictor is a boolean where 1 representsreviews made by customers after January 1, 2020 and 0 for reviews madebefore that date.In Section 2.3, we discovered a difference in sentiment scores between thedifferent seat types of Business/First Class and Economy Class as shownin Table 2.12. On review ratings 1 to 3, it seems that the median senti-ment scores for reviews left by passengers who flew on Business/First Classare higher as compared to the median sentiment scores of passengers whoflew on the Economy Class. As for review ratings 4 to 5, the differencesbetween sentiment scores of both Business/First and Economy Class aresubtle. Across all ratings, we do observe higher spread in the sentimentscores for the Economy Class as compared to Business/First Class. Basedon Figure 2.15, where it depicts the differences of sentiment scores betweenthe Seat Type and the COVID factor, we found that passengers who flewon Business/First Class had consistently left feedback with higher sentimentcontent, across periods before and during COVID, as compared to passen-gers who flew on Economy Class. When we plotted the sentiment scoresacross time (Figure 2.16), we noticed a different trend than the SkyTraxequivalent (Figure 2.9). Since late-2016, the Business/First Class categoryhad consistently higher sentiment score than the Economy Class category.A very noticeable trend is the decline of sentiment scores during the start ofCOVID-19 as depicted by the red line. Further, Figure 2.17 illustrated moreoutliers associated to each airlines on the Trip Advisor platform. Althoughthe SkyTrax and Trip Advisor platforms share similar predictors such asCOVID and Seat Type, the sentiment scores seem to vary differently for thepredictors of these separate platforms.We fit the following models to the Trip Advisor data to confirm thedifferences in sentiment score for the predictors:593.3. Trip Advisor Data Analysis Results• Random Intercepts ModelSimilar to the SkyTrax random intercept model, we expect the senti-ment score within airlines to be correlated for the Trip Advisor dataset,hence we allowed the airlines to vary as a random intercept. Thismodel allows us to estimate the variability of the sentiment scoresacross the different airlines, as well as customer reviews. In this model,we have allowed the fixed-effects predictors Seat Type and COVID tointeract with each other, where we can expect coefficients of individualpredictors and the combination of interactions between the predictors.These coefficients are fixed across all airlines, with the coefficients ofthe random intercept the only varying coefficient. The Seat Type pre-dictor compares the average sentiment score of the reviews by Economyand Business/First Class travellers. The COVID predictor comparesperiods before and during COVID. The following code is utilized in Rto produce the random intercept model using Trip Advisor data1 lmer(sentiment.score ∼ seat.type * covid + ...(1|airline), data = tripadvisor, REML = T)The full model is as shown208049× 1︷︸︸︷y =208049× 1︷ ︸︸ ︷X︸︷︷︸208049× 4β︸︷︷︸4× 1+208049× 1︷ ︸︸ ︷Z︸︷︷︸208049× 95u︸︷︷︸95× 1+208049× 1︷︸︸︷ (3.5)• Nested Random Intercepts ModelFor this model, airlines are nested in continents where every airlinehas a single membership to a continent. The continents are derivedfrom the country where the airline is headquartered in. The nestedmodel structure allows us to capture and assess deviation of sentimentscores between and within the airlines and continents. We expectthe sentiment scores within airlines nested in the continents to becorrelated. This correlation may be caused by different service levelprovided by airlines, as well as customers of different continents havingdifferent levels of expectations. As a result, this structure capturesthe variability of sentiment scores between and within continents, inaddition to the variability from review to review.Similar to the Random Intercepts Model, we have allowed the fixed-effect predictors Seat Type and COVID to interact with each other,to which we expect coefficients of each individual predictor and all603.3. Trip Advisor Data Analysis Resultspossible combination of interactions between these predictors. Thesecoefficients are fixed across all airlines and continents, with the coeffi-cients of the random intercept the only varying coefficient. We expect99 random coefficients, 4 of which from the continents and the re-mainder 95 from the airlines. The Seat Type predictor compares theaverage sentiment scores of reviews by Economy and Business/FirstClass travellers. The Trip Verification predictor compares the averagesentiment score of reviews by verified and unverified travellers. TheCOVID predictor compares periods before and during COVID. Thefollowing code is utilized in R to produce the nested random interceptmodel using the Trip Advisor data1 lmer(sentiment.score ∼ seat.type * covid + ...(1|continent/airline), data = tripadvisor, REML = T)The full model is as shown208049× 1︷︸︸︷y =208049× 1︷ ︸︸ ︷X︸︷︷︸208049× 4β︸︷︷︸4× 1+208049× 1︷ ︸︸ ︷Z︸︷︷︸208049× 99u︸︷︷︸99× 1+208049× 1︷︸︸︷ (3.6)Fixed-effects: The summary of the fixed-effects parameter estimates andmodel fit statistics for both the random intercept and nested random in-tercept model are presented in Table 3.6. In the first column, we havethe predictor labels of the model. As both models have the same depen-dent variable, Sentiment Score, they share a joint column within the Modelsection. For each parameter estimates, we have the associated coefficients,along with the standard errors of the coefficients (in parenthesis) below eachof them. Significant coefficients are indicated by the asterisks on the right(more asterisks mean significance at a lower level). For a given predictor,significance of a coefficient indicates association between the predictor andthe outcome variable (Sentiment Score), that is whether the beta coefficientof the predictor is significantly different from 0.The fixed effect coefficients and standard errors for both the modelsare similar with the exception of the intercept, where the random interceptmodel has an intercept estimate of 0.129 (with standard error of 0.003), ascompared to the nested random intercept model with an intercept estimateof 0.127 (with standard error of 0.012). This is due to the fact that thenested random intercept model includes the continent factor as part of its613.3. Trip Advisor Data Analysis ResultsTable 3.6: Summary of the fixed-effects parameter estimates and statisticscharacterizing model fit for Trip Advisor dataModelFactor Random Intercept NestedIntercept 0.129∗∗∗ 0.127∗∗∗(0.003) (0.005)Seat Type −0.017∗∗∗ −0.017∗∗∗(0.001) (0.001)COVID −0.014∗∗∗ −0.014∗∗∗(0.002) (0.002)Seat Type * COVID −0.0004 −0.0004(0.002) (0.002)Sample Size 208,049 208,049Log Likelihood 132,660.000 132,662.000Akaike Inf. Crit. (AIC) −265,308.000 −265,309.000Bayesian Inf. Crit. (BIC) −265,246.000 −265,238.000Note: ∗p<0.1; ∗∗p<0.05; ∗∗∗p<0.01multi-leveled model and therefore reducing the intercept coefficient to ac-count for continent. Additionally, the standard error of the intercept for thenested random intercept model is four times higher than that of the randomintercept to account for the variability introduced by the continent factor.The intercept is a significant parameter, representing a reference group forthe mean sentiment score of customers that fly on the Business/First Classcategory before the COVID-19 period.We notice significance of individual coefficients for the Seat Type andCOVID factor at a 0.01 significance level. Customers who fly with Econ-omy is significantly associated with an average decrease in sentiment scoreof 0.017 with 0.001 standard error as compared to SkyTrax with an averagedecrease of 0.017 with 0.006 standard error. This agrees with our view oncustomers who flew on Business/First Class get better service and treat-ment in general, compared to customers who flew on the Economy Class,thus leaving better sentiment scores. The significance of the Seat Type coef-ficient on the Trip Advisor dataset agrees with that of the SkyTrax randomintercept model. Noticeably, the standard error of the Seat Type coefficientfor Trip Advisor is smaller than that of SkyTrax, suggesting lesser variability623.3. Trip Advisor Data Analysis Resultsin this coefficient for the Trip Advisor dataset.Contrary to the SkyTrax dataset, the coefficient for the COVID factoris significantly associated with an average decrease in sentiment score of0.014 with a standard error of 0.002. We conclude that customers who flyduring the COVID-19 period leave lower (negative) sentiment reviews thanthat of customers who fly before the COVID-19 period. This agrees withour finding on Figure 2.16, where there is stark decline of sentiment scoresduring the COVID-19 period. We found no significant relationship betweenthe Seat Type and COVID predictors, that there is no difference in thesentiment scores of the reviews left by travellers who fly on Economy orBusiness/First Class on periods before and during COVID.Table 3.7: 95% Confidence Interval for the parameters of the random inter-cept model for Trip Advisor dataParameter 2.5% 97.5%σu 0.027 0.036σ 0.127 0.128Intercept 0.123 0.136Seat Type -0.019 -0.015COVID -0.017 -0.010Seat Type * COVID -0.004 0.003Confidence Interval of Fixed-effects: The numerical summary of the95% confidence interval of the parameters are presented in Table 3.7. Ofall the parameters, only the interaction coefficient between Seat Type andCOVID covers 0. This further supports on our findings on Figure 2.16, thestark decline affected both Business/First and Economy Class categories andthere is no one seat type that declined more than the other. The remainingparameters that confidence intervals does not cover 0 - Intercept, Seat Type,COVID, which agrees with the significance results portrayed on Table 3.6.Variance Components: The variance components of the random inter-cept and nested random intercept models are presented on tables 3.3 and3.4, respectively. For the random intercept model, the total variability is0.0173. Airlines account for 5.9% (0.000986/0.0173) of the total variability,while the remaining 94.1% (0.0163/0.0173) of the variability is explained bythe residuals (review to review differences). The nested random interceptmodel, on the other hand, has a total variability is 0.0173. The variability633.3. Trip Advisor Data Analysis ResultsTable 3.8: Variance components of the random intercept model for TripAdvisor dataGroup Variance Std. DeviationAirline 9.86E-04 3.14E-02Residual 1.63E-02 1.28E-01Total 1.73E-02Table 3.9: Variance components of the nested random intercept model forTrip Advisor dataGroup Variance Std. DeviationAirline:Continent 9.07E-04 3.01E-02Continent 8.22E-05 9.07E-03Residual 1.63E-02 1.28E-01Total 1.73E-02of the airline accounts for 5.2% (0.000907/0.0173) of the total variability,while continent accounts for 0.5%. The remainder 94.2% of the variabilityis explained by the residuals.Figure 3.5 is the plot of residuals versus the fitted values of the randomintercept model. The fitted values span from 0 to 0.26 whereas the residualvalues span from -0.65 to 0.65. As the fitted values get larger, the residu-als depart from 0 in a fairly symmetric manner. The residuals appear toconcentrate between the fitted values of 0.05 and 0.19. The points of theplot line up in a vertical line and we attribute this to have residual valuesthat vary on a singular fitted value. We notice two gaps in this plot; thefirst gap appears between fitted values of 0.02 and 0.05 and the second gapbetween fitted values of 0.19 and 0.026. Figure 3.6 facets the residual plotby seat type and COVID indicator, hightlights several airlines surroundingthe aforementioned gaps. For the first gap, we see Frontier Airlines (red),CSA Czech Airlines (maroon) and Jazeera Airways (pink) to have low fittedvalues compared to the majority of the airlines. Frontier Airlines seems tobe the outlier for fitted values in the Economy class during COVID. The sec-ond gap is more distinct and is attributed to high fitted values of Aeroflot(blue), ANA All Nippon Airways (dark green) and Middle East Airlines(light green). Aeroflot seems to be a clear outlier for fitted values in bothEconomy and Business/First Class during COVID.643.3. Trip Advisor Data Analysis ResultsFigure 3.5: Residual vs fitted values plot of the random intercept model forTrip Advisor data653.3. Trip Advisor Data Analysis ResultsFigure 3.6: Residual vs fitted values plot of the random intercept model forTrip Advisor data faceted by seat type and COVID indicator. Select airlineshighlighted in color663.3. Trip Advisor Data Analysis ResultsComparison of Airlines: Table 3.10 exhibits the random effects for therandom intercept model represented by the conditional modes, where eachairline is an intercept. Figure 3.7 visualizes these random effects along with95% prediction intervals. We observe the conditional models vary from -0.078 to 0.137, and as mentioned in Section 3.2, the expectation of theconditional mode is 0. Here, the sum of the conditional modes is 0.003due to rounding error. We notice the top 5 airlines with the highest condi-tional mode to be Aeroflot (0.137), ANA All Nippon Airways (0.059), Mid-dle East Airlines (0.051), Korean Air (0.047) and Singapore Airlines (0.045).Aeroflot, which is a Russian airline, have exceptionally higher conditionalmode as compared to the other airlines. We have identified in Figure 3.6that Aeroflot has higher fitted values compared to other airlines and this air-line represents an outlier in the dataset. The conditional mode of Aeroflotmore than double than the second highest conditional mode of 0.059 (ANAAll Nippon Airways). The majority of the top 5 airlines (ANA All Nippon,Korean and Singapore) are based in Asia. Similar to our findings in theSkyTrax dataset, we found most of the Asian airlines to have positive condi-tional modes. On the other hand, the bottom 5 airlines are LIAT (-0.047),Royal Air Maroc (-0.05), Jazeera Airways (-0.057), CSA Czech Airlines (-0.063) and Frontier Airlines (-0.078).Figure 3.8 visualizes the continent conditional modes along with 95%prediction intervals, the black dots are the estimated conditional mode andthe lines are the prediction interval. The Asia continent stood out with apredicted score of 0.0125, affirming our findings on the random effects of therandom intercept model, where the majority of the top 5 airlines are fromAsia. Visually, the estimated conditional modes for Europe, America andAfrica/Middle East hover around -0.003, with Africa/Middle East havingthe lowest estimated conditional mode and the widest prediction interval.It is plausible that customers who fly with airlines from these continentshave similar expectations in which is expressed through the sentiment scoreof the reviews they left following their travel experience.673.3. Trip Advisor Data Analysis ResultsTable 3.10: Conditional Mode of the random effects for the random interceptModel, each airline is an interceptAirline Conditional Mode Airline Conditional ModeAeroflot 0.137 Air Transat -0.001ANA All Nippon Airways 0.059 Lufthansa -0.002Middle East Airlines 0.051 WestJet Airlines -0.002Korean Air 0.047 easyJet -0.003Singapore Airlines 0.045 La Compagnie -0.003Japan Airlines 0.044 Air France -0.005EVA Air 0.040 Kenya Airways -0.005Air New Zealand 0.040 Malaysia Airlines -0.006Azerbaijan Airlines 0.038 Air Nostrum -0.011Aegean Airlines 0.035 Kulula -0.012Spirit Airlines 0.033 Saudi Arabian Airlines -0.012Air Astana 0.033 Philippine Airlines -0.012China Airlines 0.033 Jet Airways -0.013Qatar Airways 0.032 British Airways -0.013Thai Airways 0.031 Aeromexico -0.013SriLankan Airlines 0.030 AirAsia -0.015Southwest Airlines 0.030 Thomas Cook Airlines -0.016Finnair 0.029 Air Arabia -0.016Asiana Airlines 0.026 Cayman Airways -0.016Bangkok Airways 0.026 Brussels Airlines -0.018Hawaiian Airlines 0.024 Emirates -0.019Vietnam Airlines 0.020 Aerolineas Argentinas -0.019Delta Air Lines 0.020 Bulgaria Air -0.020Luxair 0.018 Norwegian -0.021Alaska Airlines 0.017 Croatia Airlines -0.022Garuda Indonesia 0.017 Air Macau -0.024IndiGo 0.016 Air Busan -0.026Citilink 0.016 Air China -0.026LAN Airlines (now LATAM Airlines) 0.014 Condor Airlines -0.026Hainan Airlines 0.014 Etihad Airways -0.026KLM Royal Dutch Airlines 0.013 Air Canada -0.027Cathay Pacific Airways 0.013 Jetstar Airways -0.027Royal Brunei Airlines 0.012 Air India -0.028Edelweiss Air 0.012 United Airlines -0.029South African Airways 0.011 China Eastern Airlines -0.030SAS Scandinavian 0.007 American Airlines -0.031Qantas Airways 0.007 TAP Portugal -0.032Gulf Air 0.007 Iberia -0.033Austrian Airlines 0.006 Sunwing Airlines -0.036Swiss Intl Air Lines 0.006 Air Algerie -0.036El Al Israel Airlines 0.005 Air Europa -0.045Egyptair 0.004 Alitalia -0.046Oman Air 0.003 LIAT -0.047Turkish Airlines 0.001 Royal Air Maroc -0.050Porter Airlines 0.000 Jazeera Airways -0.057SilkAir 0.000 CSA Czech Airlines -0.063Caribbean Airlines 0.000 Frontier Airlines -0.078Aer Lingus -0.001683.3. Trip Advisor Data Analysis ResultsFigure 3.7: 95% prediction intervals on the random effects for the randomintercept model, shown as a dotplot693.3. Trip Advisor Data Analysis ResultsFigure 3.8: 95% prediction intervals on the random effects of continent forthe nested random intercept for Trip Advisor703.4. The Combined Platform Data Analysis Results3.4 The Combined Platform Data AnalysisResultsThe analysis on the SkyTrax (Section 3.2) and Trip Advisor (Section 3.3)datasets revealed interesting findings in relation to the Seat Type and COVIDpredictors on both platforms; Seat Type was significant on both platform,while COVID was only significant on the Trip Advisor platform. Addition-ally, the COVID predictor did not make a difference on sentiment scorebetween the different seat types on Trip Advisor, while the converse is truefor the SkyTrax dataset. This has motivated us to model based on the com-bined dataset of both platforms, in hopes to confirm if there exist platformdifferences. On SkyTrax, we discovered the Trip Verification predictor tobe significant, that there is difference in the sentiment score of verified andunverified reviews. However, the Trip Advisor platform does not have theTrip Verified predictor. We have combined the dataset where the predictorsare common on both platforms and have created an additional Platformpredictor with levels ‘SkyTrax’ and ‘TripAdvisor’ to label reviews belong-ing to the respective platforms. As the Trip Advisor dataset contains 10additional airlines as compared to SkyTrax - which in total accounts for5,094 out of 208,049 reviews - we have removed these airlines from the com-bined dataset. The combined dataset of SkyTrax and Trip Advisor contains231,196 reviews across 85 airlines and 4 continents (America, Europe, Asia,Africa/Middle East). Our outcome, y is a continuous variable representingsentiment scores for all reviews. We have 3 fixed effects predictors, SeatType (Economy, Business/First Class), Platform (SkyTrax, TripAdvisor),COVID (0 = before COVID, 1 = during COVID), and a fixed intercept.We then proceed to fit the following models using the combined dataset• Random Intercepts ModelIn this model, we continue to expect the sentiment score within airlinesto be correlated in the combined dataset, hence we set airline as arandom intercept. Although there are two separate platforms in thedataset, the characteristics of airlines remain the same in that certainairlines specialize in different market segments, such as offering budgetor luxury flights. By setting the airlines as a random intercept, we areable to estimate the variability of the sentiment scores between thedifferent airlines, in addition to the review to review variability.We have set the Seat Type, COVID and Platform predictors as fixed-effects and have allowed the predictors to interact with each other,to which we expect coefficients of each individual predictor and all713.4. The Combined Platform Data Analysis Resultspossible combination of interactions between these predictors. Thesecoefficients are fixed across all airlines, with the airlines being thevarying intercept coefficient. The Seat Type predictor compares theaverage sentiment scores of reviews by Business/First and EconomyClass reviews. The COVID predictor compares the average sentimentscores between two periods - before and during COVID. The Platformpredictor compares the average sentiment score between the SkyTraxand Trip Advisor platforms. The following code is utilized in R toproduce the random intercept model using the combined data1 lmer(sentiment.score ∼ seat.type * platform * covid + ...(1|airline), data = combined, REML = T)The full model is as shown231196× 1︷︸︸︷y =231196× 1︷ ︸︸ ︷X︸︷︷︸231196× 8β︸︷︷︸8× 1+231196× 1︷ ︸︸ ︷Z︸︷︷︸231196u︸︷︷︸85 × 1+231196× 1︷︸︸︷ (3.7)• Nested Random Intercepts Model:For the nested random intercepts model, we continue to utilize thederived continent field, where each airline has a single membership.The structure of this model allows us to capture the deviation ofsentiment scores between and within the airlines and continents re-spectively as we expect the sentiment scores within airlines that arenested in the continents to be correlated. Although we have combineddatasets from SkyTrax and Trip Advisor, this correlation structureremains unchanged as the services provided by airlines do not change.We have allowed the fixed-effect predictors Seat Type, COVID andPlatform to interact with each other, to which we expect coefficients ofeach individual predictor and all possible combination of interactionsbetween these predictors. These coefficients are fixed across all nestedairlines within continents. As a result of this model, we expect 89random coefficients, 4 of which from the continents and the remainder85 from the airlines. The following code is utilized in R to producethe nested random intercept model1 lmer(sentiment.score ∼ seat.type * platform * covid + ...(1|continent/airline), data = combined, REML = T)723.4. The Combined Platform Data Analysis Results231196× 1︷︸︸︷y =231196× 1︷ ︸︸ ︷X︸︷︷︸231196× 8β︸︷︷︸8× 1+231196× 1︷ ︸︸ ︷Z︸︷︷︸231196× 89u︸︷︷︸89 × 1+231196× 1︷︸︸︷ (3.8)Table 3.11: Summary of the fixed-effects parameter estimates and statisticscharacterizing model fit for the combined data of SkyTrax and Trip AdvisorModelFactor Random Intercept NestedIntercept 0.093∗∗∗ 0.091∗∗∗(0.004) (0.007)Seat Type −0.035∗∗∗ −0.035∗∗∗(0.002) (0.002)COVID −0.008 −0.008(0.005) (0.005)Platform 0.037∗∗∗ 0.037∗∗∗(0.002) (0.002)Seat Type * COVID 0.003 0.003(0.006) (0.006)Seat Type * Platform 0.018∗∗∗ 0.018∗∗∗(0.002) (0.002)COVID * Platform −0.006 −0.006(0.006) (0.006)Seat Type * COVID * Platform −0.003 −0.003(0.006) (0.006)Sample Size 231,196 231,196Log Likelihood 153,921.000 153,926.000Akaike Inf. Crit. (AIC) −307,822.000 −307,830.000Bayesian Inf. Crit. (BIC) −307,718.000 −307,716.000Note: ∗p<0.1; ∗∗p<0.05; ∗∗∗p<0.01Fixed-effects: The summary of the fixed-effects parameter estimates andstatistics characterizing the model fits for both the random intercept andnested random intercept are presented in Table 3.11. In the first column,733.4. The Combined Platform Data Analysis Resultswe have the predictor labels of the model. As both models have the samedependent variable, Sentiment Score, they share a joint column within theModel section. For each parameter estimates, we have the associated fixedeffects coefficients, along with the standard errors of the coefficients (inparenthesis) below each of them. Significant coefficients are indicated by theasterisks on the right (more asterisks mean significance at a lower level). Fora given predictor, significance of a coefficient indicates association betweenthe predictor and the outcome variable (Sentiment Score), that is whetherthe beta coefficient of the predictor is significantly different from 0.The fixed effect coefficients and standard errors for both the modelsare similar with the exception of the intercept, where the random interceptmodel has an intercept estimate of 0.093 (with standard error of 0.004), ascompared to the nested random intercept model with an intercept estimateof 0.091 (with standard error of 0.007). As previously explained in Sections3.2 and 3.3, such differences in the intercept arise due to the additionalnested random intercept predictor Continent as part of the multi-level mod-eling. Therefore, this reduces the estimate while increasing the variability ofthe estimate. The standard error of the intercept estimate for the nested ran-dom intercept model is almost twice as much as the random intercept model.The intercept is a significant parameter and it represents the reference groupfor the average sentiment score of customers who fly on Business/First Classbefore COVID and left a review on the SkyTrax platform.While examining the other fixed-effects predictor, we found that SeatType, Platform and the interaction between Seat Type and Platform to besignificant at a significance level of 0.01. Customers who fly on EconomyClass leave lower (negative) sentiment reviews on an average of 0.035. Thisagrees with our findings on the SkyTrax and Trip Advisor dataset, thatcustomers who fly on the Business/First Class gets better service, hence,leaving better reviews as compared to customers who fly on Economy Class.As the Platform predictor is significant, we conclude that customers onthe Trip Advisor platform leave higher (positive) sentiment reviews on anaverage of 0.037 as compared to that of SkyTrax. We found that it is easierto leave a review on Trip Advisor as compared to SkyTrax, because thereis no verification process. Further, as Trip Advisor also serves as a bookingplatform, it has a feature where an automated email is sent to customersto leave feedback on their flight experience. Based on our observations,most reviews available on Trip Advisor are short in nature. It is plausiblethat the lenient review process coupled with an automated reminder, leadcustomer to leaving short feedback. Perhaps the lack of constructed criticismhas attributed to the positive association of the Trip Advisor platform to743.4. The Combined Platform Data Analysis Resultssentiment scores.We notice the interaction between the Seat Type and Platform predictorsis also significant. This result suggests that customers who fly on EconomyClass leave higher sentiment score with an average of -0.017 (-0.035 + 0.018)in their review on the Trip Advisor platform as compared to the SkyTraxplatform before the COVID period. We notice that the COVID predictorhas not a significant effect on the sentiment score, as with its interactionwith other predictors.Table 3.12: 95% Confidence Interval for the parameters of the random in-tercept model for the combined data of SkyTrax and Trip AdvisorParameter 2.5% 97.5%σ1 0.024 0.033σ 0.124 0.125Intercept 0.086 0.100Seat Type -0.039 -0.031COVID -0.018 0.003Platform 0.034 0.041Seat Type * COVID -0.008 0.014Seat Type * Platform 0.013 0.022COVID * Platform -0.016 0.005Seat Type * COVID * Platform -0.015 0.008Confidence Interval of Fixed-effects: Table 3.12 provides the numer-ical summary of the 95% confidence interval of the parameters. Severalconfidence intervals of the parameters cover 0, in particular the COVIDpredictor along with its associated interaction parameters. The lack of evi-dence to suggest that COVID is a significant predictor led us to believe thatthe COVID period does not affect public sentiment towards airlines, thatthe expectation level from customers prior and during COVID remain thesame.Variance Components: The variance components of the random inter-cept and nested random intercept models are presented on tables 3.13 and3.14 respectively. For the random intercept model, the total variability is0.016 (0.015 + 0.001). Airlines account for around 4.9% of the total variabil-ity, while the remaining 95.1% of the variability is explained by the residuals(review to review differences). For the nested random intercept model, the753.4. The Combined Platform Data Analysis ResultsTable 3.13: Variance components of the random intercept model for thecombined data of SkyTrax and Trip AdvisorGroup Variance Std. DeviationAirline 7.94E-04 2.82E-02Residual 1.54E-02 1.24E-01Total 1.62E-02Table 3.14: Variance components of the nested random intercept model forthe combined data of SkyTrax and Trip AdvisorGroup Variance Std. DeviationAirline:Continent 6.58E-04 2.57E-02Continent 1.51E-04 1.23E-02Residual 1.54E-02 1.24E-01Total 1.62E-02total variability is 0.016, similar to the random intercept model. The vari-ability of the airline accounts for 4.1% of the total variability, while continentconstitutes 0.9%. The remainder 95% of the variability is explained by theresiduals.Figure 3.9 shows the residual versus the fitted values of the randomintercept model for the combined data. The fitted values span from -0.01 to0.19 and the residual values span from -0.55 to 0.55. As the fitted values getlarger, the residuals depart from 0 in a fairly symmetric manner. However,the plot has mild “fanning” and “funnelling” effects, that is residual valuesare smaller when the fitted values are close to 0 and 0.19. The points of theplot line up in a vertical line due to residual values that vary on a singularfitted value, forming multiple vertical lines. Although we observed gaps inthis plot, found between 0 and 0.015 as well as 0.175 and 0.19, these gaps arenot as big as we have assessed in Figure 3.1 and Figure 3.5. Figure 3.10 facetsthe residual plot by platform, seat type and the COVID indicator, whereselect airlines are highlighted. The Trip Advisor platform has residuals ofhigher fitted values than the SkyTrax platform for all seat types and periods.Hainan Airlines and ANA All Nippon Airways are observed to have higherfitted values than the other airlines. On the other hand, Frontier Airlines,CSA Czech Airlines and Jazeera Airways are observed to have lower fittedvalues than the other airlines.763.4. The Combined Platform Data Analysis ResultsFigure 3.9: Residual vs fitted values plot of the random intercept model forcombined data773.4. The Combined Platform Data Analysis ResultsFigure 3.10: Residual vs fitted values plot of the random intercept modelfor combined data, select airlines highlighted in color783.4. The Combined Platform Data Analysis ResultsComparison of Airlines: Table 3.15 exhibits the random effects for therandom intercept model represented by the conditional modes, where eachairline is an intercept, while Figure 3.11 visualizes the random effects with95% prediction intervals. We observe the conditional models vary from -0.06and 0.062, and the expectation of the conditional mode is 0. Here, the sumof the conditional modes is 0.003 due to rounding error. We notice the top 5airlines with the highest conditional mode to be Aeroflot (0.062), ANA AllNippon Airways (0.06), Middle East Airlines (0.047), Korean Air (0.044)and Singapore Airlines (0.043). In the combined dataset, we observe thatAeroflot is the airline with the highest conditional mode, however, does nothave exceptionally high conditional mode as observed in the Trip Advisordataset. When we compared the conditional mode of Aeroflot on SkyTrax(0.008) and Trip Advisor (0.127), we believe the conditional mode of com-bined dataset to be the expected sentiment score of both the platforms. Themajority of the top 5 airlines in the combined dataset (ANA All Nippon,Korean and Singapore) are based in Asia. Further, most of the airlines withpositive conditional modes in this dataset are also based in Asia. Besidesthat, the bottom 5 airlines are Royal Air Maroc (-0.05), Jazeera Airways(-0.057), Frontier Airlines (-0.078) and CSA Czech Airlines (-0.063). Consis-tent with our comparison of airlines on Section 3.2 & 3.3, none of the bottom5 airlines are from Asia. As such, most airlines with negative conditionalmodes are based in Europe or America. Figure 3.12 shows the continentconditional modes along with the corresponding 95% prediction intervals,the black dots are the estimated conditional mode and the lines are the pre-diction intervals. The Asia continent has the highest predicted sentimentscore of 0.0166, meaning that any airline that operates in Asia have an ex-pected baseline of 0.0166 in sentiment score. Other continents have negativepredicted sentiment scores, although the upper bounds exceed 0.As we have now assessed the random effects of the combined platforms,it would be interesting to include a comparison of the random effects forSkyTrax and Trip Advisor platforms separately. Figure 3.13 depicts thescatterplot of the random effects for Trip Advisor against SkyTrax. Thegreen highlight represents the 5 airlines with the highest predictions on eachplatform, while the red highlight represents the 5 airlines with the lowest pre-diction scores of each platform. We observe the All Nippon Airways (ANA)is scored with the second highest predictions on both platforms. This agreeswith our result on the combined dataset, where ANA placed second highestin the prediction score behind Aeroflot. From the plot, it seems Hainan Air-lines and Aeroflot are outliers for the prediction scores of SkyTrax and TripAdvisor platforms respectively, where each of these airlines are individually793.4. The Combined Platform Data Analysis ResultsTable 3.15: Conditional Mode of the random effects for the random interceptModel, each airline is an interceptAirline Conditional Mode Airline Conditional ModeAeroflot 0.062 Turkish Airlines -0.003ANA All Nippon Airways 0.060 Air Transat -0.003Middle East Airlines 0.047 WestJet Airlines -0.004Korean Air 0.044 Malaysia Airlines -0.004Singapore Airlines 0.043 easyJet -0.005Japan Airlines 0.043 Air France -0.005EVA Air 0.042 Philippine Airlines -0.006Hainan Airlines 0.042 Porter Airlines -0.006Air Astana 0.040 La Compagnie -0.008Azerbaijan Airlines 0.039 Kenya Airways -0.009Aegean Airlines 0.036 Emirates -0.010Air New Zealand 0.036 AirAsia -0.011Garuda Indonesia 0.035 Saudi Arabian Airlines -0.012Qatar Airways 0.033 Kulula -0.014China Airlines 0.031 British Airways -0.015Bangkok Airways 0.029 Aeromexico -0.016Asiana Airlines 0.029 Thomas Cook Airlines -0.016SriLankan Airlines 0.028 Jet Airways -0.017Spirit Airlines 0.028 Bulgaria Air -0.018Southwest Airlines 0.027 Aerolineas Argentinas -0.019Finnair 0.019 Norwegian -0.020Vietnam Airlines 0.017 Brussels Airlines -0.020Citilink 0.016 Air Arabia -0.020IndiGo 0.016 Croatia Airlines -0.021Hawaiian Airlines 0.016 Air India -0.026Cathay Pacific Airways 0.014 Air China -0.027Alaska Airlines 0.013 Air Canada -0.027KLM Royal Dutch Airlines 0.012 Etihad Airways -0.027Royal Brunei Airlines 0.011 Condor Airlines -0.028Delta Air Lines 0.011 China Eastern Airlines -0.029South African Airways 0.008 United Airlines -0.031Qantas Airways 0.006 TAP Portugal -0.032Swiss Intl Air Lines 0.006 American Airlines -0.033Austrian Airlines 0.006 Iberia -0.034El Al Israel Airlines 0.004 Jetstar Airways -0.035SAS Scandinavian 0.004 Sunwing Airlines -0.038Gulf Air 0.004 Alitalia -0.042Oman Air 0.003 Royal Air Maroc -0.043Egyptair 0.003 Air Europa -0.043SilkAir 0.001 Jazeera Airways -0.058Caribbean Airlines -0.002 Frontier Airlines -0.059Lufthansa -0.002 CSA Czech Airlines -0.060Aer Lingus -0.003803.4. The Combined Platform Data Analysis ResultsFigure 3.11: 95% prediction intervals on the random effects for the randomintercept model, shown as a dotplot813.4. The Combined Platform Data Analysis ResultsFigure 3.12: 95% prediction intervals on the random effects of continent forthe nested random intercept for the combined dataset823.4. The Combined Platform Data Analysis ResultsFigure 3.13: Scatterplot of random effects for Trip Advisor against Skytrax.833.4. The Combined Platform Data Analysis Resultsscored the highest on each platform. Interestingly, we found that HainanAirlines showcase their SkyTrax rating on their website (Hainan Airlines,2022), though we did not find Aeroflot showcasing any Trip Advisor mate-rial on their website. Besides ANA, we noticed that except for Aeroflot, allairlines with the highest sentiment score prediction are based in the Asiacontinent. We posit two premise to explain this phenomenon; firstly, cus-tomers who fly with Asian airlines have lower expectations, hence, leavingmore positive reviews on these airlines. Secondly, airlines in Asia providebetter service overall as compared to airlines in other continents, harnessingmore positive reviews from travellers who fly with them. Table 3.16 summa-rizes the 5 airlines of each platform with the highest prediction of sentimentscores.We noted several interesting observations on the airlines with the lowestprediction scores. Frontier Airlines has one of the lowest sentiment scores onboth platforms as travellers leave more negative reviews towards the airlineon both platforms. Further, we do not observe any Asian airlines as part ofthe lowest prediction scores on both platforms. The majority of the airlineswith the lowest predictions on both platforms seem to be based in America.It is plausible our interpretation of the Asian airlines applies on the contraryto the American airlines, where customers have instead higher expectationsof the service level provided by the airlines. It could also be that theseAmerican airlines have poor services. An interesting observation we noticeRoyal Air Maroc, a Moroccon airline, has a negative prediction score onTrip Advisor, while maintaining a positive one on SkyTrax.Table 3.16: 5 airlines of each platform with the highest prediction scoresPlatform Airline Conditional Mode Review CountSkyTrax Hainan Airlines 0.095 295SkyTrax ANA All Nippon Airways 0.067 195SkyTrax EVA Air 0.06 229SkyTrax Air Astana 0.057 105SkyTrax Garuda Indonesia 0.056 420Trip Advisor Aeroflot 0.137 182Trip Advisor ANA All Nippon Airways 0.059 6,282Trip Advisor Middle East Airlines 0.051 469Trip Advisor Korean Air 0.047 921Trip Advisor Singapore Airlines 0.045 5,844843.4. The Combined Platform Data Analysis ResultsTable 3.17: 5 airlines of each platform with the lowest prediction scoresPlatform Airline Conditional Mode Review CountSkyTrax La Compagnie -0.04 25SkyTrax Sunwing Airlines -0.04 187SkyTrax Frontier Airlines -0.042 517SkyTrax American Airlines -0.043 1768SkyTrax Jestar Airways -0.045 423Trip Advisor LIAT -0.047 385Trip Advisor Royal Air Maroc -0.05 4,341Trip Advisor Jazeera Airways -0.057 356Trip Advisor CSA Czech Airlines -0.063 630Trip Advisor Frontier Airlines -0.078 50085Chapter 4ConclusionUsing linear mixed models, we have analyzed the quantitative sentimentscoring as extracted from the online reviews provided by airline customerson the SkyTrax and Trip Advisor platforms. In this endeavour, we havediscovered that passengers who fly on Economy Class tend to leave reviewswith lower (negative) sentiment scores as compared to Business/First Class.Passengers who fly on Economy Class may have higher expectations of theservice level provided by airlines; when the expectations are not met, theymake an effort to describe their travel experience on the Economy Class.On the other hand, Business/First Class passengers tend to receive betterservices in terms of boarding priority, seat comfort, food, and steward at-tention. Hence, passengers who fly on Business/First Class are seen to leavereviews with more positive content. A trip verification process entails morecritical reviews. We saw in Section 3.2 that SkyTrax passengers leave re-views with more positive content when they fly on Business/First Class andvice versa where passengers leave reviews with more negative content whenthey fly on Economy Class. The COVID-19 crisis did not affect the senti-ment content of passenger reviews on the SkyTrax platform, but affected thesentiment content negatively for reviews made on the Trip Advisor platform.By setting customers and airlines as random, we were able to rank air-lines with respect to the satisfaction, or rather expectation of passengers.All Nippon Airways (ANA) is scored with the highest predicted sentimentscores on both platforms, an indication that passengers have had positiveperception and left reviews with more positive content. On the other hand,Frontier Airlines is scored with the lowest predicted sentiment scores on bothplatforms. There are several airlines that we consider as outliers with highpositive predicted scores, Hainan Airlines on SkyTrax and Aeroflot on TripAdvisor. The random intercept model has consistently scored Asian airlineswith high positive random effects. We found the Asia continent to havehigh predicted sentiment scores on the nested model, which agrees with ourfindings on the individual random effects on the random intercept model.Passengers seem to have negative perception towards airlines operating inother continents such as America, Europe and Africa/Middle East.864.1. Revisions4.1 RevisionsWe have refitted the model without the three-factor interaction betweenCOVID, seat type and trip verified for SkyTrax data. Table 4.1 summarizesthe fixed-effects. We discovered that COVID was not significant, agreeingwith our initial model in Table 3.1.Table 4.1: Summary of the fixed-effects (fitted without three-way interac-tions) parameter estimates and statistics characterizing model fit for theSkyTrax dataModelRandom Intercept NestedIntercept 0.080∗∗∗ 0.075∗∗∗(0.006) (0.011)Seat Type −0.019∗∗∗ −0.019∗∗∗(0.005) (0.005)Trip Verified 0.013∗∗∗ 0.013∗∗∗(0.005) (0.005)COVID −0.002 −0.002(0.005) (0.005)Seat Type * Trip Verified −0.014∗∗∗ −0.014∗∗∗(0.005) (0.005)Seat Type * COVID 0.005 0.005(0.004) (0.004)Trip Verified * COVID −0.003 −0.003(0.003) (0.003)Sample Size 28,241 28,241Log Likelihood 26,762.000 26,776.000Akaike Inf. Crit. −53,506.000 −53,533.000Bayesian Inf. Crit. −53,432.000 −53,450.000Note: ∗p<0.1; ∗∗p<0.05; ∗∗∗p<0.01Figure 4.1 depicts and example of a review written on August 2019 bypassenger Donald Z who flew on Economy class with Spirit Airlines. Thepassenger gave a 5-star rating but the content of the review was scored -0.364by the QDAP algorithm. This shows a mismatch between the rating andsentiment score where the passenger wrote a review of negative sentiment874.1. Revisionsbut have inputted a high rating. It is plausible this passenger has a differentrating scale and understanding of review ratings, or this could just be anaccidental wrong input on the rating.Figure 4.1: A screenshot Trip Advisor review on August 2019 made bypassenger Donald Z who flew on Economy Class with Spirit Airlines.This review had 5-star rating but was scored -0.364 by the QDAP algo-rithm. Screenshot available from https://www.tripadvisor.com/AirlineReview-d8729157-Reviews-Spirit-AirlinesOn the other hand, Figure 4.2 depicts and example of a review writtenon August 2019 by passenger Pioneer823384 who flew on Economy classwith British Airways. The passenger gave a 1-star rating but the content ofthe review was scored 0.525 by the QDAP algorithm. There is a mismatchbetween the rating and the content of the review where the passenger wrotea review of positive sentiment but have inputted a low rating.While looking into the outlier airlines with high positive sentiment scoreof random effects, Table 4.2 summarizes the count of reviews of Hainan andAeroflot airlines by the two platforms SkyTrax and Trip Advisor. Thereseem to be more than 100 reviews for each of the outlier airlines for eachplatform.884.1. RevisionsFigure 4.2: A screenshot of Trip Advisor review on July 2019 by pas-senger Pioneer823384 who flew on Economy Class with British Airwars.This review had 1-star rating but was scored 0.525 by the QDAP algo-rithm. Screenshot available from https://www.tripadvisor.com/AirlineReview-d8729157-Reviews-Spirit-AirlinesPlatform Airline ReviewsSkyTraxHainan Airlines 295Aeroflot 277Trip AdvisorHainan Airlines 558Aeroflot 182Table 4.2: Summary of review counts of Hainan and Aeroflot airlines byplatform894.2. Future Work4.2 Future WorkFuture work could consider including intervention indicators, such as air-line mergers and airline alliances. Airline alliances are partnerships betweenor among airlines, where they share resources, pick up or extend partnerroutes and offer passengers the ability to earn and redeem mileage pointsthrough a unified rewards program. Codeshare flights allows customers tobook long-haul an d multi-connection flights through the same airline, al-though the flight may be operated by multiple airlines. Besides that, furtherexploration into time series modelling of the reviews data, where seasonal-ity of travel would affect volume of passenger travels, would enable airlinesto understand underlying causes of trends or systemic patterns over timeand better anticipate changes. Further, a combination of topic modellingand sentiment analysis of passenger reviews could be considered to capturetopics in reviews, as well as the proportion of topics to help airlines triageareas of improvement. Lastly, weather condition data may be incorporatedto study its effect on customer sentiment. Severe weather conditon causesflight delays and cancellations, disgruntled customers may be more prone towriting a bad review as a result of uncontrolled variables such as weather.90ReferencesAydin, O. (2018). R web scraping quick start guide: Techniques and toolsto crawl and scrape data from websites. Birmingham: Packt Publishing,Limited.Babic Rosario, A., Sotgiu, F., de Valck, K., & Bijmolt, T. H. A. (2016).The effect of electronic word of mouth on sales: A meta-analytic reviewof platform, product, and metric factors. Journal of marketing research,53 (3), 297-318.Bates, D., Ma¨chler, M., Bolker, B., & Walker, S. (2015). Fitting linearmixed-effects models using lme4. Journal of statistical software, 67 (1),1-48.Belobaba, P., Odoni, A. R., & Barnhart, C. (2009). The global airlineindustry (1. Aufl. ed.). Chichester, West Sussex, U.K;Reston, VA;: Wiley.Burton, J., & Khammash, M. (2010). Why do people read reviews posted onconsumer-opinion portals? Journal of marketing management , 26 (3-4),230-255.Filieri, R., & McLeay, F. (2014). E-wom and accommodation: An analysisof the factors that influence travelers’ adoption of information from onlinereviews. Journal of travel research, 53 (1), 44-57.Garson, D. (2013). Fundamentals of hierarchical linear and multilevel mod-eling. In (p. 3). Thousand Oaks: SAGE Publications, Inc.Gretzel, U., & Yoo, K.-H. (2017). Social media in hospitality and tourism.In (1st ed., p. 339-346). Routledge.Hainan Airlines. (2022). Hainan airlines - awards and honors.Retrieved from https://www .hainanairlines .com/HUPortal/dyn/portal/DisplayPage?LANGUAGE=GB&COUNTRY SITE=CA&SITE=CBHZCBHZ&PAGE=AWAD91ReferencesIATA. (2020a). Iata - fourth impact assessment. Retrievedfrom https://www .iata .org/en/iata -repository/publications/economic-reports/covid-fourth-impact-assessment/IATA. (2020b). Iata - third impact assessment. Retrieved from https://www.iata.org/en/iata-repository/publications/economic-reports/third-impact-assessmentIndustry High Level Group. (2019). Aviation benefits report. Retrievedfrom https://www.icao.int/sustainability/Documents/AVIATION-BENEFITS-2019-web.pdf (Accessed on 2022-06-24)International Telecommunication Union. (2021). Measuring digital devel-opment: Facts and figures 2021. Retrieved from https://www.itu.int/en/itu-d/statistics/pages/facts/default.aspxIntroduction to linear mixed models. (n.d.). Retrieved from https://stats.oarc.ucla.edu/other/mult-pkg/introduction-to-linear-mixed-models/Khan, K., Su, C.-W., Umar, M., & Yue, X.-G. (2021). Do crude oil pricebubbles occur? Resources policy , 71 , 101936.Korfiatis, N., Stamolampros, P., Kourouthanassis, P., & Sagiadinos, V.(2019). Measuring service quality from unstructured data: A topic model-ing application on airline passengers’ online reviews. Expert systems withapplications, 116 , 472-486.Liu, B. (2020). Sentiment analysis: mining opinions, sentiments, and emo-tions (Second ed.). Cambridge;New York;: Cambridge University Press.Lucini, F. R., Tonetto, L. M., Fogliatto, F. S., & Anzanello, M. J. (2020).Text mining approach to explore dimensions of airline customer satisfac-tion using online customer reviews. Journal of air transport management ,83 , 101760.Mcclanahan, P. (2020, Mar). I’m a u.s. citizen. where in the world can igo? The New York Times. Retrieved from https://www.nytimes.com/article/coronavirus-travel-restrictions.htmlMonmousseau, P., Marzuoli, A., Feron, E., & Delahaye, D. (2020). Im-pact of covid-19 on passengers and airlines from passenger measurements:Managing customer satisfaction while putting the us air transportation92Referencessystem to sleep. Transportation Research Interdisciplinary Perspectives,7 , 100179. Retrieved from https://www.sciencedirect.com/science/article/pii/S2590198220300907 doi: https://doi.org/10.1016/j.trip.2020.100179Munzert, S., Nyhuis, D., Atkinson, P., Delamont, S., Cernat, A., Sakshaug,J. W., & Williams, R. A. (2020). Web scraping. London: SAGE Publi-cations Ltd.Pang, B., & Lee, L. (2008). Opinion mining and sentiment analysis. Foun-dations and trends in information retrieval , 2 (1-2), 1-135.Polanyi, L., & Zaenen, A. (2006). Contextual valence shifters. In (p. 1-10).Dordrecht: Springer Netherlands.Pruyn, A., & Smidts, A. (1998). Effects of waiting on the satisfaction withthe service: Beyond objective time measures. International journal ofresearch in marketing , 15 (4), 321-334.Rinker, T. (2013). Qdap package vignette - github pages. Retrieved fromhttp://trinker.github.io/qdap/vignettes/qdap vignette.htmlSigala, M., Christou, E., & Gretzel, U. (2012;2016;). Social media in travel,tourism and hospitality: theory, practice and cases (1st ed.). Farnham,Surrey, Burlington, VT: Ashgate Pub.Suau-Sanchez, P., Voltes-Dorta, A., & Cuguero´-Escofet, N. (2020). An earlyassessment of the impact of covid-19 on air transport: Just another crisisor the end of aviation as we know it? Journal of transport geography , 86 ,102749-8.Wan, Y., & Gao, Q. (2015). An ensemble sentiment classification system oftwitter data for airline services analysis. In (p. 1318-1325). IEEE.WHO. (2020, April). Who timeline - covid-19. World Health Organiza-tion. Retrieved from https://www.who.int/news/item/27-04-2020-who-timeline---covid-19 (Accessed on 2022-06-24)Wickham, H. (2021, Oct). Easily harvest (scrape) web pages. ComprehensiveR Archive Network (CRAN). Retrieved from https://cran.r-project.org/web/packages/rvest/Xuan, X., Khan, K., Su, C.-W., & Khurshid, A. (2021). Will covid-19 threaten the survival of the airline industry? Sustainability (Basel,Switzerland), 13 (21), 11666.93Zhang, Y. (2021). Adversative and concessive conjunctions in efl writing:Corpus-based description and rhetorical structure analysis (1st 2021. ed.).Singapore: Springer Singapore.94Appendix ASkyTrax Data CollectionCode1 # load libraries −−−−−−−−−2 suppressPackageStartupMessages(library(data.table))3 suppressPackageStartupMessages(library(jsonlite))4 suppressPackageStartupMessages(library(tidyverse))5 suppressPackageStartupMessages(library(httr))6 suppressPackageStartupMessages(library(stringr))7 suppressPackageStartupMessages(library(tidyr))8 suppressPackageStartupMessages(library(qdap))9 suppressPackageStartupMessages(library(rvest))10 suppressPackageStartupMessages(library(rebus))11 suppressPackageStartupMessages(library(lubridate))12 suppressPackageStartupMessages(library(maditr))13 suppressPackageStartupMessages(library(dplyr))14 suppressPackageStartupMessages(library(RSelenium))15 suppressPackageStartupMessages(library(XML))16 suppressPackageStartupMessages(library(zoo))1 # helper functions −−−−−−−−−2 p.controlcase <− function(x){3 retVal <− gsub('\u2705 ', '', x)4 retVal <− gsub('[[:cntrl:]]', '', retVal)5 return(retVal)6 }789 p.trailingspace <− function(x){10 retVal <− str replace all(x,"[\\s]+", "")11 return(retVal)12 }131415 process.table <− function(x){16 retVal <− filter(x, grepl('Recommended |Type Of ...95Appendix A. SkyTrax Data Collection CodeTraveller |Seat Type |Route'17 , X1))18 retVal <− setNames(data.frame(t(retVal[,−1])), retVal[,1])19 return(retVal)20 }212223 skytrax.pages <− function(airline){24 Sys.sleep(1)25 url <− ...paste0('https://www.airlinequality.com/airline−reviews/', ...airline, ...'/page/1/?pagesize=100&filterby=cabin%3Aeconomy')26 html <− read html(url)27 global.review.count <− html %>% ...html nodes(".review−count") %>% html text()28 total.pages <− ceiling(as.numeric(gsub('\\D+', '', ...global.review.count))/100)29 return(total.pages)30 }3132 skytrax.pages.first <− function(airline){33 Sys.sleep(1)34 url <− ...paste0('https://www.airlinequality.com/airline−reviews/', ...airline, '/page/1/?pagesize=100&filterby=cabin%3Afirst')35 html <− read html(url)36 global.review.count <− html %>% ...html nodes(".review−count") %>% html text()37 total.pages <− ceiling(as.numeric(gsub('\\D+', '', ...global.review.count))/100)38 return(total.pages)39 }4041 skytrax.pages.business <− function(airline){42 Sys.sleep(1)43 url <− ...paste0('https://www.airlinequality.com/airline−reviews/', ...airline, ...'/page/1/?pagesize=100&filterby=cabin%3Abusiness')44 html <− read html(url)45 global.review.count <− html %>% ...html nodes(".review−count") %>% html text()46 total.pages <− ceiling(as.numeric(gsub('\\D+', '', ...global.review.count))/100)47 return(total.pages)48 }4950 skytrax.pages.peconomy <− function(airline){96Appendix A. SkyTrax Data Collection Code51 Sys.sleep(1)52 url <− ...paste0('https://www.airlinequality.com/airline−reviews/', ...airline, ...'/page/1/?pagesize=100&filterby=cabin%3Ap economy')53 html <− read html(url)54 global.review.count <− html %>% ...html nodes(".review−count") %>% html text()55 total.pages <− ceiling(as.numeric(gsub('\\D+', '', ...global.review.count))/100)56 return(total.pages)57 }5859 skytrax.pull <− function(url){60 Sys.sleep(1)61 html <− read html(url)6263 # airline metric64 airline <− html %>% html nodes("title") %>% html text() ...%>% unique()65 rating.total <− html %>% ...html nodes(".customer−rating−total") %>% html text()66 global.review.count <− html %>% ...html nodes(".review−count") %>% html text()676869 # review metric70 review.rating <− html %>% html nodes("div.rating−10") %>% ...html text()71 #review.header <− html %>% html nodes(".text header") %>% ...html text()72 review.sub.header <− html %>% ...html nodes(".text sub header") %>% html text()73 review.author <− ...str extract(str trim(p.controlcase(review.sub.header)), ..."ˆ(.*?\\s.*?)\\s")74 review.country <− ...str extract(p.controlcase(review.sub.header), ..."(?≤\\()(.*?)(?=\\))")75 review.context <− html %>% html nodes(".text content") ...%>% html text()76 review.context.clean <− p.controlcase(review.context)77 review.verified <− ...str trim(vapply(str split(review.context.clean, ..."\\|"), `[`, 1, FUN.VALUE=character(1)))78 review.content <− ...str trim(vapply(str split(review.context.clean, ..."\\|"), `[`, 2, FUN.VALUE=character(1)))79 review.date <− html %>% html nodes("time") %>% ...97Appendix A. SkyTrax Data Collection Codehtml attrs() %>% map(2) %>% ymd()8081 # review table82 review.rating.table <− html %>% ...html nodes("table.review−ratings") %>% ...html table(fill = TRUE)83 review.rating.table.processed <− ...rbindlist(lapply(review.rating.table[2:length(review.rating.table)], ...process.table), fill = T)848586 retVal <− data.table(airline87 , airline.rating = ...p.controlcase(rating.total)88 , total.reviews = gsub('\\D+', '', ...global.review.count)89 , review.date90 , review.rating =91 str trim(p.controlcase(review.rating[2:length(review.rating)]))92 , review.author = ...str trim(review.author)93 , review.country94 , review.verified95 , review.content96 , review.rating.table.processed)9798 return(retVal)99 }100101 skytrax.url <− function(airline, page){102 retVal <− ...paste0('https://www.airlinequality.com/airline−reviews/'103 , airline104 , '/page/', page105 , '/?pagesize=100&filterby=cabin%3Aeconomy')106 return(retVal)107 }108109 skytrax.url.first <− function(airline, page){110 retVal <− ...paste0('https://www.airlinequality.com/airline−reviews/'111 , airline112 , '/page/', page113 , '/?pagesize=100&filterby=cabin%3Afirst')114 return(retVal)115 }116117 skytrax.url.peconomy <− function(airline, page){118 retVal <− ...98Appendix A. SkyTrax Data Collection Codepaste0('https://www.airlinequality.com/airline−reviews/'119 , airline120 , '/page/', page121 , ...'/?pagesize=100&filterby=cabin%3Ap economy')122 return(retVal)123 }124125 skytrax.url.business <− function(airline, page){126 retVal <− ...paste0('https://www.airlinequality.com/airline−reviews/'127 , airline128 , '/page/', page129 , ...'/?pagesize=100&filterby=cabin%3Abusiness')130 return(retVal)131 }132133 review.process <− function(review){134 retVal <− tolower(review) # lower case135 retVal <− gsub('[[:punct:]]', '', retVal) # remove ...punctuations (extra measure)136 retVal <− gsub('[[:cntrl:]]', '', retVal) # remove ...control cases137 retVal <− str replace all(retVal,"[ˆa−zA−Z\\s]", "") # ...remove everything not a number or letter138 retVal <− gsub('\\d+', '', retVal) # remove digits139 retVal <− str replace all(retVal,"[\\s]+", " ") # fix ...trailing spaces140 }1 # process airline list −−−−−−−−−2 # initial list3 airlinelist <− fread('./airline/airline.list.csv')4 airlinelist[, airline.name.url := ...vapply(str split(url skytrax, '\\/'), `[`, 5, ...FUN.VALUE=character(1))]56 airline.pages <− lapply(airlinelist[,airline.name.url], ...skytrax.pages)7 airline.pages.dt <− do.call(rbind, airline.pages)89 airline.pages.first <− ...lapply(airlinelist[,airline.name.url], skytrax.pages.first)10 airline.pages.first.dt <− do.call(rbind, airline.pages.first)1112 airline.pages.business <− ...99Appendix A. SkyTrax Data Collection Codelapply(airlinelist[,airline.name.url], ...skytrax.pages.business)13 airline.pages.business.dt <− do.call(rbind, ...airline.pages.business)1415 airline.pages.peconomny <− ...lapply(airlinelist[,airline.name.url], ...skytrax.pages.peconomy)16 airline.pages.peconomny.dt <− do.call(rbind, ...airline.pages.peconomny)1718 airline.set <− cbind(airlinelist[!is.na(airline.name.url)], ...airline.pages.first.dt, airline.pages.peconomny.dt, ...airline.pages.business.dt)19 names(airline.set) <− c(colnames(airlinelist), ...'airline.page.first', 'airline.page.peconomy', ...'airline.page.business')2021 fwrite(airline.set, './airline/airline.names.full.csv')1 # all airline paginated url list −−−−−−−−−2 # economy3 pages <− airline.names[,airline.page]4 skytrax.url.list <− list()5 k = 167 for(i in seq along(airline.names[,airline.name.url])){8 for(j in seq(airline.names[i,airline.page])){9 if(airline.names[i,airline.page] > 0){10 retVal <− skytrax.url(airline = ...airline.names[i,airline.name.url], page = j)11 skytrax.url.listk <− retVal12 k = k + 113 }else{14 print(1)15 }16 }17 }1819 skytrax.economy.url <− data.table(url = ...unlist(skytrax.url.list))2021 # first class22 pages <− airline.names[,airline.page.first]23 skytrax.url.list <− list()24 k = 125100Appendix A. SkyTrax Data Collection Code26 for(i in seq along(airline.names[,airline.name.url])){27 for(j in seq(airline.names[i,airline.page.first])){28 if(airline.names[i,airline.page.first] > 0){29 retVal <− skytrax.url.first(airline = ...airline.names[i,airline.name.url], page = j)30 skytrax.url.listk <− retVal31 k = k + 132 }else{33 print(1)34 }35 }36 }3738 skytrax.first.url <− data.table(url = unlist(skytrax.url.list))3940 # premium economy41 pages <− airline.names[,airline.page.peconomy]42 skytrax.url.list <− list()43 k = 14445 for(i in seq along(airline.names[,airline.name.url])){46 for(j in seq(airline.names[i,airline.page.peconomy])){47 if(airline.names[i,airline.page.peconomy] > 0){48 retVal <− skytrax.url.peconomy(airline = ...airline.names[i,airline.name.url], page = j)49 skytrax.url.listk <− retVal50 k = k + 151 }else{52 print(1)53 }54 }55 }5657 skytrax.peconomy.url <− data.table(url = ...unlist(skytrax.url.list))5859 # business60 pages <− airline.names[,airline.page.business]61 skytrax.url.list <− list()62 k = 16364 for(i in seq along(airline.names[,airline.name.url])){65 for(j in seq(airline.names[i,airline.page.business])){66 if(airline.names[i,airline.page.business] > 0){67 retVal <− skytrax.url.business(airline = ...airline.names[i,airline.name.url], page = j)68 skytrax.url.listk <− retVal69 k = k + 170 }else{101Appendix A. SkyTrax Data Collection Code71 print(1)72 }73 }74 }75 skytrax.business.url <− data.table(url = ...unlist(skytrax.url.list))1 # data pull −−−−−−−−−2 # economy3 skytrax.review.data <− lapply(skytrax.economy.url[, url], ...skytrax.pull)4 skytrax.review.data.dt <− rbindlist(skytrax.review.data, ...fill = T)56 skytrax.review.data.dt[, `:=` (airline.rating = gsub('/10', ...'', airline.rating)7 , review.rating = ...gsub('/10', '', ...review.rating))]8 skytrax.review.data.dt[, `:=` (min.review.date = ...min(review.date)9 , max.review.date = ...max(review.date))10 , airline]1112 skytrax.review.data.dt.economy <− ...skytrax.review.data.dt[!is.na(review.content)]1314 save(skytrax.review.data.dt.economy, file = ...'./airline/data/skytrax/skytrax.review.data.dt.economy.RData')1516 # first class17 skytrax.review.data <− lapply(skytrax.first.url[, url], ...skytrax.pull)18 skytrax.review.data.dt <− rbindlist(skytrax.review.data, ...fill = T)1920 skytrax.review.data.dt[, `:=` (airline.rating = gsub('/10', ...'', airline.rating)21 , review.rating = ...gsub('/10', '', ...review.rating))]22 skytrax.review.data.dt[, `:=` (min.review.date = ...min(review.date)23 , max.review.date = ...max(review.date))24 , airline]102Appendix A. SkyTrax Data Collection Code2526 skytrax.review.data.dt.first <− ...skytrax.review.data.dt[!is.na(review.content)]2728 save(skytrax.review.data.dt.first, file = ...'./airline/data/skytrax/skytrax.review.data.dt.first.RData')293031 # premium economy32 skytrax.review.data <− lapply(skytrax.peconomy.url[, url], ...skytrax.pull)33 skytrax.review.data.dt <− rbindlist(skytrax.review.data, ...fill = T)3435 skytrax.review.data.dt[, `:=` (airline.rating = gsub('/10', ...'', airline.rating)36 , review.rating = ...gsub('/10', '', ...review.rating))]37 skytrax.review.data.dt[, `:=` (min.review.date = ...min(review.date)38 , max.review.date = ...max(review.date))39 , airline]4041 skytrax.review.data.dt.peconomy <− ...skytrax.review.data.dt[!is.na(review.content)]4243 save(skytrax.review.data.dt.peconomy, file = ...'./airline/data/skytrax/skytrax.review.data.dt.peconomy.RData')444546 # business47 skytrax.review.data <− lapply(skytrax.business.url[, url], ...skytrax.pull)48 skytrax.review.data.dt <− rbindlist(skytrax.review.data, ...fill = T)4950 skytrax.review.data.dt[, `:=` (airline.rating = gsub('/10', ...'', airline.rating)51 , review.rating = ...gsub('/10', '', ...review.rating))]52 skytrax.review.data.dt[, `:=` (min.review.date = ...min(review.date)53 , max.review.date = ...max(review.date))54 , airline]55103Appendix A. SkyTrax Data Collection Code56 skytrax.review.data.dt.business <− ...skytrax.review.data.dt[!is.na(review.content)]5758 save(skytrax.review.data.dt.business, file = ...'./airline/data/skytrax/skytrax.review.data.dt.business.RData')104Appendix BTrip Advisor Data CollectionCode1 # launch firefox bot −−−−−−−−−2 rD <− rsDriver(browser = "firefox",3 port = 6602L,4 #If Running RSelenium for the First Time, ...you can't have check =F5 #since you'll need to download the ...appropriate drivers6 check = T,7 verbose = F8 )9 remDr <− rD"client"1 # trip advisor urls −−−−−−−−−2 airline.url <− fread('./airline/airlinelist.csv')34 tripadvisor.url <− function(url, number){5 base <− vapply(str split(url, '−'), `[`, 1, ...FUN.VALUE=character(1))6 airline.id <− vapply(str split(url, '−'), `[`, 2, ...FUN.VALUE=character(1))7 airline.section <− vapply(str split(url, '−'), `[`, 3, ...FUN.VALUE=character(1))8 airline.name <− vapply(str split(url, '−'), `[`, 5, ...FUN.VALUE=character(1))9 review.number <− paste0('or', number)1011 retVal <− paste(base, airline.id, airline.section, ...review.number, airline.name, sep = '−')1213 return(retVal)14 }1516105Appendix B. Trip Advisor Data Collection Code17 pages <− list()18 for(i in seq along(airline.url[,url tripadvisor])){19 pagesi <− seq(airline.url[i,additional.start], ...airline.url[i,additional.end], 5)20 }212223 tripadvisor.url.list <− list()24 k <− 12526 for(i in seq along(pages)){27 page.list <− pagesi28 url <− airline.url[i,url tripadvisor]2930 for(j in seq along(page.list)){31 retVal <− tripadvisor.url(url = url, number = page.list[j])32 tripadvisor.url.listk <− retVal33 k = k+134 }35 }363738 tripadvisor.urls <− data.table(url = ...unlist(tripadvisor.url.list))1 # trip advisor review pull −−−−−−−−−2 tripadvisor.pull <− function(url){3 Sys.sleep(1)4 remDr$navigate(as.character(url))5 Sys.sleep(4)6 webElem <− remDr$findElement("css", "body")7 element<− try(unlist(remDr$findElement("class name", ..." 3maEfNCR")$getElementAttribute('class')),8 silent = TRUE)9 buttonElem <− remDr$findElement("class name", " 3maEfNCR")10 buttonElem$clickElement()1112 html obj <− remDr$getPageSource(header = TRUE)[[1]] %>% ...read html()1314 review.title <− html obj %>% html nodes(".glasR4aX") %>% ...html text()15 reviews <− html obj %>% html nodes(".IRsGHoPm") %>% ...html text()16 review.rating.temp <− html obj %>% html nodes(".nf9vGX55 ....ui bubble rating") %>% xml attrs() %>% map('class') ...%>% unlist()106Appendix B. Trip Advisor Data Collection Code17 review.rating.clean <− as.numeric(gsub('ui bubble rating ...bubble ', '', review.rating.temp))/1018 route <− html obj %>% ...html nodes(". 3tp−5a1G:nth−child(1)") %>% html text()19 flight.type <− html obj %>% ...html nodes(". 3tp−5a1G:nth−child(3)") %>% html text()20 travel.date <− html obj %>% html nodes(". 34Xs−BQm") %>% ...html text()21 travel.date.clean <− as.yearmon(gsub('Date of travel: ...','',travel.date), "%b %Y")22 review.date.temp <− html obj %>% html nodes(". 2fxQ4TOx ...span") %>% html text()23 review.date.clean <− ...as.yearmon(str extract(review.date.temp[1:5], ..."(?≤review ).*"), "%b. %Y")24 airline.rating <− html obj %>% html nodes(". 3AbzqKay") ...%>% html text()25 airline.name <− html obj %>% html nodes(". 3ggwzaPV") %>% ...html text()26 total.reviews <− html obj %>% html nodes(". 16Nxw4iy") ...%>% html text()2728 retVal <− data.table(airline.name29 , airline.rating30 , total.reviews31 , review.date = review.date.clean32 , review.rating = review.rating.clean33 , review.author = 'NA'34 , review.country = 'NA'35 , review.verified = 'NA'36 , review.content = reviews37 , type.of.traveller = 'NA'38 , seat.type = flight.type39 , route40 , recommended = 'NA')4142 return(retVal)43 }1 # data pull −−−−−−−−−2 tripadvisor.review.list <− list()3 for(i in seq along(tripadvisor.urls[,url])){4 retVal <− tripadvisor.pull(tripadvisor.urls[i])5 tripadvisor.review.listi <− retVal6 }78 tripadvisor.review.dt[review.date > 'Jan 2000' & ...107Appendix B. Trip Advisor Data Collection Code!is.na(review.date), `:=` (min.review.date = ...min(review.date)9 , max.review.date = ...max(review.date))10 , airline.name]1112 tripadvisor.review.dt.final <− ...copy(tripadvisor.review.dt[review.date > 'Jan 2000' & ...!is.na(review.date),13 .(airline.name14 , airline.rating = as.numeric(airline.rating)15 , total.reviews16 , review.date = as.character(gsub(' ...','−',review.date))17 , review.rating18 , review.content19 , seat.type20 , route21 , min.review.date = as.character(gsub(' ...','−',min.review.date))22 , max.review.date = as.character(gsub(' ...','−',max.review.date)))])2324 save(tripadvisor.review.dt.final, file = ...'./airline/data/tripadvisor.review.dt.final.RData')2526 rD$client$quit()108
Thesis/Dissertation
eng
Computer Science
Vancouver : University of British Columbia Library
Attribution-NonCommercial-NoDerivatives 4.0 International
Graduate
Gill, Paramjit
Okanagan sentiment analysis of airlines reviews
Text