第 14 章 model-selection 案例:比較 nonlinear trendlines 時,不只看 R²,也要看模型複雜度與 residual pattern。
原書先用 advertising dollars spent 與 resulting sales 的 8 筆資料比較不同 trendlines,再以 Coca-Cola revenue 的 residual plots 示範:即使圖形/R² 看似合理,residuals 仍可能指出模型不足。
| Advertising($000) | Sales($000) |
|---|---|
| 74 | 900 |
| 27.5 | 266.4 |
| 169 | 155.2 |
| 497 | 4320 |
| 270.5 | 2707.2 |
| 44.5 | 439.2 |
| 63 | 1209.6 |
| 189.5 | 2966.4 |
在同一 scatterplot 依序加入 Linear、Power、Polynomial、Exponential、Logarithmic trendlines,勾選 Display Equation 與 Display R-squared value。接著比較 residual plots,檢查是否存在系統性 pattern。
| 來源比較 | 原書結論 |
|---|---|
| Advertising→Sales | Simple linear 與 third-order polynomial 的 R² 都約 77% |
| 模型選擇 | 在 fit 相近時,原書選擇較簡單的 simple linear regression |
| Coca-Cola residual example | Linear、second-order polynomial、exponential residuals 有 systematic structure;third-order polynomial residuals 較 random |
| 樣本限制 | Coca-Cola residual comparison 僅 23 values,原書提醒需謹慎 |
兩個原書例子一起說明選模的優先順序:若兩個模型 R² 差不多,先選較簡單者;但如果 residuals 顯示明顯結構,表示簡單模型仍漏掉資料中的曲線訊號,此時才有理由升級到較複雜模型。
假設 linear 與 third-order polynomial 的 R² 都約 0.77,請依 parsimony 說明應先選哪個;接著若 linear residual plot 出現規律波浪形,說明為何這會改變原先決策。
**問題:**R² 從 0.77 提高到 0.78,但模型從一條直線變成五次 polynomial,是否值得?