Analysis of Price Variation by Day of the Week and Store
VerifiedAdded on 2023/06/04
|5
|1171
|496
AI Summary
This report analyzes the variation in price by day of the week and store using two explanatory variables (Day of the Week and Store) and a response variable (Price). The observations (data) randomly selected are presented. The research question, statistical hypotheses, preliminary and factorial models, and ANOVA results are also discussed. The post-hoc analysis using LSD is presented to determine which means differ.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
![Document Page](https://desklib.com/media/document/docfile/pages/price-variation-analysis/2024/09/09/5725da40-367f-4e2d-8d8e-116932d511be-page-1.webp)
Part I
1. 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).
Answer
The selected explanatory (independent) variables are;
Day of the Week (7 factors)
Store (4 factors)
2. Select a response (dependent) variable (a continuous variable) you find interesting.
Answer
The selected response (dependent) variable is;
Price (cents)
3. 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)
Answer
For the day of the week we have;
Monda
y
Tuesda
y
Wednesda
y
Thursda
y
Friday Saturda
y
Sunday
152.9 145.8 149.7 139.9 159.9 159.9 141.3
157.9 157.9 150.9 159.9 151.9 159.9 151.4
157.9 152.9 149.9 159.9 159.9 159 151.4
159.9 150.9 153.7 159.9 141.9 158.8 155
155.1 157.9 151.9 149.7 151.9 159.9 159.9
For the Store we have;
BP 7-Eleven Caltex Shell
141.3 152.9 159.9 159.9
157.9 149.7 151.9 159
139.9 151.4 159.9 159.9
151.4 159.9 155 159.9
145.8 152.9 159.9 151.9
4. 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.)
Answer
Results shown above
1. 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).
Answer
The selected explanatory (independent) variables are;
Day of the Week (7 factors)
Store (4 factors)
2. Select a response (dependent) variable (a continuous variable) you find interesting.
Answer
The selected response (dependent) variable is;
Price (cents)
3. 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)
Answer
For the day of the week we have;
Monda
y
Tuesda
y
Wednesda
y
Thursda
y
Friday Saturda
y
Sunday
152.9 145.8 149.7 139.9 159.9 159.9 141.3
157.9 157.9 150.9 159.9 151.9 159.9 151.4
157.9 152.9 149.9 159.9 159.9 159 151.4
159.9 150.9 153.7 159.9 141.9 158.8 155
155.1 157.9 151.9 149.7 151.9 159.9 159.9
For the Store we have;
BP 7-Eleven Caltex Shell
141.3 152.9 159.9 159.9
157.9 149.7 151.9 159
139.9 151.4 159.9 159.9
151.4 159.9 155 159.9
145.8 152.9 159.9 151.9
4. 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.)
Answer
Results shown above
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/price-variation-analysis/2024/09/09/13739bba-ae14-4b57-a575-7af0abb49d73-page-2.webp)
Part II
Corresponding to the variables you have selected in Part I:
Clearly state:
(i) The research question you will answer;
Answer
Is there a statistically significant difference on price by day of the week and store?
(ii) The statistical hypotheses you will be testing (list all hypotheses - interaction hypothesis and
the main effects hypotheses).
Answer
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
(iii) The preliminary and factorial models for your selected variables. Describe in full detail all
components of the preliminary and factorial models;
Answer
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?
(iv) The preliminary and factorial projected ANOVAs
Answer
The preliminary and factorial projected ANOVAs include;
Source of variance DF Sum
Square
Mean Square F-Value
Day of the week 7-1 = 6 SSD S SD
6
S SD
6 /S SR
142
Corresponding to the variables you have selected in Part I:
Clearly state:
(i) The research question you will answer;
Answer
Is there a statistically significant difference on price by day of the week and store?
(ii) The statistical hypotheses you will be testing (list all hypotheses - interaction hypothesis and
the main effects hypotheses).
Answer
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
(iii) The preliminary and factorial models for your selected variables. Describe in full detail all
components of the preliminary and factorial models;
Answer
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?
(iv) The preliminary and factorial projected ANOVAs
Answer
The preliminary and factorial projected ANOVAs include;
Source of variance DF Sum
Square
Mean Square F-Value
Day of the week 7-1 = 6 SSD S SD
6
S SD
6 /S SR
142
![Document Page](https://desklib.com/media/document/docfile/pages/price-variation-analysis/2024/09/09/8eaa7553-716b-4894-8e90-f74acc5363eb-page-3.webp)
Store 4-1 = 3 SSS S SS
3
S SS
3 / S SR
142
Day of the week * Store 6*3 = 18 SSDS S SD S
18
S SD S
18 / S SR
142
Residuals 142 SSR S SR
142
Part III
Carry out the analysis using R.
Clearly present:
(i) 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);
Answer
> model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)
> summary(model)
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
(ii) The results of your hypothesis testing;
Answer
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).
(iii) 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.]
Answer
> out=LSD.test(model, "Day.of.the.Week")
> out
$statistics
Mean CV MSerror
155.203 2.954862 21.03172
$parameters
Df ntr t.value alpha test name.t
3
S SS
3 / S SR
142
Day of the week * Store 6*3 = 18 SSDS S SD S
18
S SD S
18 / S SR
142
Residuals 142 SSR S SR
142
Part III
Carry out the analysis using R.
Clearly present:
(i) 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);
Answer
> model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)
> summary(model)
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
(ii) The results of your hypothesis testing;
Answer
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).
(iii) 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.]
Answer
> out=LSD.test(model, "Day.of.the.Week")
> out
$statistics
Mean CV MSerror
155.203 2.954862 21.03172
$parameters
Df ntr t.value alpha test name.t
![Document Page](https://desklib.com/media/document/docfile/pages/price-variation-analysis/2024/09/09/5525a09a-1573-4ce6-a842-26093dc8c0ae-page-4.webp)
142 7 1.976811 0.05 Fisher-LSD Day.of.the.Week
$means
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
$comparison
NULL
$groups
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.
$means
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
$comparison
NULL
$groups
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.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/price-variation-analysis/2024/09/09/193f27d4-d728-403f-930b-066dc93bbd34-page-5.webp)
Rcodes
data<-read.csv("C:\\Users\\310187796\\Desktop\\data1.csv")
str(data)
attach(data)
install.packages("agricolae")
library(agricolae)
model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)
summary(model)
ut=LSD.test(model, "Day.of.the.Week")
out
data<-read.csv("C:\\Users\\310187796\\Desktop\\data1.csv")
str(data)
attach(data)
install.packages("agricolae")
library(agricolae)
model = aov(Price..cents.~ Day.of.the.Week*Store, data=data)
summary(model)
ut=LSD.test(model, "Day.of.the.Week")
out
1 out of 5
![[object Object]](/_next/image/?url=%2F_next%2Fstatic%2Fmedia%2Flogo.6d15ce61.png&w=640&q=75)
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.