Skip to main content
Regression and hypothesis testing
Lesson 52 of 75
Easy practice

Linear regression

Objective. Use regression lines for justified interpolation.

  1. 1. Learn
  2. 2. Worked example
  3. 3. Practice
  4. 4. Feedback
  5. 5. Continue

Learn: the key idea

Linear regression fits a straight line y = a + bx through bivariate data by minimising the sum of squared vertical residuals, giving the least-squares regression line of y on x. The gradient b equals Sxy divided by Sxx, and the line always passes through the mean point (x̄, ȳ), so a = ȳ − bx̄. This line should only be used for interpolation, predicting y-values within the range of the given x-data, since extrapolating beyond it assumes the trend continues, which may be false. For instance, a line fitted for x between 10 and 50 should not be used to predict at x = 200.

Worked example

Given Sxy = 30, Sxx = 10, x̄ = 4, ȳ = 15, find the equation of the linear regression line of y on x.

Given Sxy = 30
Coordinate grid with the line Given Sxy = 30
  1. 1b = Sxy ÷ Sxx = 30 ÷ 10 = 3
  2. 2a = ȳ − bx̄
  3. 3a = 15 − 3(4) = 15 − 12 = 3
  4. 4Line: y = 3 + 3x

Answer: y = 3 + 3x

Concept mastery

Based on your past attempts at this lesson — the question types to practise again come first.

Complete a practice set to see your concept breakdown here.

Practice

Practice happens on its own screen, one question at a time. Answers stay hidden until you submit yours, and you can stop and pick up at the same question later.

Start practising

Common mistake. Students use the regression line to predict far outside the data range, e.g. extrapolating a line built from x = 0–10 to predict at x = 1000. Only interpolate within the observed range, since the linear trend may not continue.

Your progress

Tick each step as you finish it. Your exact reading position is saved automatically, so Continue drops you back on the same line.

0 of 5 steps complete

Your place saves automatically as you read.

My dashboard