Stats101A - Chapter 3
Stats101A - Chapter 3
• If 𝛽4" and 𝛽4# are good estimates of 𝛽" and 𝛽# , i.e. they
are close one another enough, then the residual (𝑒̂! )
will resemble the error term, 𝑒! .
𝑒̂! = 𝑦! − 𝑦8!
= 𝛽" + 𝛽# 𝑥! + 𝑒! − 𝛽4" + 𝛽4# 𝑥!
= 𝛽" − 𝛽4" + 𝛽# − 𝛽4# 𝑥! + 𝑒!
≈ 𝑒!
Diagnostic tool (1) Residual
• What can we observe or check from the residual plot,
i.e. scatter plot of residual vs. 𝑋?
# ̅ " +*)̅
(*! +*)(*
, where ℎ!' = (
+ .//
.
Diagnostic tool (2) Leverage
• Show :
$
• ℎA !! = ( , for 𝑖 = 1, … , 𝑛.
• The higher the leverage is, the more influential the data
point is. More specifically, if ℎ!! > 4/𝑛, i.e. if a leverage
is greater than two times of its average value, then the
corresponding 𝑥𝑖 is a leverage point.
Diagnostic tool (2) Leverage
• Revisit the example: Suppose we now have 6 observations for
weights and heights, and want to predict weights with the heights
using simple linear regression model:
# ̅
(&! '&)(& ̅
" '&)
𝑋 𝑌 𝑋 − 𝑋& & !
(𝑋 − 𝑋) The entries of ℎ!" = +
$ *++
60 105 -10 100
66 140 -4 16
72 185 2 4
70 145 0 0 ℎ!" =
62 120 -8 64
90 250 20 400
𝑋& = 70 𝑌& = 157.5 Σ = 584
Diagnostic tool (2) Leverage
• The diagonal entries (ℎ23 ) are the leverages.
• It is recommended to plot of
|𝑆𝑡𝑎𝑛𝑑𝑎𝑟𝑑𝑖𝑧𝑒𝑑 𝑅𝑒𝑠𝑖𝑑𝑢𝑎𝑙| 𝑣𝑠. 𝑋 (or fitted Y value)
, and the square root is used to reduce the skewness in
the absolute values.
• 𝑦>' ! denotes the 𝑗𝑡ℎ fitted value based on the fit obtained
when the 𝑖𝑡ℎ case has been deleted from the fit.
• 𝑟𝑖 is the 𝑖𝑡ℎ standardized residual and ℎ𝑖𝑖 is the 𝑖𝑡ℎ
leverage value.
Diagnostic tool (4) Cook’s distance
𝑟!$ ℎ!!
𝐷! = ∗
2 1 − ℎ!!
𝑌! = 𝛽" + 𝛽#𝑋! + 𝑒!
, we assume that .
𝑒! ~𝑁 0, 𝜎 $ .
, which is RSS.
How to find the best transformation
• So for any transformed 𝑌 with 𝜆, we want to have minimum
RSS, i.e.
𝑅𝑆𝑆 𝜆 = &(𝑦& ' − 𝛽*( + 𝛽*) 𝑥& )*
.
Interpretation of the transformed model
• Interpretation of the slope : In a linear model, we
learned that the slope implies “the unit change in 𝑌
associated with the unit change in 𝑋”.
.
Interpretation of the transformed model
• Log transformation : Consider the regression model,
log 𝑌 = 𝛽" + 𝛽# log 𝑋 + 𝑒