Research Scenario 1 - Chi-Square Goodness of Fit

Research Question A restaurant sells three kinds of desserts: chocolate cake, vanilla cheesecake, and tiramisu. If all three desserts are selling equally, then the restaurant owner will keep all three desserts on the menu. However, if some desserts are less popular than others, she would like to remove those items so she can increase her profits. Analyze the data to determine if the actual distribution of the dessert preference matches the expected distribution.

Hypotheses H₀: The observed dessert frequencies match the expected frequencies (equal popularity). H₁: The observed dessert frequencies do not match the expected frequencies.

Results Paragraph A Chi-Square Goodness-of-Fit Test was conducted to determine whether dessert preference (Cheesecake, ChocoCake, Tiramisu) was different from an equal distribution (33.33%, 33.33%, 33.33%) among 548 customers. There was a statistically significant difference between the observed and expected dessert preferences, χ²(2, N = 548) = 54.00, p < .001. The observed distribution showed that ChocoCake was the most preferred dessert (47.1%), followed by Cheesecake (31.2%), with Tiramisu being the least preferred (21.7%). The effect size was moderate (Cohen’s W = 0.31).

Chi-Square Goodness of Fit Test Load required library

library(readxl)

Read dataset

dataset <- read_excel("C:/Users/saisa/Downloads/RQ1.xlsx")

Create frequency table of desserts

observed <- table(dataset$Dessert)
print(observed)
## 
## Cheesecake  ChocoCake   Tiramisu 
##        171        258        119
names(observed)
## [1] "Cheesecake" "ChocoCake"  "Tiramisu"
# Expected proportions 
expected <- c(1/3, 1/3, 1/3)

# Run Chi-Square Goodness-of-Fit Test
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
# Compute effect size (Cohen’s W)
W <- sqrt(chisq_gfit$statistic / sum(observed))
cat("Cohen’s W (effect size):", round(W, 3), "\n")
## Cohen’s W (effect size): 0.314