df3 = read.csv("fastfood-3.csv")
t(df3)
E1 E2 E3 E4 W1 W2 W3 W4
Item1 25 36 31 26 51 47 47 52
Item2 39 42 39 35 43 39 53 46
Item3 36 24 28 29 42 36 32 33
r
[1] 25 39 36 36 42 24 31 39 28 26 35 29 51 43 42 47 39 36 47 53 32 52 46 33
f1 = c("Item1", "Item2", "Item3")
f2 = c("East", "West")
k1 = length(f1)
k2 = length(f2)
n = 4
tm1 = gl(k1, 4, n*k1*k2, factor(f1))
tm1
[1] Item1 Item1 Item1 Item1 Item2 Item2 Item2 Item2 Item3 Item3 Item3 Item3 Item1 Item1 Item1 Item1 Item2 Item2 Item2 Item2 Item3
[22] Item3 Item3 Item3
Levels: Item1 Item2 Item3
tm2 = gl(k2, 4, n*k1*k2, factor(f2))
tm2
[1] East East East East West West West West East East East East West West West West East East East East West West West West
Levels: East West
av = aov(r ~ tm1 * tm2)
summary(av)
Df Sum Sq Mean Sq F value Pr(>F)
tm1 2 385.1 192.5 9.554 0.00149 **
tm2 1 715.0 715.0 35.481 1.23e-05 ***
tm1:tm2 2 234.1 117.0 5.808 0.01132 *
Residuals 18 362.8 20.2
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Since the p-value of 0.00150 for the menu items is less than .05, the null hypothesis is rejected. The mean sales volume of the new menu items are all equal. Additionally, the p-value of 1.2e-05 for the east-west coasts comparison is also less than the .05 significance level. There’s no difference between the means and I can conclude that a significant difference does exist. It shows that there is a difference in sales volumes between the coasts. This can account for many variables such as store location, menu items, and demographics. Lastly, the final p-value of 0.0113 indicates a possible correlation between the menu item and coast location factors.