In: Math
An emergency service wishes to see whether a relationship exists between the outside temperature and the number of emergency calls it receives for a 7-hour period. The data are shown. Emergency Calls and Temperatures Temperature x 68 74 82 88 93 99 101 No. of calls y 7 4 8 10 11 9 13
a. Describe the linear relationship between the temperature and the number of calls.
b. Calculate the correlation coefficient, r.
c. Is r statistically significant at the 0.05 level. Explain.
d. Determine the equation of the line of best fit.
e. Calculate and interpret the coefficient of determination, 2 r .
f. Predict the number of calls when the temperature is 80degrees.
g. Predict the temperature outside when the number of calls is 6.
h. Predict the number of calls when the temperature is 59 degrees
Data as below
Temperature (x) | No. of calls (y) |
68 | 7 |
74 | 4 |
82 | 8 |
88 | 10 |
93 | 11 |
99 | 9 |
101 | 13 |
1. Linear relationship between variables
The equation has the form Y=a+bX, where Y is the dependent variable (that’s the variable that goes on the Y axis), X is the independent variable (i.e. it is plotted on the X axis), b is the slope of the line and a is the y-intercept
From the table we can calculate
Temperature (x) | No. of calls (y) | xy | x^2 | y^2 | |
68 | 7 | 476 | 4624 | 49 | |
74 | 4 | 296 | 5476 | 16 | |
82 | 8 | 656 | 6724 | 64 | |
88 | 10 | 880 | 7744 | 100 | |
93 | 11 | 1023 | 8649 | 121 | |
99 | 9 | 891 | 9801 | 81 | |
101 | 13 | 1313 | 10201 | 169 | |
605 | 62 | 5535 | 53219 | 600 |
We can say that
Σx | 605 |
Σy | 62 |
Σxy | 5535 |
Σx^2 | 53219 |
Σy^2 | 600 |
using the formula as below to calculate a and b
In our case n = 7 (sample size)
a = [(62)(53219) - (605)(5535)] / [(7)(53219) - (605)^2]
Σy * Σx^2 | 3299578 |
Σx * Σxy | 3348675 |
n* Σx^2 | 372533 |
Σx ^ 2 | 366025 |
a | -7.5 |
b = [(7)(5535) - (605)(62)] / [(7)(53219) - (605)^2]
n* Σxy | 38745 |
Σx * Σy | 37510 |
n* Σx^2 | 372533 |
Σx ^ 2 | 366025 |
b | 0.19 |
Hence the regression equation is
y = a + b x
y = -7.5 + 0.19 x
Hence we can say that
No. of calls = -7.5 + 0.19 Temperature
2. To calculate r
Formula is
Putting the values in the formula
n* Σxy | 38745 |
Σx * Σy | 37510 |
n* Σx^2 | 372533 |
Σx ^ 2 | 366025 |
n*Σy^2 | 4200 |
Σy ^2 | 3844 |
r | 0.811357 |
R^2 | 65.8% |
Calculating ANOVA Table
Using below formula for ANOVA table
Source of Variation | DF | SS | MS | F |
Regression | 1 | SSR=∑ni=1(y^i−y¯)2 | MSR=SSR/1 | F∗=MSR/MSE |
Residual error | n-2 | SSE=∑ni=1(yi−y^i)2 | MSE=SSE/n−2 | |
Total | n-1 | SSTO=∑ni=1(yi−y¯)2 |
Looking for p-value using F value
Analysis of Variance
Source | DF | SS | MS | F | P |
Regression | 1 | 33.4802 | 33.4802 | 9.63 | 0.027 |
Error | 5 | 17.3769 | 3.4754 | ||
Total | 6 | 50.8571 |
P-value = 0.027
Since P value is less than the level of significance (0.05)
A low p-value (< 0.05) indicates that, a predictor that has a low p-value is likely to be a meaningful addition to your model because changes in the predictor's value are related to changes in the response variable. Conversely, a larger (insignificant) p-value suggests that changes in the predictor are not associated with changes in the response
Hence we can say that the regression model is significant