Historical Context & Motivation
Humans have always tried to find patterns in data, but for most of history there was no systematic way to draw a "best" line through a cloud of points. Imagine an astronomer in the 1700s recording the positions of a comet night after night — each measurement slightly imperfect due to telescope limitations. How could anyone decide which straight line best summarized those observations? This question drove some of the greatest mathematicians in history to develop what we now call linear regression, a technique that finds the single straight line that fits a set of data points as closely as possible.
The central question that linear regression answers is deceptively simple: Given a scatter of data points, what single straight line does the best job of summarizing the relationship between two variables? In this lesson you will learn how to find that line, what its slope and y-intercept actually mean in context, and how to use it for predictions.
Core Principles & Definitions
Before you can build a regression model, you need a few foundational ideas. A scatter plot displays pairs of numerical data as points on a coordinate plane, with the explanatory variable (often called the independent variable) on the x-axis and the response variable (dependent variable) on the y-axis. When the points cluster around a line-shaped pattern, we say the data shows a linear association.
Line of Best Fit
Slope (b₁)
Y-Intercept (b₀)
Residual
Visual Explanation — The Scatter Plot and Line of Best Fit
The diagram below shows a scatter plot of data relating hours studied (x-axis) to test score (y-axis) for 10 students. The regression line is drawn through the data, and the vertical dashed segments illustrate residuals — the gaps between observed and predicted scores.
Notice how the line doesn't pass through every point — it doesn't need to. The line is positioned so the total of all the squared residuals is as small as possible. Points above the line have positive residuals (the student scored better than predicted), and points below the line have negative residuals (the student scored lower than predicted). This balance is the heart of the least-squares criterion.
Mathematical Framework
The regression line has the familiar form of a linear equation. We write it with a "hat" on y to show it represents a predicted value rather than an observed one.
The formulas for slope and intercept use the means and standard deviations of x and y, along with the correlation coefficient r, which measures the strength and direction of the linear relationship.
Interpreting Slope and Intercept in Context
Computing the numbers is only half the job. The real power of regression lies in explaining what those numbers mean in the real-world situation you are analyzing. The diagram below illustrates how slope and intercept map onto a concrete scenario — predicting the cost of a phone plan based on gigabytes of data used.
Template Sentences for Interpretation
When you interpret slope on a test or assignment, use language like: "For each additional [unit of x], the predicted [y] increases (or decreases) by [slope value] [units of y]." For the intercept, say: "When [x] is 0, the predicted [y] is [intercept value] [units of y]." Always mention whether the intercept makes practical sense. If nobody in the dataset had an x-value near zero, then the intercept is an extrapolation and may not be meaningful in context.
| Component | What It Tells You | Example (Phone Plan) |
|---|---|---|
| Slope (b₁) | Rate of change — how much ŷ changes per one-unit increase in x | Each additional GB of data costs an extra $4.50 per month |
| Intercept (b₀) | Starting value — predicted ŷ when x = 0 | The base monthly fee is $25 when no data is used |
| ŷ (prediction) | Predicted value for a specific x | A user consuming 6 GB is predicted to pay 25 + 4.5(6) = $52 |
Worked Example — Ice Cream Sales vs. Temperature
A shop owner tracks the daily high temperature (°F) and the number of ice cream cones sold over 8 days. After entering the data into a calculator, the owner obtains: x̄ = 75 °F, ȳ = 120 cones, sx = 10 °F, sy = 30 cones, and r = 0.92. Find the regression equation and interpret slope and intercept.
Strengths and Limitations of Linear Regression
Linear regression is one of the most widely used statistical tools, but like any model, it has boundaries. Understanding when it works well — and when it doesn't — will keep you from drawing flawed conclusions.
| Strengths ✓ | Limitations ✗ |
|---|---|
| Easy to compute and interpret — the slope gives a clear rate of change. | Only captures straight-line patterns. Curved data requires a different model. |
| Makes predictions within the range of the data (interpolation). | Extrapolation (predicting outside the data range) can be wildly inaccurate. |
| The line always passes through the mean point (x̄, ȳ), keeping predictions centered on the data. | Outliers can pull the line dramatically off course. |
| Correlation coefficient r tells you direction and strength of the relationship. | Correlation does not imply causation — a strong line does not prove x causes y. |
Connection to Advanced Models
The simple linear regression you learn in Math 1 is the foundation for a whole family of more powerful techniques. As you move into AP Statistics, college courses, or data science, you'll encounter models that build directly on these ideas.
| Concept | What You Learn Now | Where It Goes Next |
|---|---|---|
| Number of Variables | One explanatory variable (simple linear regression) | Multiple explanatory variables (multiple regression) |
| Shape of Fit | Straight line only | Curves — quadratic, exponential, logarithmic regression |
| Goodness of Fit | Correlation coefficient r | Coefficient of determination r², residual plots, standard error |
| Prediction Confidence | Point prediction (a single ŷ) | Prediction intervals (a range of plausible values) |
Even machine-learning models used in fields like self-driving cars and medical diagnosis trace their roots back to fitting lines through data. Mastering slope, intercept, and residuals now gives you the vocabulary and intuition to tackle those more complex models later.
Practice Problems
Lesson Summary
A linear regression model fits a line of best fit (ŷ = b₀ + b₁x) through a scatter plot by minimizing the sum of the squared residuals. The slope (b₁) tells you how much ŷ changes for each one-unit increase in x — it is the rate of change in context. The y-intercept (b₀) is the predicted y-value when x = 0, though it may not always have a practical meaning. To calculate these values you use b₁ = r × (s_y / s_x) and b₀ = ȳ − b₁ × x̄, and the line always passes through the point (x̄, ȳ).
Always interpret slope and intercept in context — connect the numbers to what x and y actually represent. Be cautious with extrapolation (predicting outside the data range), watch out for outliers that can distort the line, and remember that a strong correlation does not prove causation. Mastering these ideas prepares you for more advanced topics like multiple regression, non-linear models, and the coefficient of determination r².