ECO220 · Lecture 9 · Tue Oct 27 · 52 min
Lecture 9 Linear Regression.
When the variance of the error depends on , the residual plot fans out, and that fan is on the midterm.
The regression model
06:40 to 13:10 ·
The model says depends on through an intercept and a slope . One more unit of moves by on average. Everything else that moves , all the things the line cannot see, sits in the error .
The professor wrote the model first and left it up for the whole hour: every later idea on the board is about .
Formula
- intercept, when
- slope, change in per unit of
- error, everything else that moves
Residuals
13:10 to 14:20 ·
We never see , so we look at what the fitted line misses instead. For one point, the residual is the real minus the line's prediction . On the board: “take this and move it here”, the gap between the point and the line.
With an intercept in the model the residuals add up to zero, so their average tells you nothing. Their spread does.
Formula
- residual for one point
- the value observed
- the value the line predicts
Worked Example
The fitted line is . A student who studied hours scored . What is the residual?
Put into the line to get the prediction.
Subtract the prediction from what was observed.
AnswerThe residual is : the student scored 1.5 points above the line.
A positive residual means the point sits above the line.
When the spread changes
14:20 to 52:00 ·
Plot each residual against its fitted value. If the points stay in an even band around zero, the variance of is constant. If the band widens as the fitted value grows, the variance depends on : this is heteroskedasticity.
The board note read “variance increases as fitted value ↑”, next to a plot that fans out to the right.
Graph
Residuals vs fitted values
Putting It Together
The model splits into a line and an error . Residuals stand in for , and plotting them against fitted values shows whether its variance is constant: an even band means yes, a fan means heteroskedasticity.