Back to Lesson

Teacher Guide: Linear Regression

Learn how to find the line of best fit for data and use it to make predictions.

Use this lesson with your class

Free, no student accounts needed.

Share with students

Students open the lesson and practise with instant feedback.

Printable worksheet

All practice problems on paper, with a separate answer key.

Class quiz

10 questions on Regression. Students join with a name, you see everyone's score.

For Teachers

Learning Objectives
  • Understand the concept of linear regression and line of best fit
  • Calculate slope and y-intercept using the least squares method
  • Interpret the meaning of slope and y-intercept in context
  • Use the regression equation to make predictions
  • Recognize limitations of linear regression including extrapolation risks
Prerequisites
  • Understanding of scatter plots and correlation
  • Knowledge of linear equations in slope-intercept form
  • Basic understanding of mean and summation notation
  • Familiarity with coordinate graphing
Discussion Starters
  • 1. Why do you think the method is called 'least squares'? What are we making 'least'?
  • 2. Can you think of a real situation where two variables are related but one doesn't cause the other?
  • 3. When would it be dangerous to extrapolate a regression line far beyond your data?
  • 4. How would you decide if linear regression is a good fit for your data?
Common Misconceptions

The regression line must pass through at least two data points

A strong correlation means we can predict perfectly

The y-intercept always has a meaningful interpretation

Differentiation Ideas

For Struggling Students:

  • Start with simple data sets (3-4 points) with nice numbers
  • Provide graphing technology to calculate regression automatically
  • Focus on interpretation before calculation
  • Use visual representations to show what 'best fit' means

For On-Level Students:

  • Calculate regression by hand for small data sets
  • Make predictions and compare to actual values
  • Analyze residuals to evaluate fit quality
  • Apply regression to real-world scenarios

For Advanced Students:

  • Explore the derivation of least squares formulas
  • Calculate and interpret coefficient of determination ()
  • Compare regression lines from different data sets
  • Investigate when residual plots indicate a poor linear fit
Standards Alignment
  • HSS.ID.B.6 (CCSS.MATH.CONTENT.HSS.ID.B.6)

    Represent data on two quantitative variables on a scatter plot, and describe how the variables are related

  • HSS.ID.B.6.C (CCSS.MATH.CONTENT.HSS.ID.B.6.C)

    Fit a linear function for a scatter plot that suggests a linear association

  • HSS.ID.C.7 (CCSS.MATH.CONTENT.HSS.ID.C.7)

    Interpret the slope and the intercept of a linear model in the context of the data

Lesson Resources
  • visualInteractive Regression Tool

    Students plot points and see the best fit line calculated in real time

  • activityData Collection Project

    Collect real data (height vs. arm span, study time vs. grades) and find regression lines

  • worksheetRegression Calculation Practice

    Practice calculating slope, intercept, and making predictions

Lesson Content

Everything students see: definition, examples, common mistakes, applications. Tap to open.

Definition

Linear regression is a statistical method for finding the straight line that best fits a set of data points. This line, called the line of best fit or regression line, minimizes the distances between the line and all the data points.
The equation of the regression line is:
Where:
  • is the slope (how much changes for each unit increase in )
  • is the y-intercept (the value of when )
The least squares method finds the line that minimizes the sum of squared distances (residuals) from each point to the line:

Worked Examples

A coffee shop tracks daily temperature (°C) and iced coffee sales: | Temperature | Sales | |-------------|-------| | 15 | 20 | | 20 | 35 | | 25 | 45 | | 30 | 60 | | 35 | 70 | Find the equation of the regression line.

1

Calculate the means

,

2

Calculate slope using the formula

Numerator: Denominator:

3

Calculate y-intercept

4

Write the regression equation

Regression line:

Common Mistakes

Assuming the regression line passes through all data points

Why it's wrong: The line of best fit minimizes total error but rarely passes through every point. Points above and below the line are normal.

Correct: Understand that the regression line represents the overall trend, not individual data points.

Using the regression equation for extrapolation far beyond the data range

Why it's wrong: The relationship may not hold outside the range of observed data. Predicting far beyond your data can give unrealistic results.

Correct: Be cautious when predicting for x-values far outside your data range. Note when you're extrapolating.

Confusing correlation with causation

Why it's wrong: A strong linear relationship doesn't mean one variable causes changes in the other. There may be other factors involved.

Correct: Use regression to describe relationships and make predictions, but be careful about claiming causation.

Forgetting to check if a linear model is appropriate

Why it's wrong: Not all data follows a linear pattern. Using linear regression on non-linear data gives misleading results.

Correct: Always plot your data first. If the scatter plot shows a curve, linear regression may not be the best choice.

Why It Matters

Linear regression is one of the most important tools in data analysis:
  • Business: Predict sales based on advertising spending or price changes
  • Science: Model relationships between variables in experiments
  • Medicine: Predict patient outcomes based on treatment data
  • Economics: Forecast economic indicators based on historical trends
  • Sports: Analyze player performance and predict future statistics
Understanding regression helps you make data-driven predictions and identify trends that would be impossible to see by just looking at raw numbers.

Real World Applications

Predicting Housing Prices

Real estate analysts use linear regression to estimate home prices based on features like square footage, number of bedrooms, or distance from city center.

Example:

If where is square meters and is price in euros, a 100 m² apartment would cost about 150(100) + 50000 = 65000 euros.

1Try It Yourself

A real estate model shows: Price = 200x + 30000 (where x = square meters).

What price would you predict for a 120 m² apartment?

Step 1: Write the mathematical expression

Substitute into the equation:

Fuel Efficiency Analysis

Automotive engineers use regression to understand how car weight affects fuel consumption.

Example:

If fuel consumption (L/100km) = 0.004 × weight (kg) + 2, a 1500 kg car would use 0.004(1500) + 2 = 8 L/100km.

2Try It Yourself

A car manufacturer's data shows: Fuel = 0.005w + 1.5 (where w = weight in kg).

Predict fuel consumption for a 1200 kg vehicle.

Step 1: Write the mathematical expression

Calculate:

Business Sales Forecasting

Companies use regression to predict future sales based on advertising spending, helping them allocate marketing budgets effectively.

Example:

If monthly sales = 3 × ad spending + 10000, spending 5000 euros on ads predicts sales of 3(5000) + 10000 = 25000 euros.

3Try It Yourself

A company's model: Sales = 4 × AdBudget + 8000.

If they spend 3000 euros on advertising, what sales can they expect?

Step 1: Write the mathematical expression

Calculate predicted sales:

Key Takeaways

  • 1Linear regression finds the line that best fits a set of data points
  • 2The regression line equation is where is slope and is y-intercept
  • 3Slope tells you how much changes for each unit increase in
  • 4The y-intercept is the predicted value of when
  • 5Use regression to make predictions, but be cautious about extrapolating far beyond your data

Frequently Asked Questions

What if my data doesn't look linear?

If your scatter plot shows a curve rather than a straight line, linear regression may not be appropriate. Consider polynomial regression or other non-linear models instead.

Can regression prove that one thing causes another?

No. Regression shows relationships (correlations) but cannot prove causation. Two variables might be related because of a third factor, not because one causes the other.

What is a residual?

A residual is the difference between an actual data point and the predicted value from the regression line: residual = . Positive residuals mean the point is above the line; negative means below.

Glossary

Linear regression
A statistical method for finding the straight line that best fits a set of data points
Line of best fit
The regression line that minimizes the sum of squared residuals
Slope
The rate of change; how much increases for each unit increase in
Y-intercept
The value of when ; where the line crosses the y-axis
Residual
The difference between an actual data point and its predicted value on the regression line
Least squares
The method that finds the line minimizing the sum of squared residuals
Extrapolation
Using a regression equation to predict values outside the range of the original data

Formula Card

Regression Line

The equation of the line of best fit where m is slope and b is y-intercept

Slope Formula

Calculate the slope from data points using means and deviations

Y-Intercept

Calculate the y-intercept using the slope and the means of x and y

Residual

The difference between actual and predicted values for each point

More in This Topic