01 / 20

Linear Regression
Models

Learn to fit a line of best fit to data, then interpret the slope and intercept to make predictions in real-world contexts.

Math 1

What Is Linear Regression?

Linear regression is a statistical method for finding the straight line that best describes the relationship between two numerical variables. Given a set of data points, regression finds the line \( \hat{y} = mx + b \) that minimizes the overall distance from every point to the line.

Explanatory Variable
The independent variable \( x \) that we use to predict
Response Variable
The dependent variable \( y \) that we want to predict

Scatter Plots and Patterns

Hours Studied Exam Score 1 2 3 4 5 50 60 70 80 90 best fit

Why Regression Matters

Linear regression turns raw data into a predictive tool. Once we have the equation of the line, we can:

1
Describe the relationship between \( x \) and \( y \) with a single equation
2
Predict outcomes for new \( x \)-values we haven't observed yet
3
Quantify how much \( y \) changes for each unit increase in \( x \)

The Line of Best Fit Equation

\( \hat{y} \)
The predicted value of the response variable
\( m \)
The slope: rate of change per unit of \( x \)
\( b \)
The y-intercept: predicted value when \( x = 0 \)

The "hat" on \( \hat{y} \) reminds us this is a prediction, not an observed value. The line minimizes the sum of squared vertical distances (residuals) from each point to the line.

Interpreting the Slope

x y run = 1 unit rise = m

Slope is the rate of change: \( m = \dfrac{\text{rise}}{\text{run}} = \dfrac{\Delta y}{\Delta x} \). A positive slope means \( y \) increases as \( x \) increases; a negative slope means \( y \) decreases.

Interpreting the Y-Intercept

x y b = y-intercept predicted y when x = 0 0

Always check: does \( x = 0 \) make sense in context? If the data only covers \( x \)-values from 10 to 50, the intercept may be extrapolation and not practically meaningful.

Correlation vs. Causation

Correlation
Two variables move together: as one changes, the other tends to change in a predictable way. Measured by \( r \).
Causation
A change in one variable directly produces a change in the other. Requires a controlled experiment to establish.

The Correlation Coefficient \( r \)

The value \( r \) measures the strength and direction of a linear relationship. It always satisfies \( -1 \leq r \leq 1 \).

\( r \) close to +1
Strong positive linear association: as \( x \) increases, \( y \) increases
\( r \) close to 0
Weak or no linear association between \( x \) and \( y \)
\( r \) close to -1
Strong negative linear association: as \( x \) increases, \( y \) decreases

How to Find the Line of Best Fit

1
Plot the data on a scatter plot and look for a linear trend
2
Use technology (calculator or software) to compute the regression equation \( \hat{y} = mx + b \)
3
Check \( r \) and \( r^2 \) to assess how well the line fits the data
4
Interpret slope and intercept in the context of the problem
5
Make predictions by substituting an \( x \)-value into the equation

Example 1: Study Hours

A teacher collects data on hours studied and exam scores for 8 students. The regression equation is:

Slope = 8.5
For each additional hour studied, the predicted exam score increases by 8.5 points
Intercept = 52
A student who studies 0 hours is predicted to score about 52 points

Example 2: Temperature and Sales

A store tracks daily high temperature (\( x \), in \(^{\circ}\text{F}\)) and hot chocolate sales (\( y \), in cups). The regression output gives:

1
Slope = \( -1.4 \): For each additional degree in temperature, hot chocolate sales decrease by about 1.4 cups
2
Intercept = 120: At \(0^{\circ}\text{F}\), the model predicts about 120 cups sold (this is an extrapolation if \(0^{\circ}\text{F}\) is outside the data range)
3
\( r = -0.92 \): Strong negative linear association; \( r^2 = 0.846 \), so about 84.6% of the variation in sales is explained by temperature

Example 3: Residuals

A residual is the difference between the observed value and the predicted value: \( \text{residual} = y - \hat{y} \).

x y positive positive negative negative

Interpolation vs. Extrapolation

Interpolation
Predicting within the range of the data. Generally reliable if the model fits well.
Extrapolation
Predicting outside the range of the data. Often unreliable because the trend may not continue.
data range extrapolation extrapolation

Common Mistakes

✕ Confusing \( r \) and \( r^2 \)
\( r = 0.9 \) does not mean 90% of variation is explained. You need \( r^2 = 0.81 \), which means 81%.
✕ Claiming Causation
A strong \( r \) value shows association, not causation. Always check if there could be a confounding variable.
✕ Ignoring Context for Intercept
The y-intercept \( b \) may not be meaningful if \( x = 0 \) is outside the range of the data or makes no sense practically.

Summary Table

Component Symbol Interpretation
Slope \( m \) Change in \( \hat{y} \) per unit change in \( x \)
Y-Intercept \( b \) Predicted \( y \) when \( x = 0 \)
Correlation \( r \) Strength and direction (\( -1 \) to \( 1 \))
Coefficient of Determination \( r^2 \) Fraction of variation in \( y \) explained by model
Residual \( y - \hat{y} \) Error for a single data point
Predicted Value \( \hat{y} \) Value the line gives for a given \( x \)

Question 1 of 5

A regression model for predicting test scores from hours of sleep is \( \hat{y} = 4.2x + 38 \). What does the slope of \( 4.2 \) mean in context?

Question 2 of 5

If a regression equation is \( \hat{y} = -2.5x + 100 \), and the data ranges from \( x = 5 \) to \( x = 30 \), which prediction is extrapolation?

Question 3 of 5

A data set has \( r = -0.85 \). Which statement is true?

Question 4 of 5

The regression equation \( \hat{y} = 3x + 20 \) predicts \( \hat{y} = 50 \) when \( x = 10 \). A student actually scores \( y = 56 \). What is the residual?

Question 5 of 5

In the equation \( \hat{y} = 0.75x + 12 \), the y-intercept of \( 12 \) represents: