0% found this document useful (0 votes)
16 views

Exercise 4 - Simple Linear Regression

Uploaded by

mpgarcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Exercise 4 - Simple Linear Regression

Uploaded by

mpgarcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Econ 131: Quantitative Economics

Exercise 4: Simple Linear Regression

Student GPA ACT


1 2.8 21
2 3.4 24
3 3 26
4 3.5 27
5 3.6 29
6 3 25
7 2.7 25
8 3.7 30

1. Estimate the relationship between GPA and ACT using OLS; that is, obtain the intercept and
slope estimates in the equation

. regress gpa act

Source | SS df MS Number of obs = 8


-------------+------------------------------ F( 1, 6) = 8.20
Model | .594024707 1 .594024707 Prob > F = 0.0287
Residual | .434725292 6 .072454215 R-squared = 0.5774
-------------+------------------------------ Adj R-squared = 0.5070
Total | 1.02875 7 .146964286 Root MSE = .26917

------------------------------------------------------------------------------
gpa | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
act | .1021978 .035692 2.86 0.029 .0148626 .189533
_cons | .5681319 .9284214 0.61 0.563 -1.703633 2.839897
------------------------------------------------------------------------------
2. Compute the fitted values and residuals for each observation, and verify that the residuals
(approximately) sum to zero.

student gpa act yhat uhat


1 2.8 21 2.714286 0.0857142
2 3.4 24 3.020879 0.379121
3 3 26 3.225275 -0.2252747
4 3.5 27 3.327472 0.1725275
5 3.6 29 3.531868 0.0681318
6 3 25 3.123077 -0.1230769
7 2.7 25 3.123077 -0.4230769
8 3.7 30 3.634066 0.0659341

3. What is the predicted value of GPA when ACT = 20?

4. How much of the variation in GPA for these eight students is explained by ACT? Explain

. regress gpa act

Source | SS df MS Number of obs = 8


-------------+------------------------------ F( 1, 6) = 8.20
Model | .594024707 1 .594024707 Prob > F = 0.0287
Residual | .434725292 6 .072454215 R-squared = 0.5774
-------------+------------------------------ Adj R-squared = 0.5070
Total | 1.02875 7 .146964286 Root MSE = .26917

------------------------------------------------------------------------------
gpa | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
act | .1021978 .035692 2.86 0.029 .0148626 .189533
_cons | .5681319 .9284214 0.61 0.563 -1.703633 2.839897
------------------------------------------------------------------------------

You might also like