Open the editor

Maths · High school

Linear Regression and Line of Best Fit Slides

Free animated slides, ready to teach: 6 slides where every step appears on a click and the diagrams move. Play them right here, present them full screen, or copy them into your account to edit.

A real Tracé deck playing in your browser. No account needed.

What the lesson covers

Hours of revision and test scores for six students are plotted with their line of best fit. The class computes the least-squares line y = 48 + 4x and uses it to predict.

The slides, one by one

1 Linear regression

The line of best fit

Can hours of revision predict a test score?

2 Least squares makes the residuals small

y=a+bx,b=SxySxxy = a + bx,\quad b = \dfrac{S_{xy}}{S_{xx}}

Residual: actual minus predicted

The line minimises the sum of squared residuals

3 Predict inside the data, not far outside

Interpolation

  • 4.5 hours → 66
  • Inside the data: reliable

Extrapolation

  • 20 hours → 128?
  • Scores stop at 100

The pattern may not hold beyond the data

4 Finding the regression line

Hours x = 1 to 6, scores y = 53, 54, 61, 65, 66, 73. Find the line y = a + bx.

→ b = Sxy ÷ Sxx, a = ȳ − b x̄

xˉ=3.5, yˉ=62\bar x = 3.5,\ \bar y = 62
Sxy=70, Sxx=17.5S_{xy} = 70,\ S_{xx} = 17.5
b=70÷17.5=4b = 70 \div 17.5 = 4
a=62−4(3.5)=48a = 62 - 4(3.5) = 48
y=48+4xy = 48 + 4x

y = 48 + 4x; 4.5 hours predicts a score of 66

5 Quick check

The regression line always passes through which point?

  • the origin
  • the first data point
  • the highest point
  • (xˉ,yˉ)(\bar x, \bar y)
Show the answer

(xˉ,yˉ)(\bar x, \bar y)

a = ȳ − b x̄ means that when x = x̄ the line gives y = ȳ.

6 What to remember

y=a+bx, b=SxySxxy = a + bx\textsf{, }b = \frac{S_{xy}}{S_{xx}}
a=yˉ−bxˉa = \bar y - b\bar x

Residual = actual − predicted

Avoid extrapolating

Challenge: What does b = 4 mean here?

Every slide is built click by click: text, formulas and pictures come in one step at a time, so the class follows the reasoning instead of reading ahead. Graphs with sliders can be dragged live while you present.

Make your own version with AIChange the level, the numbers or the language: type the topic and get a new deck that moves in about 30 seconds. Free, no account needed.

Questions teachers ask

How is the regression line y = a + bx found?

b = Sxy ÷ Sxx and a = ȳ − b·x̄. The line always passes through the mean point (x̄, ȳ).

Are these slides really free?

Yes. Watch them on this page or present them full screen with no account. Making your own copy to edit is free too.

Can I change the slides before my lesson?

Yes. Press "Make my own copy" and the deck becomes one of your projects in the Tracé editor, where you can change the text, the numbers, the colours or the order of the clicks.

Do they work on a classroom projector or an interactive whiteboard?

Yes. They run in the browser on any laptop, so anything that shows your screen works. Press the right arrow or click to go to the next step.