Statistics
Linear Regression
Lesson
When two variables show a roughly linear relationship, the line of best fit (also called the regression line) is the line that comes closest to all the points. Once you have it, you can predict a value of from any .
The slope and intercept formulas:
Where and are the means of the - and -values. Calculators and spreadsheets do this for you in practice; for small data sets it’s manageable by hand.
Once you have the line, prediction is just substitution — plug an value into .
Worked example 1 — fit and predict
Data: (1, 5), (2, 8), (3, 11), (4, 14). The points jump by 3 each time, so the line is exactly : slope , intercept .
To predict at :
Worked example 2 — non-perfect data
Data: (1, 3), (2, 5), (3, 4), (4, 6). Using the formulas: , .
Regression line: .
How to type your answer
A single number — slope, intercept, or a predicted value, depending on the question. Use a decimal point if needed. Examples: 3, 2.5, 17, -8.
Practice
Work through these. Stuck? Click Get a hint.
Warm-Up
Quick problems to get going.
Problem 1
Problem 2
Problem 3
Problem 4
Practice
Standard problems matching the lesson.
Problem 5
Problem 6
Problem 7
Problem 8
Problem 9
Problem 10
Problem 11
Problem 12
Problem 13
Problem 14
Challenge
Harder problems — edge cases, trickier numbers, multiple steps.
Problem 15
Problem 16
Problem 17
Problem 18
Problem 19
Problem 20
Problem 21
Problem 22