Chapter 3 · Section 7 practice

Multiple Linear Regression and Multicollinearity

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. Count usable cities

Warm-up. Print the number of raw rows, observed-profit cities and residual degrees of freedom.

Write your answer, then run it.

2. Read a partial slope

Warm-up. Print the disposable-income slope and the fitted profit difference for US$1,000 higher disposable income, holding the other inputs fixed.

Write your answer, then run it.

3. Predict the proposal

Warm-up. Supply the six proposed-city inputs and print its full-model predicted annual Profit.

Write your answer, then run it.

4. Reconstruct adjusted R-squared

Build your skills. Reconstruct adjusted R-squared from SSE, SST, n and the six predictors; compare with statsmodels.

Write your answer, then run it.

5. Read regression RMSE

Build your skills. Calculate course RMSE s in annual US dollars using the correct degrees of freedom.

Write your answer, then run it.

6. Inspect predictor dependence

Build your skills. Print the correlation between social-security recipients and the age-65+ share.

Write your answer, then run it.

7. Calculate an auxiliary VIF

Build your skills. Regress social-security recipients on the other five demographics and calculate its VIF.

Write your answer, then run it.

8. Read joint significance

Challenge. Print the overall F statistic and its p-value.

Write your answer, then run it.

9. Read individual uncertainty

Challenge. Print the social-security t statistic, p-value and coefficient confidence interval.

Write your answer, then run it.

10. Recognise perfect dependence

Challenge. Create a predictor equal to twice Income. Print the matrix rank and number of columns for the intercept plus these two income columns.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.