In: Statistics and Probability
Jason believes that the sales of coffee at his coffee shop depend upon the weather. He has taken a sample of 6 days. Below you are given the results of the sample.
Cups of Coffee Sold | Temperature (in ⁰F) |
---|---|
350 | 50 |
200 | 60 |
210 | 70 |
100 | 80 |
60 | 90 |
40 | 100 |
a. Compute the least squares estimated regression equation.
b. Is there a significant relationship between the sales of coffee and temperature? Use a t test and a .05 level of significance. Be sure to state the null and alternative hypotheses.
c. Perform F test for the model with a .01 level of significance
X | Y | XY | X² | Y² |
350 | 50 | 17500 | 122500 | 2500 |
200 | 60 | 12000 | 40000 | 3600 |
210 | 70 | 14700 | 44100 | 4900 |
100 | 80 | 8000 | 10000 | 6400 |
60 | 90 | 5400 | 3600 | 8100 |
40 | 100 | 4000 | 1600 | 10000 |
Ʃx = | Ʃy = | Ʃxy = | Ʃx² = | Ʃy² = |
960 | 450 | 61600 | 221800 | 35500 |
Sample size, n = | 6 |
x̅ = Ʃx/n = 960/6 = | 160 |
y̅ = Ʃy/n = 450/6 = | 75 |
SSxx = Ʃx² - (Ʃx)²/n = 221800 - (960)²/6 = | 68200 |
SSyy = Ʃy² - (Ʃy)²/n = 35500 - (450)²/6 = | 1750 |
SSxy = Ʃxy - (Ʃx)(Ʃy)/n = 61600 - (960)(450)/6 = | -10400 |
a)
Slope, b = SSxy/SSxx = -10400/68200 = -0.152492669
y-intercept, a = y̅ -b* x̅ = 75 - (-0.15249)*160 = 99.39882698
Regression equation :
ŷ = 99.3988 + (-0.1525) x
b)
Sum of Square error, SSE = SSyy -SSxy²/SSxx = 1750 - (-10400)²/68200 = 164.0762463
Standard error, se = √(SSE/(n-2)) = √(164.07625/(6-2)) = 6.4046
Null and alternative hypothesis:
Ho: β₁ = 0 ; Ha: β₁ ≠ 0
α = 0.05
Test statistic:
t = b/(se/√SSxx) = -6.2180
df = n-2 = 4
p-value = T.DIST.2T(ABS(-6.218), 4) = 0.0034
Conclusion:
p-value < α, Reject the null hypothesis.
There is a significant relationship between the sales of coffee and temperature.
c)
Null and alternative hypothesis:
Ho: β₁ = 0 ; Ha: β₁ ≠ 0
α = 0.01
SSE = SSyy -SSxy²/SSxx = 1750 - (-10400)²/68200 = 164.08
SSR = SSxy²/SSxx = (-10400)²/68200 = 1585.9238
df1 = 1
df2 = n-2 = 6-2 = 4
Test statistic:
F = SSR/(SSE/(n-2)) = 1585.9238/(164.0762/4) = 38.6631
p-value = F.DIST.RT(38.6631, 1, 4) = 0.0034
Conclusion:
p-value < α, Reject the null hypothesis.
The model is significant.