Regression line: worked example
First the slope b from the cross-products of deviations, then the intercept a through the means.
Worked example
Study hours x and points y were measured. Find the regression line y = a + b·x.
| x | y |
|---|---|
| 1 | 14 |
| 2 | 18 |
| 3 | 20 |
| 4 | 26 |
| 5 | 27 |
Worked solution
- 1.x̄ = 3.00, ȳ = 21.00
- 2.b = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)² = 34.00 / 10.00 = 3.40
- 3.a = ȳ − b · x̄ = 21.00 − 3.40 · 3.00 = 10.80
Typical mistake: Dividing by Σ(yᵢ − ȳ)² instead of Σ(xᵢ − x̄)² for b.
Your turn
Three problems of exactly this type, each time with new numbers. Comma or point; fractions like 1/6 work too.
Task 1 of 3Regression & correlation
Task
Study hours x and points y were measured. Find the regression line y = a + b·x.
| x | y |
|---|---|
| 1 | 17 |
| 2 | 18 |
| 3 | 16 |
| 4 | 17 |
| 5 | 19 |
Slope b (2 decimal places)
Intercept a (2 decimal places)
Comma or point; fractions like 1/6 work too.
Formulas for this topic
- b = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)²
- a = ȳ − b · x̄
- r = Σ(xᵢ − x̄)(yᵢ − ȳ) / √(Σ(xᵢ − x̄)² · Σ(yᵢ − ȳ)²), −1 ≤ r ≤ 1
Typical mistake: Dividing by Σ(yᵢ − ȳ)² instead of Σ(xᵢ − x̄)² for b.
Frequently asked questions
What is the typical mistake in "Regression line: worked example"?
Dividing by Σ(yᵢ − ȳ)² instead of Σ(xᵢ − x̄)² for b.
Does high correlation mean causation?
No. A relation can come from a third variable or chance.
