Analyzing Comprehensive Flight Experience Data To Understand Customer Feedback And How Airlines Can Use This To Enhance Flight Experiences

Introduction

When people travel, there are certain expectations for airlines to provide not only a safe journey but also a comfortable ride, amenities, snacks, drinks, food, quality service, and the list goes on.

We aim to study airline preferences to compare and analyze what services offered customers prioritize for their desired trip.

By looking at factors such as pre-flight and post-flight services, we can identify conclusions on what services affect airlines in being preferred, disapproved, and reasonable.

Problem Statement

Today, there are many different travel preferences, all with subtle differences that make each experience unique from each other, like the different airlines or different classes in each airplane company. We want to know what travelers truly prefer so that airlines may adjust their strategies to create a greater flying experience.

Objectives

- Analyze data and learn about the intricacies of the airline industry and what people’s preferences are.
- Form themes/conclusions around what the data tells us about each airline (their successes and shortcomings).
- Use examples of real world airlines to portray how they could use the data to improve their experiences.

Data Analysis and Assumptions

As we can see our data is vast however its margins range from 1-5 making it easy for 
us to take this big data and find critical analysis.

Initailly just by looking at some of the data we can assume that the bottom line for Airlines must be an average of 3 in most fields to be competitive and successful.

Visualize Data

Visual 1: Ease of Booking vs Ease of Boarding

data <- read.csv("airline_passenger_satisfaction.csv")

library(tidyr)

#u1 = Ease of Online Booking
#u2 = Online Boarding 

#H0: u1 = 5
#Ha: u2 ≠ 5

summary(data$Departure.Delay)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   14.71   12.00 1592.00
dd_data <- data %>%
  pivot_longer(cols = c(Ease.of.Online.Booking, Online.Boarding), names_to = "Online_Experiecne", values_to = "Experience_Data")

summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance Departure.Delay  
##  Length:259760      Length:259760      Min.   :  31    Min.   :   0.00  
##  Class :character   Class :character   1st Qu.: 414    1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median : 844    Median :   0.00  
##                                        Mean   :1190    Mean   :  14.71  
##                                        3rd Qu.:1744    3rd Qu.:  12.00  
##                                        Max.   :4983    Max.   :1592.00  
##                                                                         
##  Arrival.Delay     Departure.and.Arrival.Time.Convenience Check.in.Service
##  Min.   :   0.00   Min.   :0.000                          Min.   :0.000   
##  1st Qu.:   0.00   1st Qu.:2.000                          1st Qu.:3.000   
##  Median :   0.00   Median :3.000                          Median :3.000   
##  Mean   :  15.09   Mean   :3.058                          Mean   :3.306   
##  3rd Qu.:  13.00   3rd Qu.:4.000                          3rd Qu.:4.000   
##  Max.   :1584.00   Max.   :5.000                          Max.   :5.000   
##  NA's   :786                                                              
##  Gate.Location   On.board.Service  Seat.Comfort   Leg.Room.Service
##  Min.   :0.000   Min.   :0.000    Min.   :0.000   Min.   :0.000   
##  1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000   
##  Median :3.000   Median :4.000    Median :4.000   Median :4.000   
##  Mean   :2.977   Mean   :3.383    Mean   :3.441   Mean   :3.351   
##  3rd Qu.:4.000   3rd Qu.:4.000    3rd Qu.:5.000   3rd Qu.:4.000   
##  Max.   :5.000   Max.   :5.000    Max.   :5.000   Max.   :5.000   
##                                                                   
##   Cleanliness    Food.and.Drink  In.flight.Service In.flight.Wifi.Service
##  Min.   :0.000   Min.   :0.000   Min.   :0.000     Min.   :0.000         
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000     1st Qu.:2.000         
##  Median :3.000   Median :3.000   Median :4.000     Median :3.000         
##  Mean   :3.286   Mean   :3.205   Mean   :3.642     Mean   :2.729         
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:5.000     3rd Qu.:4.000         
##  Max.   :5.000   Max.   :5.000   Max.   :5.000     Max.   :5.000         
##                                                                          
##  In.flight.Entertainment Baggage.Handling Satisfaction       Online_Experiecne 
##  Min.   :0.000           Min.   :1.000    Length:259760      Length:259760     
##  1st Qu.:2.000           1st Qu.:3.000    Class :character   Class :character  
##  Median :4.000           Median :4.000    Mode  :character   Mode  :character  
##  Mean   :3.358           Mean   :3.632                                         
##  3rd Qu.:4.000           3rd Qu.:5.000                                         
##  Max.   :5.000           Max.   :5.000                                         
##                                                                                
##  Experience_Data
##  Min.   :0.000  
##  1st Qu.:2.000  
##  Median :3.000  
##  Mean   :3.005  
##  3rd Qu.:4.000  
##  Max.   :5.000  
## 
# Correct pivot_longer syntax
dd_data <- data %>%
  pivot_longer(cols = c(Ease.of.Online.Booking, Online.Boarding), 
               names_to = "Delay_Time", 
               values_to = "Experience_Data")

# Summarize the data
summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance Departure.Delay  
##  Length:259760      Length:259760      Min.   :  31    Min.   :   0.00  
##  Class :character   Class :character   1st Qu.: 414    1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median : 844    Median :   0.00  
##                                        Mean   :1190    Mean   :  14.71  
##                                        3rd Qu.:1744    3rd Qu.:  12.00  
##                                        Max.   :4983    Max.   :1592.00  
##                                                                         
##  Arrival.Delay     Departure.and.Arrival.Time.Convenience Check.in.Service
##  Min.   :   0.00   Min.   :0.000                          Min.   :0.000   
##  1st Qu.:   0.00   1st Qu.:2.000                          1st Qu.:3.000   
##  Median :   0.00   Median :3.000                          Median :3.000   
##  Mean   :  15.09   Mean   :3.058                          Mean   :3.306   
##  3rd Qu.:  13.00   3rd Qu.:4.000                          3rd Qu.:4.000   
##  Max.   :1584.00   Max.   :5.000                          Max.   :5.000   
##  NA's   :786                                                              
##  Gate.Location   On.board.Service  Seat.Comfort   Leg.Room.Service
##  Min.   :0.000   Min.   :0.000    Min.   :0.000   Min.   :0.000   
##  1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000   
##  Median :3.000   Median :4.000    Median :4.000   Median :4.000   
##  Mean   :2.977   Mean   :3.383    Mean   :3.441   Mean   :3.351   
##  3rd Qu.:4.000   3rd Qu.:4.000    3rd Qu.:5.000   3rd Qu.:4.000   
##  Max.   :5.000   Max.   :5.000    Max.   :5.000   Max.   :5.000   
##                                                                   
##   Cleanliness    Food.and.Drink  In.flight.Service In.flight.Wifi.Service
##  Min.   :0.000   Min.   :0.000   Min.   :0.000     Min.   :0.000         
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000     1st Qu.:2.000         
##  Median :3.000   Median :3.000   Median :4.000     Median :3.000         
##  Mean   :3.286   Mean   :3.205   Mean   :3.642     Mean   :2.729         
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:5.000     3rd Qu.:4.000         
##  Max.   :5.000   Max.   :5.000   Max.   :5.000     Max.   :5.000         
##                                                                          
##  In.flight.Entertainment Baggage.Handling Satisfaction        Delay_Time       
##  Min.   :0.000           Min.   :1.000    Length:259760      Length:259760     
##  1st Qu.:2.000           1st Qu.:3.000    Class :character   Class :character  
##  Median :4.000           Median :4.000    Mode  :character   Mode  :character  
##  Mean   :3.358           Mean   :3.632                                         
##  3rd Qu.:4.000           3rd Qu.:5.000                                         
##  Max.   :5.000           Max.   :5.000                                         
##                                                                                
##  Experience_Data
##  Min.   :0.000  
##  1st Qu.:2.000  
##  Median :3.000  
##  Mean   :3.005  
##  3rd Qu.:4.000  
##  Max.   :5.000  
## 
# Boxplot using the updated variable names
boxplot(Experience_Data ~ Delay_Time, data = dd_data,
        main = "Service Comparison", xlab = "Types of Service",
        ylab = "Experience Rating")

### Visual 2: In-flight Service vs On-board Service

#u1 = In Flight Service
#u2 = On Board Service

#H0: u1 = 5
#Ha: u2 ≠ 5

summary(data$Departure.Delay)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   14.71   12.00 1592.00
dd_data <- data %>%
  pivot_longer(cols = c(On.board.Service, In.flight.Service), names_to = "Online_Experiecne", values_to = "Experience_Data")

summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance Departure.Delay  
##  Length:259760      Length:259760      Min.   :  31    Min.   :   0.00  
##  Class :character   Class :character   1st Qu.: 414    1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median : 844    Median :   0.00  
##                                        Mean   :1190    Mean   :  14.71  
##                                        3rd Qu.:1744    3rd Qu.:  12.00  
##                                        Max.   :4983    Max.   :1592.00  
##                                                                         
##  Arrival.Delay     Departure.and.Arrival.Time.Convenience
##  Min.   :   0.00   Min.   :0.000                         
##  1st Qu.:   0.00   1st Qu.:2.000                         
##  Median :   0.00   Median :3.000                         
##  Mean   :  15.09   Mean   :3.058                         
##  3rd Qu.:  13.00   3rd Qu.:4.000                         
##  Max.   :1584.00   Max.   :5.000                         
##  NA's   :786                                             
##  Ease.of.Online.Booking Check.in.Service Online.Boarding Gate.Location  
##  Min.   :0.000          Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000          1st Qu.:3.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :3.000          Median :3.000    Median :3.000   Median :3.000  
##  Mean   :2.757          Mean   :3.306    Mean   :3.253   Mean   :2.977  
##  3rd Qu.:4.000          3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000          Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                         
##   Seat.Comfort   Leg.Room.Service  Cleanliness    Food.and.Drink 
##  Min.   :0.000   Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :4.000   Median :4.000    Median :3.000   Median :3.000  
##  Mean   :3.441   Mean   :3.351    Mean   :3.286   Mean   :3.205  
##  3rd Qu.:5.000   3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                  
##  In.flight.Wifi.Service In.flight.Entertainment Baggage.Handling
##  Min.   :0.000          Min.   :0.000           Min.   :1.000   
##  1st Qu.:2.000          1st Qu.:2.000           1st Qu.:3.000   
##  Median :3.000          Median :4.000           Median :4.000   
##  Mean   :2.729          Mean   :3.358           Mean   :3.632   
##  3rd Qu.:4.000          3rd Qu.:4.000           3rd Qu.:5.000   
##  Max.   :5.000          Max.   :5.000           Max.   :5.000   
##                                                                 
##  Satisfaction       Online_Experiecne  Experience_Data
##  Length:259760      Length:259760      Min.   :0.000  
##  Class :character   Class :character   1st Qu.:3.000  
##  Mode  :character   Mode  :character   Median :4.000  
##                                        Mean   :3.513  
##                                        3rd Qu.:4.000  
##                                        Max.   :5.000  
## 
# Correct pivot_longer syntax
dd_data <- data %>%
  pivot_longer(cols = c(On.board.Service, In.flight.Service), 
               names_to = "Delay_Time", 
               values_to = "Experience_Data")

# Summarize the data
summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance Departure.Delay  
##  Length:259760      Length:259760      Min.   :  31    Min.   :   0.00  
##  Class :character   Class :character   1st Qu.: 414    1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median : 844    Median :   0.00  
##                                        Mean   :1190    Mean   :  14.71  
##                                        3rd Qu.:1744    3rd Qu.:  12.00  
##                                        Max.   :4983    Max.   :1592.00  
##                                                                         
##  Arrival.Delay     Departure.and.Arrival.Time.Convenience
##  Min.   :   0.00   Min.   :0.000                         
##  1st Qu.:   0.00   1st Qu.:2.000                         
##  Median :   0.00   Median :3.000                         
##  Mean   :  15.09   Mean   :3.058                         
##  3rd Qu.:  13.00   3rd Qu.:4.000                         
##  Max.   :1584.00   Max.   :5.000                         
##  NA's   :786                                             
##  Ease.of.Online.Booking Check.in.Service Online.Boarding Gate.Location  
##  Min.   :0.000          Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000          1st Qu.:3.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :3.000          Median :3.000    Median :3.000   Median :3.000  
##  Mean   :2.757          Mean   :3.306    Mean   :3.253   Mean   :2.977  
##  3rd Qu.:4.000          3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000          Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                         
##   Seat.Comfort   Leg.Room.Service  Cleanliness    Food.and.Drink 
##  Min.   :0.000   Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :4.000   Median :4.000    Median :3.000   Median :3.000  
##  Mean   :3.441   Mean   :3.351    Mean   :3.286   Mean   :3.205  
##  3rd Qu.:5.000   3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                  
##  In.flight.Wifi.Service In.flight.Entertainment Baggage.Handling
##  Min.   :0.000          Min.   :0.000           Min.   :1.000   
##  1st Qu.:2.000          1st Qu.:2.000           1st Qu.:3.000   
##  Median :3.000          Median :4.000           Median :4.000   
##  Mean   :2.729          Mean   :3.358           Mean   :3.632   
##  3rd Qu.:4.000          3rd Qu.:4.000           3rd Qu.:5.000   
##  Max.   :5.000          Max.   :5.000           Max.   :5.000   
##                                                                 
##  Satisfaction        Delay_Time        Experience_Data
##  Length:259760      Length:259760      Min.   :0.000  
##  Class :character   Class :character   1st Qu.:3.000  
##  Mode  :character   Mode  :character   Median :4.000  
##                                        Mean   :3.513  
##                                        3rd Qu.:4.000  
##                                        Max.   :5.000  
## 
# Boxplot using the updated variable names
boxplot(Experience_Data ~ Delay_Time, data = dd_data,
        main = "Service Comparison", xlab = "Types of Service",
        ylab = "Experience Rating")

### Visual 3: Arrival Delay vs Departure Delay

#u1 = In Flight Service
#u2 = On Board Service

#H0: u1 = 5
#Ha: u2 ≠ 5

summary(data$Departure.Delay)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   14.71   12.00 1592.00
dd_data <- data %>%
  pivot_longer(cols = c(Arrival.Delay, Departure.Delay), names_to = "Delay_Time", values_to = "Experience_Data")

summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance
##  Length:259760      Length:259760      Min.   :  31   
##  Class :character   Class :character   1st Qu.: 414   
##  Mode  :character   Mode  :character   Median : 844   
##                                        Mean   :1190   
##                                        3rd Qu.:1744   
##                                        Max.   :4983   
##                                                       
##  Departure.and.Arrival.Time.Convenience Ease.of.Online.Booking Check.in.Service
##  Min.   :0.000                          Min.   :0.000          Min.   :0.000   
##  1st Qu.:2.000                          1st Qu.:2.000          1st Qu.:3.000   
##  Median :3.000                          Median :3.000          Median :3.000   
##  Mean   :3.058                          Mean   :2.757          Mean   :3.306   
##  3rd Qu.:4.000                          3rd Qu.:4.000          3rd Qu.:4.000   
##  Max.   :5.000                          Max.   :5.000          Max.   :5.000   
##                                                                                
##  Online.Boarding Gate.Location   On.board.Service  Seat.Comfort  
##  Min.   :0.000   Min.   :0.000   Min.   :0.000    Min.   :0.000  
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000  
##  Median :3.000   Median :3.000   Median :4.000    Median :4.000  
##  Mean   :3.253   Mean   :2.977   Mean   :3.383    Mean   :3.441  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000    3rd Qu.:5.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000    Max.   :5.000  
##                                                                  
##  Leg.Room.Service  Cleanliness    Food.and.Drink  In.flight.Service
##  Min.   :0.000    Min.   :0.000   Min.   :0.000   Min.   :0.000    
##  1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000    
##  Median :4.000    Median :3.000   Median :3.000   Median :4.000    
##  Mean   :3.351    Mean   :3.286   Mean   :3.205   Mean   :3.642    
##  3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:5.000    
##  Max.   :5.000    Max.   :5.000   Max.   :5.000   Max.   :5.000    
##                                                                    
##  In.flight.Wifi.Service In.flight.Entertainment Baggage.Handling
##  Min.   :0.000          Min.   :0.000           Min.   :1.000   
##  1st Qu.:2.000          1st Qu.:2.000           1st Qu.:3.000   
##  Median :3.000          Median :4.000           Median :4.000   
##  Mean   :2.729          Mean   :3.358           Mean   :3.632   
##  3rd Qu.:4.000          3rd Qu.:4.000           3rd Qu.:5.000   
##  Max.   :5.000          Max.   :5.000           Max.   :5.000   
##                                                                 
##  Satisfaction        Delay_Time        Experience_Data 
##  Length:259760      Length:259760      Min.   :   0.0  
##  Class :character   Class :character   1st Qu.:   0.0  
##  Mode  :character   Mode  :character   Median :   0.0  
##                                        Mean   :  14.9  
##                                        3rd Qu.:  13.0  
##                                        Max.   :1592.0  
##                                        NA's   :393
# Correct pivot_longer syntax
dd_data <- data %>%
  pivot_longer(cols = c(On.board.Service, In.flight.Service), 
               names_to = "Delay_Time", 
               values_to = "Experience_Data")

# Summarize the data
summary(dd_data)
##        ID            Gender               Age        Customer.Type     
##  Min.   :     1   Length:259760      Min.   : 7.00   Length:259760     
##  1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
##  Median : 64940   Mode  :character   Median :40.00   Mode  :character  
##  Mean   : 64940                      Mean   :39.43                     
##  3rd Qu.: 97410                      3rd Qu.:51.00                     
##  Max.   :129880                      Max.   :85.00                     
##                                                                        
##  Type.of.Travel        Class           Flight.Distance Departure.Delay  
##  Length:259760      Length:259760      Min.   :  31    Min.   :   0.00  
##  Class :character   Class :character   1st Qu.: 414    1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median : 844    Median :   0.00  
##                                        Mean   :1190    Mean   :  14.71  
##                                        3rd Qu.:1744    3rd Qu.:  12.00  
##                                        Max.   :4983    Max.   :1592.00  
##                                                                         
##  Arrival.Delay     Departure.and.Arrival.Time.Convenience
##  Min.   :   0.00   Min.   :0.000                         
##  1st Qu.:   0.00   1st Qu.:2.000                         
##  Median :   0.00   Median :3.000                         
##  Mean   :  15.09   Mean   :3.058                         
##  3rd Qu.:  13.00   3rd Qu.:4.000                         
##  Max.   :1584.00   Max.   :5.000                         
##  NA's   :786                                             
##  Ease.of.Online.Booking Check.in.Service Online.Boarding Gate.Location  
##  Min.   :0.000          Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000          1st Qu.:3.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :3.000          Median :3.000    Median :3.000   Median :3.000  
##  Mean   :2.757          Mean   :3.306    Mean   :3.253   Mean   :2.977  
##  3rd Qu.:4.000          3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000          Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                         
##   Seat.Comfort   Leg.Room.Service  Cleanliness    Food.and.Drink 
##  Min.   :0.000   Min.   :0.000    Min.   :0.000   Min.   :0.000  
##  1st Qu.:2.000   1st Qu.:2.000    1st Qu.:2.000   1st Qu.:2.000  
##  Median :4.000   Median :4.000    Median :3.000   Median :3.000  
##  Mean   :3.441   Mean   :3.351    Mean   :3.286   Mean   :3.205  
##  3rd Qu.:5.000   3rd Qu.:4.000    3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000    Max.   :5.000   Max.   :5.000  
##                                                                  
##  In.flight.Wifi.Service In.flight.Entertainment Baggage.Handling
##  Min.   :0.000          Min.   :0.000           Min.   :1.000   
##  1st Qu.:2.000          1st Qu.:2.000           1st Qu.:3.000   
##  Median :3.000          Median :4.000           Median :4.000   
##  Mean   :2.729          Mean   :3.358           Mean   :3.632   
##  3rd Qu.:4.000          3rd Qu.:4.000           3rd Qu.:5.000   
##  Max.   :5.000          Max.   :5.000           Max.   :5.000   
##                                                                 
##  Satisfaction        Delay_Time        Experience_Data
##  Length:259760      Length:259760      Min.   :0.000  
##  Class :character   Class :character   1st Qu.:3.000  
##  Mode  :character   Mode  :character   Median :4.000  
##                                        Mean   :3.513  
##                                        3rd Qu.:4.000  
##                                        Max.   :5.000  
## 
# Boxplot using the updated variable names
boxplot(Experience_Data ~ Delay_Time, data = dd_data,
        main = "Delay Comparison", xlab = "Types of Delay",
        ylab = "Delay Time")

## Calculations

The Difference in Booking Ratings

data1 <- read.csv("airline_passenger_satisfaction.csv")

# ud <- The difference in ratings

# H0: ud = 5
# Ha: ud ≠ 5


olbook <- data1$Ease.of.Online.Booking
olboard <- data1$Online.Boarding

test <- t.test(olbook, olboard, mu = 0, paired = TRUE, alternative = "two.sided",
               conf.level = 0.95)
list(test)
## [[1]]
## 
##  Paired t-test
## 
## data:  olbook and olboard
## t = -118.95, df = 129879, p-value < 2.2e-16
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.5039266 -0.4875886
## sample estimates:
## mean difference 
##      -0.4957576
#result1 <- shapiro.test(olbook)
#result1

#result2 <- shapiro.test(olboard)
#result2

The Difference in Time

# ud -> The difference in time

# H0: ud = 5
# Ha: ud ≠ 5

da <- data1$Arrival.Delay
dd <- data1$Departure.Delay

test <- t.test(da, dd, mu = 0, paired = TRUE, alternative = "two.sided",
               conf.level = 0.95)
list(test)
## [[1]]
## 
##  Paired t-test
## 
## data:  da and dd
## t = 15.987, df = 129486, p-value < 2.2e-16
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  0.3928496 0.5026379
## sample estimates:
## mean difference 
##       0.4477438
#result1 <- shapiro.test(da)
#result1

#result2 <- shapiro.test(dd)
#result2

The Difference in Comfort vs Food and Drink Ratings

# ud -> The difference in ratings

# H0: ud = 5
# Ha: ud ≠ 5

sc <- data1$Seat.Comfort
fad <- data1$Food.and.Drink

test <- t.test(sc, fad, mu = 0, paired = TRUE, alternative = "two.sided",
               conf.level = 0.95)
list(test)
## [[1]]
## 
##  Paired t-test
## 
## data:  sc and fad
## t = 69.885, df = 129879, p-value < 2.2e-16
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  0.2299523 0.2432229
## sample estimates:
## mean difference 
##       0.2365876
#result1 <- shapiro.test(sc)
#result1

#result2 <- shapiro.test(fad)
#result2

Interpretation

Ease of Online Booking vs. Online Boarding

With a p-value > our alpha at .05, We reject H0. This shows that there is not enough evidence to support the population means for ease of online booking vs online boarding scores are equal, rather concluding that there is a statistically significant difference between the average rating for the two fields.

Arrival Delay vs. Departure Delay:

With a p-value > our alpha at .05, We reject H0. This shows that there is not enough evidence to support the population means for Arrival Delay vs Departure delay scores are equal, rather concluding that there is a statistically significant difference between the average rating for the two fields.

In-Flight Service vs. On-Board Service:

With a p-value > our alpha at .05, We reject H0. This shows that there is not enough evidence to support the population means for In-Flight Service and On-Board Service scores are equal, rather concluding that there is a statistically significant difference between the average rating for the two fields.

Conclusion

With each of our tests p values all falling below our alpha at .05, it is showing there are significant differences between the means compared in each.
The main conclusion/takeaway is that these general customers of airlines have average ratings with airlines services and offerings. It means there is significant improvement to be made to ensure that customers, the main consumer, are treated with better services.
For example, Southwest can now take our findings and test for significant differences between their on flight vs onboarding services, as well as compare to the average score that general customers receive. From there, Southwest can move accordingly, whether it be to go through new training with its employees, or to make it a focal point/standard to improve their score within the area when they sample their customers.

With the ease of online booking and online boarding having significant differences upon its scores, an airline can compare their scores to test for differences. IF a difference is found, they can go through their online processing to determine if the whole system needs improvement, or the layout needs to be made more simple for their customers. 

Airlines need to make it a focal point when it comes to delays outside of weather. Customers value their time, and the mean score amongst them is around a 3. They need to be able to focus on getting customers in and out of planes with efficiency, as well as focusing on communications between airports. If there are delays, have a system in place to gift customers, whether it be service on the plane with food, or even flight credit.