Curriculum
Course: Statistics — Third Secondary
Login
Text lesson

Regression

Statistics — Third Secondary

Regression

Worked examples

Worked examples

Example 1→Find the regression equation of y on x for x: 1, 2, 3, 4, 5 and y: 2, 4, 6, 8, 10.
  • n = 5, Σx = 15, Σy = 30, Σxy = 110, Σx² = 55.
  • b = (5 × 110 − 15 × 30) ÷ (5 × 55 − 15²) = 100 ÷ 50 = 2.
  • x̄ = 3, ȳ = 6, so a = 6 − 2 × 3 = 0.
  • The equation is ŷ = 2x. All the points lie exactly on this line.
  • Example 2 Find the regression equation for x: 1, 2, 3, 4, 5 and y: 5, 4, 4, 2, 1, then estimate y when x = 4.
  • n = 5, Σx = 15, Σy = 16, Σxy = 38, Σx² = 55.
  • b = (5 × 38 − 15 × 16) ÷ (5 × 55 − 15²) = −50 ÷ 50 = −1.
  • x̄ = 3, ȳ = 16 ÷ 5 = 3.2, so a = 3.2 − (−1)(3) = 6.2.
  • The equation is ŷ = 6.2 − x.
  • When x = 4 ŷ = 6.2 − 4 = 2.2.
  • Example 3 Hours of study (x) and exam score (y) for six students: x: 1, 2, 3, 4, 5, 6 and y: 40, 46, 47, 55, 58, 62. Find the regression equation, then estimate the score of a student who studied 4.5 hours and the score of a student who studied 10 hours.
  • n = 6, Σx = 21, Σy = 308, Σxy = 1155, Σx² = 91.
  • b = (6 × 1155 − 21 × 308) ÷ (6 × 91 − 21²) = 462 ÷ 105 = 4.4.
  • x̄ = 3.5, ȳ = 308 ÷ 6 ≈ 51.33, so a = 51.33 − 4.4 × 3.5 = 51.33 − 15.4 ≈ 35.93.
  • The equation is ŷ = 35.93 + 4.4x.
  • When x = 4.5 (inside the data range): ŷ = 35.93 + 19.8 ≈ 55.7 marks.
  • When x = 10 (outside the data range) ŷ = 35.93 + 44 ≈ 79.9. This is less reliable because it is extrapolation.
  • Example 4 Find the regression equation for x: 3, 5, 7, 9 and y: 12, 10, 6, 2. Then find ŷ when x = 6, and when x = 11, and discuss whether the second result is sensible.
  • n = 4, Σx = 24, Σy = 30, Σxy = 146, Σx² = 164.
  • b = (4 × 146 − 24 × 30) ÷ (4 × 164 − 24²) = −136 ÷ 80 = −1.7.
  • x̄ = 6, ȳ = 7.5, so a = 7.5 − (−1.7)(6) = 7.5 + 10.2 = 17.7.
  • The equation is ŷ = 17.7 − 1.7x.
  • When x = 6 ŷ = 17.7 − 10.2 = 7.5. This equals ȳ, as expected, because the line passes through (x̄, ȳ).
  • When x = 11 ŷ = 17.7 − 18.7 = −1. This is a negative value, which is not sensible for a score, and it shows the danger of extrapolation.
Regression · 5 / 7