Regression and the least squares line
Answers are for parents and teachers.
1
A juice stand records the price x (LE) of a bottle and the bottles sold per hour y: x = 2, 3, 4, 6, 10 and y = 19, 24, 18, 14, 5. Find the line of y on x and predict the sales at a price of 5 LE.
| x | 2 | 3 | 4 | 6 | 10 |
|---|---|---|---|---|---|
| y | 19 | 24 | 18 | 14 | 5 |
Σx = 25, Σy = 80, Σxy = 316, Σx² = 165. b = (1580 − 2000) ÷ (825 − 625) = −420 ÷ 200 = −2.1; a = (80 + 52.5) ÷ 5 = 26.5. The line is ŷ = 26.5 − 2.1x; at x = 5, ŷ = 26.5 − 10.5 = 16 bottles.
2
For the dots (1, 3), (2, 5), (3, 4) compare the lines ŷ = 3 + 0.5x and ŷ = 2 + x by the sum of the squared gaps. Which is better?
First line: ŷ = 3.5, 4, 4.5, gaps −0.5, 1, −0.5, total 0.25 + 1 + 0.25 = 1.5. Second line: ŷ = 3, 4, 5, gaps 0, 1, −1, total 2. The first line (which is the least squares line) is better.
3
A regression line is ŷ = 12 − 1.5x, with y the number of minutes a snack bar needs to serve a customer and x the number of staff. What does −1.5 mean, and what is ŷ for x = 4?
Each extra staff member lowers the predicted time by 1.5 minutes. For x = 4: ŷ = 12 − 6 = 6 minutes.
4
A pupil wants to predict the hours of revision from a mark and uses the line that predicts the mark from the hours. What is wrong?
That line is the regression of y (mark) on x (hours). To predict the hours she needs the regression of x on y, a different line.
5
The means are x̄ = 4 and ȳ = 9, and the slope is b = 1.5. Write the regression line and check that it passes through (4, 9).
a = ȳ − b·x̄ = 9 − 6 = 3, so ŷ = 3 + 1.5x. Check: 3 + 1.5 × 4 = 9.