Delivery in day(s): 4
Part I Select two explanatory independent variables
Select two explanatory (independent) variables (factors) from your dataset that comprise no more than eight different treatment combinations (if you need to collapse a variable to achieve the maximum of eight treatment combinations - ask your tutor for assistance).
The selected explanatory (independent) variables are;
Day of the Week (7 factors)
Store (4 factors)
Select a response (dependent) variable (a continuous variable) you find interesting.
The selected response (dependent) variable is;
For each treatment combination, randomly pick five replicates from your dataset (there will be a total of 40 observations if you have eight treatment combinations, for example)
For the day of the week we have;
For the Store we have;
In Part I of your report clearly state and describe/explain the two explanatory variables and the response variable you have selected. Present the observations (data) you randomly selected (there must be no more than forty observations in total.)
Results shown above
Corresponding to the variables you have selected in Part I:
The research question you will answer;
Is there a statistically significant difference on price by day of the week and store?
The statistical hypotheses you will be testing (list all hypotheses - interaction hypothesis and the main effects hypotheses).
H10: There is no statistically significant difference on price by day of the week
H1A: There is a statistically significant difference on price by day of the week
H20: There is no statistically significant difference on price by store
H2A: There is a statistically significant difference on price by store
H30: There is no statistically significant difference on price by interaction between day of the week and store
H3A: There is a statistically significant difference on price by interaction between day of the week and store
The preliminary and factorial models for your selected variables. Describe in full detail all components of the preliminary and factorial models;
The components of the factorial model are;
Day of the week; this is a main effect treatment and the model will seek to determine whether the 6 factors vary in terms of their average price.
Store; this is another main effect treatment and the model will seek to determine whether the 4 factors vary in terms of their average price.
The other component that is within this factorial model is the interaction between day of the week and the store. How does the interaction of the two variables influence the price?
The preliminary and factorial projected ANOVAs
The preliminary and factorial projected ANOVAs include;
Source of variance
Day of the week
7-1 = 6
4-1 = 3
Day of the week * Store
6*3 = 18
Carry out the analysis using R.
the relevant R code and output (i.e the aov (and LSD if appropriate) code from the script file and the ANOVA (and LSD if appropriate) results from the output);
> model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)
Df Sum Sq Mean Sq F value Pr(>F)
Day.of.the.Week 6 316.7 52.79 2.510 0.0244 *
Store 3 94.8 31.61 1.503 0.2163
Day.of.the.Week:Store 14 180.9 12.92 0.614 0.8498
Residuals 142 2986.5 21.03
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
2 observations deleted due to missingness
The results of your hypothesis testing;
Results of the factorial test above showed that there is a statistically significant difference on price by day of the week (p < 0.05). However, there was no statistically significant difference on price by store neither was there statistically significant difference on price by interaction between day of the week and store (p > 0.05).
An interpretation of the results. [If you find a significant interaction, present and interpret an interaction plot. If there is no interaction but one or both of the main effects are significant, determine which means differ using LSD in R and discuss. If you find no significant results, discuss why this may be so.]
Mean CV MSerror
155.203 2.954862 21.03172
Df ntr t.value alpha test name.t
142 7 1.976811 0.05 Fisher-LSD Day.of.the.Week
Price..cents. std r LCL UCL Min Max
Friday 155.9958 4.848799 24 154.1453 157.8464 141.9 159.9
Monday 156.6292 3.910241 24 154.7786 158.4797 143.9 159.9
Saturday 156.7913 3.997148 23 154.9010 158.6816 151.4 159.9
Sunday 154.4391 4.793911 23 152.5488 156.3295 141.3 159.9
Thursday 153.2542 6.586744 24 151.4036 155.1047 138.7 159.9
Tuesday 155.9375 3.544599 24 154.0870 157.7880 145.8 159.9
Wednesday 153.4083 3.134093 24 151.5578 155.2589 149.7 159.9
trt means M
1 Saturday 156.7913 a
2 Monday 156.6292 a
3 Friday 155.9958 ab
4 Tuesday 155.9375 ab
5 Sunday 154.4391 abc
6 Wednesday 153.4083 bc
7 Thursday 153.2542 c
The post-hoc analysis using LSD showed that there is significant difference in the average price for the different days of the week. For instance, there is significant difference in the mean between Saturday and Sunday, Saturday and Thursday and also between Saturday and Wednesday.
model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)