28.07.2014 Views

Linear Regression

Linear Regression

Linear Regression

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The line appears to fit the data well. However, we always want to make sure to<br />

check the residual plots. We can calculate the residuals by typing the command:<br />

predict r, resid<br />

Again, note that other than creating a new variable named r there will be no<br />

additional output. We can use this new variable to create a residual plot by<br />

typing:<br />

scatter r year<br />

This gives rise to the following output:<br />

Residuals<br />

-.4 -.2 -5.55e-17 .2 .4<br />

1980 1985 1990 1995 2000<br />

year<br />

The residual plot shows no apparent pattern.<br />

Homework:<br />

Do problems RII.8 and 10.9 from the textbook.<br />

Solve both of these problems using STATA. For each questions make sure to<br />

hand in<br />

(a) your log file,<br />

(b) a scatter plot with a regression line superimposed,<br />

(c) a residual plot, and<br />

(d) answers to all the questions in the text.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!