Linear regression
Predicting one metric from another with a straight line, and checking the fit.
Lesson 18 of 24~30 min of learningIncludes ~20 min for questions and tasks
Contents1 of 51 steps
Alex Tutor
You
Alex Tutor
Alex Tutor
Dataset · 10 rows
CatChow weekly ad spend and orders from ads
The same ten weeks of ad spend and orders from the correlation lesson, now used to fit a line.
- Columns
- week
- Week number
- ad_spend_usd
- Weekly ad spend, USD
- orders_from_ads
- Orders attributed to ads that week
Data
| week | ad_spend_usd | orders_from_ads |
|---|---|---|
| 1 | 200 | 20 |
| 2 | 300 | 23 |
| 3 | 350 | 30 |
| 4 | 400 | 28 |
| 5 | 450 | 36 |
Show 5 more rows
| 6 | 500 | 33 |
| 7 | 550 | 42 |
| 8 | 600 | 38 |
| 9 | 650 | 48 |
| 10 | 700 | 44 |
Alex Tutor
Chart data
| Ad spend, USD | Orders from ads |
|---|---|
| 200 | 20 |
| 300 | 23 |
| 350 | 30 |
| 400 | 28 |
| 450 | 36 |
Show 5 more rows
| 500 | 33 |
| 550 | 42 |
| 600 | 38 |
| 650 | 48 |
| 700 | 44 |
You
Alex Tutor
Alex Tutor
Question 1
What does linear regression give you that correlation alone does not?
You
Alex Tutor
Alex Tutor
You
Alex Tutor
Alex Tutor
Question 2
The residuals of a least-squares regression line (fit with an intercept) always sum to exactly zero.
You
Alex Tutor
SLOPE() and INTERCEPT() functions do this arithmetic, or you can grind through the formula by hand.You
Alex Tutor
Question 3
Using the dataset CatChow weekly ad spend and orders from ads, compute the slope b1 of the least-squares line predicting orders_from_ads from ad_spend_usd. Give your answer as orders per $100 of extra weekly spend.
Units: orders per 100 USD of ad spend, e.g. 4.0
You
Alex Tutor
You
Alex Tutor
Question 4
Using b0≈8.85 and b1≈0.0539, predict orders_from_ads for a week with $550 of ad spend.
Units: orders, e.g. 30.0
You
Alex Tutor
Alex Tutor
You
Alex Tutor
Alex Tutor
Question 5
Match each regression term to what it means.
Tap an answer, then tap the row it belongs to. You can also drag.
- How many more orders each extra $100 of spend predicts
- The predicted orders when ad spend is zero
- The gap between a week's actual orders and the line's prediction for it
- The share of week-to-week variation in orders that the line explains
Answers left to place
You
Alex Tutor
Alex Tutor
Question 6
Which of these are real risks when using this regression line to plan next quarter's ad budget? Select all that apply.
Alex Tutor
You
Alex Tutor
Alex Tutor
Question 7Short answer · AI-checked task
You plot the residuals against ad spend and they aren't scattered randomly: small negative residuals at low spend, positive around the middle, negative again at high spend — a curve. What might this pattern mean, and what would you consider doing next? Answer in 2-4 sentences.
Write your answer and get a score with feedback from our AI reviewer.
Log in to get AI feedbackYou
Alex Tutor
Alex Tutor
Question 8Case · AI-checked task
Write your recommendation about using this line to plan next quarter's ad budget.
Using the fitted line (b0≈8.85, b1≈0.0539, R2≈0.90) from the dataset CatChow weekly ad spend and orders from ads, a colleague plugged in a planned $900 weekly ad spend and got a prediction of about 57 orders, then asked to lock in next quarter's budget around that level. Write a short recommendation covering: what the line and its R² tell you, why $900 deserves extra caution, and what you'd want to see before committing.
Write your answer and get a score with feedback from our AI reviewer.
Log in to get AI feedback