Chapter 3 · Section 2 practice

Fitting and Interpreting a Regression Line

Work from question 1 to 10. Edit your Python box, click Run Code, review the result, then click Submit attempt. Reference answers unlock after all ten attempts are submitted. This records completion, not correctness. Each box runs independently. Progress is saved in this browser.

Submitted: 0 / 10

1. Read the intercept

Warm-up. Print the estimated intercept rounded to three decimals.

Write your answer, then run it.

2. Read the slope

Warm-up. Print the Ads coefficient rounded to three decimals.

Write your answer, then run it.

3. Compute regression RMSE

Warm-up. Print the SLR regression RMSE using n-2 and explain why two degrees of freedom are used.

Write your answer, then run it.

4. Calculate one residual

Build your skills. Print observed minus fitted revenue for the first week.

Write your answer, then run it.

5. Calculate SSE

Build your skills. Square and sum residuals; print SSE.

Write your answer, then run it.

6. Predict a new input

Build your skills. Predict Revenue at Ads=4 with a one-row design table.

Write your answer, then run it.

7. Decompose variation

Build your skills. Calculate SST, SSR and SSE for the fitted OLS model; verify SST = SSR + SSE and print R-squared.

Write your answer, then run it.

8. Compare a proposed line

Challenge. Compare fitted SSE against SSE for the line Revenue=10+2*Ads.

Write your answer, then run it.

9. Find the largest deviation

Challenge. Print the index and signed value of the residual with greatest absolute size.

Write your answer, then run it.

10. Change predictor units

Challenge. Fit using Ads in HKD rather than thousands; print the new slope and compare it with the old slope divided by 1000.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.