ECO220 · Lectures

ECO220 · Lecture 9 · Tue Oct 27 · 52 min

Lecture 9 Linear Regression.

When the variance of the error depends on xx, the residual plot fans out, and that fan is on the midterm.

0 of 3 read
Contents

In These Notes

Written From

6 board photos00:04 to 15:05Transcript52 min
1

The regression model

06:40 to 13:10 ·

The model says yy depends on xx through an intercept b0b_0 and a slope b1b_1. One more unit of xx moves yy by b1b_1 on average. Everything else that moves yy, all the things the line cannot see, sits in the error uu.

The professor wrote the model first and left it up for the whole hour: every later idea on the board is about uu.

Formula

y=b0+b1x+uy = b_0 + b_1 x + u
b0b_0
intercept, yy when x=0x = 0
b1b_1
slope, change in yy per unit of xx
uu
error, everything else that moves yy
2

Residuals

13:10 to 14:20 ·

We never see uu, so we look at what the fitted line misses instead. For one point, the residual is the real yy minus the line's prediction y^\hat{y}. 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

e=y−y^e = y - \hat{y}
ee
residual for one point
yy
the value observed
y^\hat{y}
the value the line predicts

Worked Example

The fitted line is y^=2+0.5x\hat{y} = 2 + 0.5x. A student who studied x=4x = 4 hours scored y=5.5y = 5.5. What is the residual?

  1. Put x=4x = 4 into the line to get the prediction.

    y^=2+0.5(4)=4\hat{y} = 2 + 0.5(4) = 4
  2. Subtract the prediction from what was observed.

    e=5.5−4=1.5e = 5.5 - 4 = 1.5

AnswerThe residual is 1.51.5: the student scored 1.5 points above the line.

A positive residual means the point sits above the line.

3

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 uu is constant. If the band widens as the fitted value grows, the variance depends on xx: 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

fitted valueresidual0fitted valueresidual0
From Var⁡(u∣x)=σ2(x)\operatorname{Var}(u \mid x) = \sigma^2(x). The spread grows with the fitted value: a fan.
✓

Putting It Together

The model splits yy into a line and an error uu. Residuals stand in for uu, and plotting them against fitted values shows whether its variance is constant: an even band means yes, a fan means heteroskedasticity.

Keep these notes with your course.

Download PDFAdd to Cadenza

ECO220 · Lecture 9 · Tue Oct 27

This Lecture

Front Row named it from what was taught. Lecture 9 and the date stay.

Save Title

Delete Lecture 9?

Linear Regression, from Tue Oct 27. This deletes it for good:

You can't undo this.

Delete for Good