1. ## calculating statistics

Data is collected on the weekly number of calls made by a phone-salesperson over an eight-week period, and the number of sales they actually make in each of those weeks. The training manual specifies staff should be making sales on at least 25% of their calls. The data are:

Week 1 2 3 4 5 6 7 8
Calls 55 43 57 32 18 59 61 32
Sales 20 15 18 12 2 21 18 8

a) Draw a scatterplot of these data and comment on the suitability of linear regression to model the relationship.
b) Calculate the regression coefficients and write down the estimated prediction equation.
c) Calculate the predictions for x = 20 and x = 60 and use these to superimpose the regression line on your plot.
d) Calculate the residuals for the sales for weeks 5 and 8, and interpret these numbers.

2. So we want to calculate the coefficients of the following prediction equation: $\displaystyle y = a + bx$.
So $\displaystyle b = \frac{\sum_{i=0}^{n-1}(x_{i} - \overline{x})(y_{i} - \overline{y})}{\sum_{i=0}^{n-1} (x_i - \overline{x})^2}$
Then $\displaystyle a = \overline{y} - b \overline{x}$. $\displaystyle \overline{x}, \overline{y}$ are the means/averages of the two sets of data.
Doing this we get $\displaystyle a = -3.357$ and $\displaystyle b = 0.394$. So the estimated prediction equation is $\displaystyle y = -3.357 + 0.394x$. Then plug in $\displaystyle y(20), y(60)$ get a value and plot the points to make the line.
The residuals are basically estimates of unobservable error or $\displaystyle x_i - \overline{x}$ (how far away values are from average). So for weeks 5 and 8 do the following: obtain $\displaystyle y(18)$ and $\displaystyle y(32)$ to get the predicted sales. Then subtract the actual values from the predicted values (i.e. $\displaystyle y(18) - 2$ and $\displaystyle y(32) - 8$).