Hypothesis
Null hypothesis:The proportions of customers choosing each dessert are all equal (each = 1/3).
Alternative hypothesis: The proportions are not all equal.
Results
A Chi-Square Goodness-of-Fit Test was used to show whether the preference of desserts (Cheesecake, ChocoCake, tiramisu) followed an equal distribution (33.33, 33.33, 33.33) among the 548 participants. The findings showed that the preferences to desserts were statistically different, χ 2 (2, N = 548) = 54.004, p =1.876e-12. Liking of ChocoCake over Cheesecake or Tiramisu was more preferred by the participants. The size of the effect was big (Cohen W = 0.3139217), which indicates that there was a high variation of equal preference.
#install.packages("readxl")
library(readxl)
dataset <- read_excel("~/Downloads/RQ1.xlsx")
observed <- table(dataset$Dessert)
print(observed)
##
## Cheesecake ChocoCake Tiramisu
## 171 258 119
names(observed)
## [1] "Cheesecake" "ChocoCake" "Tiramisu"
expected <- c(1/3, 1/3, 1/3)
chisq_gfit <- chisq.test(observed, p = expected)
print(chisq_gfit)
##
## Chi-squared test for given probabilities
##
## data: observed
## X-squared = 54.004, df = 2, p-value = 1.876e-12
W <- sqrt(chisq_gfit$statistic / sum(observed))
print(W)
## X-squared
## 0.3139217