Simple Linear
Regression
Learn to fit a line to data, interpret the slope and intercept, and use \(\hat{y} = b_0 + b_1 x\) to make predictions in real business scenarios.
What Is Regression?
Regression is a statistical method that models the relationship between a dependent variable \(y\) and one or more independent variables \(x\). In simple linear regression, we use exactly one predictor to fit a straight line through the data.
Key Terminology
Why It Matters in Business
Simple linear regression is the foundation of predictive analytics. Companies use it daily to answer questions like:
The Regression Equation
The simple linear regression model is:
The Least Squares Method
We choose \(b_0\) and \(b_1\) to minimize the sum of squared residuals:
The formulas that minimize SSE are:
Visualizing the Best-Fit Line
Correlation vs. Regression
| Correlation \(r\) | Regression | |
|---|---|---|
| Purpose | Measures strength and direction | Models the equation of the relationship |
| Output | A single number: \(-1 \leq r \leq 1\) | An equation: \(\hat{y} = b_0 + b_1 x\) |
| Prediction | Cannot predict specific values | Can predict \(\hat{y}\) for any \(x\) |
| Direction matters? | Symmetric: \(r_{xy} = r_{yx}\) | Asymmetric: \(x\) predicts \(y\), not vice versa |
Interpreting \(R^2\)
\(R^2\) (the coefficient of determination) tells you the proportion of variance in \(y\) explained by the model:
How to Fit a Regression
Example 1: Computing the Slope
A coffee shop tracks temperature (\(x\), in °F) and iced-coffee sales (\(y\), in cups) over 5 days:
| Day | \(x\) (°F) | \(y\) (cups) |
|---|---|---|
| 1 | 60 | 30 |
| 2 | 70 | 40 |
| 3 | 75 | 50 |
| 4 | 80 | 55 |
| 5 | 90 | 75 |
Example 1: Finding \(b_1\) and \(b_0\)
Example 2: Making a Prediction
Using the equation \(\hat{y} = -62.5 + 1.5x\), predict sales on a 85°F day:
Example 3: Computing \(R^2\)
For our coffee-shop data, compute how well the model fits:
Common Mistakes
Summary of Key Concepts
| Concept | Symbol | Interpretation |
|---|---|---|
| Slope | \(b_1\) | Change in \(\hat{y}\) per 1-unit change in \(x\) |
| Intercept | \(b_0\) | Predicted \(y\) when \(x = 0\) |
| Coefficient of Determination | \(R^2\) | Proportion of variance in \(y\) explained by the model |
| Residual | \(e_i = y_i - \hat{y}_i\) | Error for observation \(i\): actual minus predicted |
| SSE | \(\sum e_i^2\) | Total squared error: smaller is better |
| Correlation | \(r\) | Direction and strength: \(r = \pm\sqrt{R^2}\) |
Question 1 of 5
A regression equation is \(\hat{y} = 20 + 3x\). What does the slope of 3 mean?
Question 2 of 5
If \(R^2 = 0.85\) for a regression model, which statement is most accurate?
Question 3 of 5
Given the data: \(\bar{x} = 10\), \(\bar{y} = 25\), \(b_1 = 2\). What is the intercept \(b_0\)?
Question 4 of 5
A company builds a regression with data from \(x = 10\) to \(x = 50\). Using it to predict \(y\) at \(x = 200\) is an example of:
Question 5 of 5
The residual for a data point is \(e_i = -4\). This means the actual value \(y_i\) is: