15. Computing the regression line and making predictions
Suppose you are a dolphin trainer at SeaWorld. You teach the dolphins by rewarding them with fish treats after each successful attempt at a new trick. The following table lists the dolphins, the number of treats per success given to each, and the average number of attempts necessary for each to learn to perform the tricks:
Number of Treats | Number of Attempts
-----------------|-------------------
Diana | Frederick | Fatima | Marlin
-----------------|-------------------
| | |
You can use the preceding sample data to obtain the regression line, where Y is the predicted value of Y:
Y = bX + a
One formula for the slope of the regression line is as follows:
b = SP / SSx
To calculate the slope, first calculate SP and SSx.
(Hint: For SP, use the computational formula and for SSx, use the definitional formula:)
The slope of the regression line is:
b =
and the intercept of the regression line is:
a =
The difference between Y and Y for a particular sample point (observation) is called the residual. Calculate the predicted Y for each of the dolphins, and then calculate the residuals.