RESEARCH SCENARIO 1
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 from the restaurant to determine if the actual distribution of the dessert preference matches the expected distribution.
QUESTION What are the null and alternate hypotheses for your research?
H0:The observed dessert frequencies match the expected frequencies H1:The observed dessert frequencies does not match the expected frequencies
YOUR PARAGRPAH: A Chi-Square Goodness-of-Fit Test was conducted to determine whether dessertpreference (Chocolate Cake, Cheesecake, and Tiramisu) differed from an equal distribution among the three desserts. Results showed a statistically significant difference in dessert preferences, χ²(2, N = 548) = 9.67, p < .020.Participants preferred Chocolate Cake more than the other desserts. The effect size was moderate (Cohen’s W = 0.314).
LOAD THE PACKAGE
library(readxl)
Read Dataset
dataset <- read_excel("C:/Users/burug/Downloads/RQ1 (2).xlsx")
CREATE A FREQUENCY TABLE
observed <- table(dataset$Dessert)
VIEW YOUR FREQUENCY TABLE
print(observed)
##
## Cheesecake ChocoCake Tiramisu
## 171 258 119
VIEW THE CATEGORY ORDER
names(observed)
## [1] "Cheesecake" "ChocoCake" "Tiramisu"
Expected Proportions
expected <- c(1/3, 1/3, 1/3)
CALCULATE CHI-SQUARED RESULTS
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
EFFECT SIZE CODE
W <- sqrt(chisq_gfit$statistic / sum(observed))
W
## X-squared
## 0.3139217