1 LOAD DATASET

raw_data <- read_csv("airline_passenger_satisfaction.csv")
head(raw_data)
# A tibble: 6 × 24
     ID Gender   Age `Customer Type` `Type of Travel` Class    `Flight Distance`
  <dbl> <chr>  <dbl> <chr>           <chr>            <chr>                <dbl>
1     1 Male      48 First-time      Business         Business               821
2     2 Female    35 Returning       Business         Business               821
3     3 Male      41 Returning       Business         Business               853
4     4 Male      50 Returning       Business         Business              1905
5     5 Female    49 Returning       Business         Business              3470
6     6 Male      43 Returning       Business         Business              3788
# ℹ 17 more variables: `Departure Delay` <dbl>, `Arrival Delay` <dbl>,
#   `Departure and Arrival Time Convenience` <dbl>,
#   `Ease of Online Booking` <dbl>, `Check-in Service` <dbl>,
#   `Online Boarding` <dbl>, `Gate Location` <dbl>, `On-board Service` <dbl>,
#   `Seat Comfort` <dbl>, `Leg Room Service` <dbl>, Cleanliness <dbl>,
#   `Food and Drink` <dbl>, `In-flight Service` <dbl>,
#   `In-flight Wifi Service` <dbl>, `In-flight Entertainment` <dbl>, …

2 Exploratory Data Analyst (EDA)

2.1 Statistika Deskriptif

summary(raw_data)
       ID            Gender               Age        Customer Type     
 Min.   :     1   Length:129880      Min.   : 7.00   Length:129880     
 1st Qu.: 32471   Class :character   1st Qu.:27.00   Class :character  
 Median : 64941   Mode  :character   Median :40.00   Mode  :character  
 Mean   : 64941                      Mean   :39.43                     
 3rd Qu.: 97410                      3rd Qu.:51.00                     
 Max.   :129880                      Max.   :85.00                     
                                                                       
 Type of Travel        Class           Flight Distance Departure Delay  
 Length:129880      Length:129880      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   :393                                             
 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  
                                                                        
 On-board Service  Seat Comfort   Leg Room Service  Cleanliness   
 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 :4.000    Median :3.000  
 Mean   :3.383    Mean   :3.441   Mean   :3.351    Mean   :3.286  
 3rd Qu.:4.000    3rd Qu.:5.000   3rd Qu.:4.000    3rd Qu.:4.000  
 Max.   :5.000    Max.   :5.000   Max.   :5.000    Max.   :5.000  
                                                                  
 Food and Drink  In-flight Service In-flight Wifi Service
 Min.   :0.000   Min.   :0.000     Min.   :0.000         
 1st Qu.:2.000   1st Qu.:3.000     1st Qu.:2.000         
 Median :3.000   Median :4.000     Median :3.000         
 Mean   :3.205   Mean   :3.642     Mean   :2.729         
 3rd Qu.:4.000   3rd Qu.:5.000     3rd Qu.:4.000         
 Max.   :5.000   Max.   :5.000     Max.   :5.000         
                                                         
 In-flight Entertainment Baggage Handling Satisfaction      
 Min.   :0.000           Min.   :1.000    Length:129880     
 1st Qu.:2.000           1st Qu.:3.000    Class :character  
 Median :4.000           Median :4.000    Mode  :character  
 Mean   :3.358           Mean   :3.632                      
 3rd Qu.:4.000           3rd Qu.:5.000                      
 Max.   :5.000           Max.   :5.000                      
                                                            

2.2 Cek Missing Value

missing_count <- colSums(is.na(raw_data))
missing_count[missing_count > 0]
Arrival Delay 
          393 
gg_miss_var(raw_data) + 
  labs(title = "Visualisasi Missing Values pada Dataset",
       y = "Jumlah Data Kosong")

2.3 Distribusi Variabel Target

2.4 Pengecekan Matriks Korelasi

3 preprocessing

3.1 Mengatasi Missing Value

clean_data <- raw_data
median_delay <- median(clean_data$`Arrival Delay`, na.rm = TRUE)
clean_data$`Arrival Delay`[is.na(clean_data$`Arrival Delay`)] <- median_delay
cat("Total missing value setelah imputasi: ", sum(is.na(clean_data)), "\n")
Total missing value setelah imputasi:  0 

3.2 Encoding Variabel Target

clean_data <- clean_data %>%
  mutate(Satisfaction_Num = ifelse(Satisfaction == "Satisfied", 1, 0))
table(clean_data$Satisfaction_Num)

    0     1 
73452 56428 

3.3 Menyiapkan Dataset Khusus untuk Pemodelan SEM-PLS

sem_data <- clean_data %>%
  select(`In-flight Wifi Service`, `Departure and Arrival Time Convenience`, 
         `Ease of Online Booking`, `Gate Location`, `Food and Drink`, 
         `Online Boarding`, `Seat Comfort`, `In-flight Entertainment`, 
         `On-board Service`, `Leg Room Service`, `Baggage Handling`, 
         `Check-in Service`, `In-flight Service`, `Cleanliness`,
         Satisfaction_Num)
head(sem_data)
# A tibble: 6 × 15
  `In-flight Wifi Service` Departure and Arrival Time C…¹ Ease of Online Booki…²
                     <dbl>                          <dbl>                  <dbl>
1                        3                              3                      3
2                        2                              2                      2
3                        4                              4                      4
4                        2                              2                      2
5                        3                              3                      3
6                        4                              4                      4
# ℹ abbreviated names: ¹​`Departure and Arrival Time Convenience`,
#   ²​`Ease of Online Booking`
# ℹ 12 more variables: `Gate Location` <dbl>, `Food and Drink` <dbl>,
#   `Online Boarding` <dbl>, `Seat Comfort` <dbl>,
#   `In-flight Entertainment` <dbl>, `On-board Service` <dbl>,
#   `Leg Room Service` <dbl>, `Baggage Handling` <dbl>,
#   `Check-in Service` <dbl>, `In-flight Service` <dbl>, Cleanliness <dbl>, …

4 Modeling SEM-PLS

4.1 Spesifikasi Outer Model

measurement_model <- constructs(
  
  composite(
    "Layanan_Digital",
    c(
      "Ease of Online Booking",
      "Online Boarding",
      "In-flight Wifi Service"
    ),
    weights = mode_A
  ),
  
  composite(
    "Layanan_Darat",
    single_item("Check-in Service")
  ),
  
  composite(
    "Kenyamanan_Kabin",
    c(
      "Seat Comfort",
      "Cleanliness",
      "Food and Drink",
      "In-flight Entertainment"
    ),
    weights = mode_A
  ),
  
  composite(
    "Awak_Kabin",
    c(
      "On-board Service",
      "In-flight Service",
      "Baggage Handling"
    ),
    weights = mode_A
  ),
  
  composite(
    "Kepuasan",
    single_item("Satisfaction_Num")
  )
)

4.2 Spesifikasi Inner Model

structural_model <- relationships(
  paths(
    from = c(
      "Layanan_Digital",
      "Layanan_Darat",
      "Kenyamanan_Kabin",
      "Awak_Kabin"
    ),
    to = "Kepuasan"
  )
)

4.3 Estimasi Model SEM-PLS

pls_model <- estimate_pls(
  data = sem_data,
  measurement_model = measurement_model,
  structural_model = structural_model
)

summary_pls <- summary(pls_model)
summary_pls

Results from  package seminr (2.4.2)

Path Coefficients:
                 Kepuasan
R^2                 0.327
AdjR^2              0.327
Layanan_Digital     0.348
Layanan_Darat       0.094
Kenyamanan_Kabin    0.211
Awak_Kabin          0.198

Reliability:
                 alpha  rhoA  rhoC   AVE
Layanan_Digital  0.769 0.932 0.846 0.649
Layanan_Darat    1.000 1.000 1.000 1.000
Kenyamanan_Kabin 0.877 0.907 0.914 0.727
Awak_Kabin       0.797 0.813 0.879 0.709
Kepuasan         1.000 1.000 1.000 1.000

Alpha, rhoA, and rhoC should exceed 0.7 while AVE should exceed 0.5

4.4 Hasil Awal

cat("Kekuatan Pengaruh Langsung (Path Coefficients):\n")
Kekuatan Pengaruh Langsung (Path Coefficients):
print(summary_pls$paths)
                 Kepuasan
R^2                 0.327
AdjR^2              0.327
Layanan_Digital     0.348
Layanan_Darat       0.094
Kenyamanan_Kabin    0.211
Awak_Kabin          0.198

5 Evaluasi Model

Loading Factors
                        Layanan_Digital Layanan_Darat Kenyamanan_Kabin
Ease of Online Booking            0.725         0.000            0.000
Online Boarding                   0.883         0.000            0.000
In-flight Wifi Service            0.800         0.000            0.000
Check-in Service                  0.000         1.000            0.000
Seat Comfort                      0.000         0.000            0.850
Cleanliness                       0.000         0.000            0.883
Food and Drink                    0.000         0.000            0.794
In-flight Entertainment           0.000         0.000            0.880
On-board Service                  0.000         0.000            0.000
In-flight Service                 0.000         0.000            0.000
Baggage Handling                  0.000         0.000            0.000
Satisfaction_Num                  0.000         0.000            0.000
                        Awak_Kabin Kepuasan
Ease of Online Booking       0.000    0.000
Online Boarding              0.000    0.000
In-flight Wifi Service       0.000    0.000
Check-in Service             0.000    0.000
Seat Comfort                 0.000    0.000
Cleanliness                  0.000    0.000
Food and Drink               0.000    0.000
In-flight Entertainment      0.000    0.000
On-board Service             0.853    0.000
In-flight Service            0.842    0.000
Baggage Handling             0.830    0.000
Satisfaction_Num             0.000    1.000
Reliabilitas Konstruk
                 alpha  rhoA  rhoC   AVE
Layanan_Digital  0.769 0.932 0.846 0.649
Layanan_Darat    1.000 1.000 1.000 1.000
Kenyamanan_Kabin 0.877 0.907 0.914 0.727
Awak_Kabin       0.797 0.813 0.879 0.709
Kepuasan         1.000 1.000 1.000 1.000

Alpha, rhoA, and rhoC should exceed 0.7 while AVE should exceed 0.5
Validitas Diskriminan
                 Layanan_Digital Layanan_Darat Kenyamanan_Kabin Awak_Kabin
Layanan_Digital                .             .                .          .
Layanan_Darat              0.118             .                .          .
Kenyamanan_Kabin           0.284         0.179                .          .
Awak_Kabin                 0.158         0.317            0.265          .
Kepuasan                   0.439         0.237            0.395      0.361
                 Kepuasan
Layanan_Digital         .
Layanan_Darat           .
Kenyamanan_Kabin        .
Awak_Kabin              .
Kepuasan                .

6 Evaluasi Inner

# Path Coefficient
path_coefficient <- summary_pls$paths
path_coefficient
                 Kepuasan
R^2                 0.327
AdjR^2              0.327
Layanan_Digital     0.348
Layanan_Darat       0.094
Kenyamanan_Kabin    0.211
Awak_Kabin          0.198
# R-Square
r_square <- summary_pls$r_squared
r_square
NULL
# f-square
summary_pls$fSquare
                 Layanan_Digital Layanan_Darat Kenyamanan_Kabin Awak_Kabin
Layanan_Digital            0.000         0.000            0.000      0.000
Layanan_Darat              0.000         0.000            0.000      0.000
Kenyamanan_Kabin           0.000         0.000            0.000      0.000
Awak_Kabin                 0.000         0.000            0.000      0.000
Kepuasan                   0.000         0.000            0.000      0.000
                 Kepuasan
Layanan_Digital     0.161
Layanan_Darat       0.012
Kenyamanan_Kabin    0.056
Awak_Kabin          0.051
Kepuasan            0.000

7 Pengujian

boot_model <- bootstrap_model(seminr_model = pls_model, nboot = 500)
summary_boot <- summary(boot_model)

cat("F-Square\n")
F-Square
print(summary_pls$fSquare)
                 Layanan_Digital Layanan_Darat Kenyamanan_Kabin Awak_Kabin
Layanan_Digital            0.000         0.000            0.000      0.000
Layanan_Darat              0.000         0.000            0.000      0.000
Kenyamanan_Kabin           0.000         0.000            0.000      0.000
Awak_Kabin                 0.000         0.000            0.000      0.000
Kepuasan                   0.000         0.000            0.000      0.000
                 Kepuasan
Layanan_Digital     0.161
Layanan_Darat       0.012
Kenyamanan_Kabin    0.056
Awak_Kabin          0.051
Kepuasan            0.000
cat("Hasil Uji Hipotesis\n")
Hasil Uji Hipotesis
print(summary_boot$bootstrapped_paths)
                               Original Est. Bootstrap Mean Bootstrap SD
Layanan_Digital  ->  Kepuasan          0.348          0.348        0.002
Layanan_Darat  ->  Kepuasan            0.094          0.094        0.002
Kenyamanan_Kabin  ->  Kepuasan         0.211          0.211        0.002
Awak_Kabin  ->  Kepuasan               0.198          0.198        0.002
                               T Stat. 2.5% CI 97.5% CI Bootstrap P Val
Layanan_Digital  ->  Kepuasan  150.532   0.343    0.352           0.000
Layanan_Darat  ->  Kepuasan     40.495   0.089    0.098           0.000
Kenyamanan_Kabin  ->  Kepuasan  90.119   0.206    0.216           0.000
Awak_Kabin  ->  Kepuasan        81.539   0.194    0.203           0.000

8 Visualisasi Diagram Model SEM PLS

plot(
  pls_model,
  title = "PLS-SEM Airline Satisfaction"
)