CleverSphere

Regression Line

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.

xy
114
218
320
426
527

Worked solution

  1. 1x̄ = 3.00, ȳ = 21.00
  2. 2b = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)² = 34.00 / 10.00 = 3.40
  3. 3a = ȳ − b · x̄ = 21.00 − 3.40 · 3.00 = 10.80

Typical mistake: Dividing by Σ(yᵢ − ȳ)² instead of Σ(xᵢ − x̄)² for b.

Try it yourself with new numbers

Your turn

Three problems of exactly this type with new numbers: first one to tap, then two to work out. Comma or point; fractions like 1/6 work too.

  1. 1 · Regression & correlation
  2. 2
  3. 3

Study hours x and points y were measured. Find the regression line y = a + b·x.

xy
117
218
316
417
519

Slope b

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.