QUESTION What are the null and alternate hypotheses for YOUR research scenario? H0: There is no difference between the customer satisfaction scores served by human agents and served by AI chatbots H1: There is a difference between the customer satisfaction scores served by human agents and served by AI chatbots
library(readxl)
A6R2 <- read_excel("C:/Users/hites/Downloads/A6R2.xlsx")
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
hist(A6R2$SatisfactionScore[A6R2$ServiceType == "Human"],
main = "Histogram of Human Scores",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 20)
hist(A6R2$SatisfactionScore[A6R2$ServiceType == "AI"],
main = "Histogram of AI service Scores",
xlab = "Value",
ylab = "Frequency",
col = "lightgreen",
border = "black",
breaks = 12)
QUESTIONS Answer the questions below as comments within the R script:
Q1) Check the SKEWNESS of the VARIABLE 1 histogram. In your opinion, does the histogram look symmetrical, positively skewed, or negatively skewed? Negatively skewed
Q2) Check the KURTOSIS of the VARIABLE 1 histogram. In your opinion, does the histogram look too flat, too tall, or does it have a proper bell curve? Bell curve
Q3) Check the SKEWNESS of the VARIABLE 2 histogram. In your opinion, does the histogram look symmetrical, positively skewed, or negatively skewed? Positively skewed
Q4) Check the KUROTSIS of the VARIABLE 2 histogram. In your opinion, does the histogram look too flat, too tall, or does it have a proper bell curve? Flat
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
QUESTION Answer the questions below as a comment within the R script: Was the data normally distributed for Variable 1? Not Normal
Was the data normally distributed for Variable 2? Not Normal
library(ggplot2)
library(ggpubr)
ggboxplot(A6R2, x = "ServiceType", y = "SatisfactionScore",
color = "ServiceType",
palette = "jco",
add = "jitter")
QUESTION Answer the questions below as a comment within the R script.
Answer the questions for EACH boxplot: Q1) Were there any dots outside
of the boxplot? Are these dots close to the whiskers of the boxplot
(check if there are any dots past the lines on the boxes) or are they
very far away? There are multiple dots outside the boxplot. There are
some dots away from the whiskers. # If there are no dots, continue with
Independent t-test. # If there are a few dots (two or less), and they
are close to the whiskers, continue with the Independent t-test. # If
there are a few dots (two or less), and they are far away from the
whiskers, consider switching to Mann Whitney U test. # If there are many
dots (more than one or two) and they are very far away from the
whiskers, you should switch to the 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
library(effectsize)
rank_biserial(SatisfactionScore ~ ServiceType, data = A6R2, exact = FALSE)
## r (rank biserial) | 95% CI
## ----------------------------------
## -0.90 | [-0.93, -0.87]
QUESTIONS # Answer the questions below as a comment within the R script:
Q1) What is the size of the effect? The rank-biseral correlaion of -0.90 indicates the difference between the groups was large.
Q2) Which group had the higher average rank? The human group had the higher average rank
REPORT
A Mann-Whitney U test was conducted to compare customer satisfaction scores between customer served by human agents (n = 100) and those served by an AI chatbot (n = 100). Customers served by human agents had significantly higher median scores (Mdn = 8.00) than those customers served by AI Chatbots (Mdn = 3.00), U = 497, p = 2.2e-16. The effect size was large (r = -0.90), indicating a meaningful difference between two services. Overall, customers were more satisfied when served by human agents compared to AI Chatbots.