☰ خطة العام · الإحصاء (بالإنجليزية)

Using the regression line

الأسبوع 5 · استخدام خط الانحدار: التنبؤ بقيمة ⁦y⁩ وإيجاد الخطأ والتنبؤ خارج مدى البيانات والانحدار من مجاميع معطاة · 3 دروس
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 xProfit y (LE)xyx²y²
18.5−45−832.5342.252025
21−20−420441400
24.525612.5600.25625
274010807291600
29.51053097.5870.2511025
3295304010249025
351505250122522500
Σx = 187.5Σy = 350Σxy = 11827.5Σx² = 5231.75Σy² = 47200
Worked examples
xy1618202224262830323436−80080160
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.
2
At 24.5 °C the stand earned 25 LE. Find ŷ and the error.
3
At which temperature does the line give a profit of exactly 0 LE?
4
What does b = 11.7104 mean here, with its units?
5
Why is it all right that a is negative, but not all right to ask the line for the profit at 5 °C?