ASSIGNMENT 6 RESEARCH SCENARIO 2

Assess the difference in customer satisfaction score in two groups of customer using human service and AI service

HYPOTHESES:

H0: There is no difference in customer satisfaction score in two groups of customer using human service and AI service

H1: There is a difference in customer satisfaction score in two groups of customer using human service and AI service

R PROCESS

IMPORT EXCEL FILE CODE

library(readxl)

A6R2 <- read_excel("D:/000 20251021 AA 5221 Applied Analytics & Methods 1/Week 6/A6R2.xlsx")

DESCRIPTIVE STATISTICS

Calculate the mean, median, SD, and sample size for each variable.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
A6R2 %>%
  group_by(ServiceType) %>%
  summarise(
    Mean = mean(SatisfactionScore, na.rm = TRUE),
    Median = median(SatisfactionScore, na.rm = TRUE),
    SD = sd(SatisfactionScore, na.rm = TRUE),
    N = n()
  )
## # A tibble: 2 × 5
##   ServiceType  Mean Median    SD     N
##   <chr>       <dbl>  <dbl> <dbl> <int>
## 1 AI           3.6       3  1.60   100
## 2 Human        7.42      8  1.44   100

CHECK THE NORMALITY OF THE CONTINUOUS VARIABLES

CREATE A HISTOGRAM FOR EACH CONTINUOUS VARIABLE

hist(A6R2$SatisfactionScore[A6R2$ServiceType == "Human"],
     main = "Histogram of Customer using Human Service",
     xlab = "SatisfactionScore",
     ylab = "Count of customer",
     col = "lightblue",
     border = "black",
     breaks = 20)

hist(A6R2$SatisfactionScore[A6R2$ServiceType == "AI"],
     main = "Histogram of Customer using AI Service",
     xlab = "SatisfactionScore",
     ylab = "Count of customer",
     col = "lightgreen",
     border = "black",
     breaks = 20)

Histogram of customer statisfaction score in both group who use Human service and AI service is not symmetrical, positive skewed, and too tall

CONDUCT THE SHAPIRO-WILK TEST

shapiro.test(A6R2$SatisfactionScore[A6R2$ServiceType == "Human"])
## 
##  Shapiro-Wilk normality test
## 
## data:  A6R2$SatisfactionScore[A6R2$ServiceType == "Human"]
## W = 0.93741, p-value = 0.0001344
shapiro.test(A6R2$SatisfactionScore[A6R2$ServiceType == "AI"])
## 
##  Shapiro-Wilk normality test
## 
## data:  A6R2$SatisfactionScore[A6R2$ServiceType == "AI"]
## W = 0.91143, p-value = 5.083e-06

The data is abnormally distributed for both group of customer using human service and AI service

VISUALLY DISPLAY THE DATA

library(ggplot2)
library(ggpubr)
ggboxplot(A6R2, x = "ServiceType", y = "SatisfactionScore",
          color = "ServiceType",
          palette = "jco",
          add = "jitter")

There are many dots outside of the whiskers, continue Mann Whitney U Test

MANN WHITNEY U TEST

wilcox.test(SatisfactionScore ~ ServiceType, data = A6R2, exact = FALSE)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  SatisfactionScore by ServiceType
## W = 497, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0

Test is statistically significant p < .001

EFFECT SIZE:

library(effectsize)
rank_biserial(SatisfactionScore ~ ServiceType, data = A6R2, exact = FALSE)
## r (rank biserial) |         95% CI
## ----------------------------------
## -0.90             | [-0.93, -0.87]

REPORT PARAGRAPH

A Mann-Whitney U test was conducted to compare

customer satisfaction scores between two groups of customers using human service and AI service

Customers who used the human service had significantly higher median scores (Mdn = 8) than

students who used the AI service (Mdn = 3), U = 497, p < 0.001.

The effect size was large (r = -0.90), indicating a significant difference in satisfaction score between customers who used human service and used AI service

Overall, using human agents increase customer satisfaction score than using AI agents.