Week 5 · Using the regression line: predicting y, the error of a prediction, extrapolation and regression from given sums · 3 lessons
2
A second regression with decimals and negative values: scatter diagram, line and two predictions
Statistics Sec 3 Term 1, Unit 1, Lesson 2
GoalWork a regression with decimal data and negative values, draw the scatter diagram and the line, and make two predictions.
New words
negative value · here a daily loss: the profit is below 0 LEintercept a · may be negative; it is only the line’s value at x = 0sums with decimals · keep every digit until the last step
Explanation
Real data are not always whole numbers, and some values are negative. A juice stand records the highest temperature of the day x (°C) and the day’s profit y (LE) for seven days. On the coolest days the stand loses money, so y is negative. The method does not change: first the sums, with decimals, as in the table (n = 7, Σx = 187.5, Σy = 350, Σxy = 11827.5, Σx² = 5231.75). Then b = (7 × 11827.5 − 187.5 × 350) ÷ (7 × 5231.75 − 187.5²) = 17167.5 ÷ 1466 = 11.7104, and a = (350 − 11.7104 × 187.5) ÷ 7 = −263.67. The line is ŷ = −263.67 + 11.7104x. The negative a is not a mistake: it is the line’s value at 0 °C, far to the left of our data. Because the dots are almost on a line (r = 0.9834) the line fits well; each degree of heat adds about 11.71 LE to the expected profit.
Max °C x
Profit y (LE)
xy
x²
y²
18.5
−45
−832.5
342.25
2025
21
−20
−420
441
400
24.5
25
612.5
600.25
625
27
40
1080
729
1600
29.5
105
3097.5
870.25
11025
32
95
3040
1024
9025
35
150
5250
1225
22500
Σx = 187.5
Σy = 350
Σxy = 11827.5
Σx² = 5231.75
Σy² = 47200
Worked examples
A scatter diagram with negative values. The vertical axis runs from −80 to 180, so the horizontal axis (y = 0) cuts through the picture; the first two dots are below it, the losses. The line rises from the lower left to the upper right across the dots.
First prediction, inside the range: a day with a maximum of 22 °C. ŷ = −263.67 + 11.7104 × 22 = −263.67 + 257.63 = −6.04. The stand is expected to lose about 6 LE: a negative prediction here is a loss, not an error.
Second prediction: 33.5 °C. ŷ = −263.67 + 11.7104 × 33.5 = −263.67 + 392.30 = 128.63 LE. Both 22 and 33.5 lie between the lowest (18.5) and highest (35) temperatures, so they are interpolations.
Class activity
A friend says: “The line says that at 0 °C the stand loses 263.67 LE, so we know how much it loses in winter.” Write two sentences that explain why this is unreliable (think of the range of x in our data and of what happens to a juice stand in the cold).
Practice
1
Predict the profit for a day with a maximum of 26 °C.