0% found this document useful (0 votes)
18 views8 pages

Ecomtrics Assigmnt and Answers

Uploaded by

Genene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Ecomtrics Assigmnt and Answers

Uploaded by

Genene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

a) Fit a simple linear regression model of asset price on Standard & Poor’s market price index.

Notes:
1. Unicode is supported; see help unicode_advice.
2. Maximum number of variables is set to 5000; see help set_maxvar.

. import excel "C:\Users\Gech\Desktop\Assimnts econmtrics\Asset prices data for assignment # 2 2024444444.xlsx", sheet("group thre
> e") firstrow

. gen time =_n

. regress General_Electric S_and_P

Source SS df MS Number of obs = 111


F(1, 109) = 92.66
Model 1896.50024 1 1896.50024 Prob > F = 0.0000
Residual 2230.84203 109 20.4664406 R-squared = 0.4595
Adj R-squared = 0.4545
Total 4127.34227 110 37.5212933 Root MSE = 4.524

General_El~c Coef. Std. Err. t P>|t| [95% Conf. Interval]

S_and_P .0234734 .0024385 9.63 0.000 .0186404 .0283064


_cons -7.623774 3.067215 -2.49 0.014 -13.70289 -1.544654

. predict residual, r

. tsline time
time variable not set, use tsset varname ...
r(111);

. tsset time
time variable: time, 1 to 111
delta: 1 unit

. tsline r

. tsline r if e(sample)==1, yline(0)

To fit a simple linear regression model of General Electric’s asset price on the Standard & Poor’s
market price index, the following equation can be used:

General_Electric = -7.623774 + 0.0234734 * S_and_P

In this model:

 The coefficient for S_and_P is 0.0234734, indicating that for every one-unit increase in
the Standard & Poor’s market price index, General Electric’s asset price is expected to
increase by 0.0234734 units.
 The intercept term (_cons) is -7.623774, representing the estimated asset price of General
Electric when the Standard & Poor’s market price index is zero.
b) Plot the residuals against time. Do you suspect the presence of residual autocorrelation? Provide a
brief discussion.

. regress General_Electric S_and_P

Source SS df MS Number of obs = 111


F(1, 109) = 92.66
Model 1896.50024 1 1896.50024 Prob > F = 0.0000
Residual 2230.84203 109 20.4664406 R-squared = 0.4595
Adj R-squared = 0.4545
Total 4127.34227 110 37.5212933 Root MSE = 4.524

General_El~c Coef. Std. Err. t P>|t| [95% Conf. Interval]

S_and_P .0234734 .0024385 9.63 0.000 .0186404 .0283064


_cons -7.623774 3.067215 -2.49 0.014 -13.70289 -1.544654

. predict residual, r

. tsline time
time variable not set, use tsset varname ...
r(111);

. tsset time
time variable: time, 1 to 111
delta: 1 unit

. tsline r
Residuals Residuals
-200 -100 0 100 200 300 -10 -5 0 5 10

0
0

50
50

time
time

100
100
To determine if there is residual autocorrelation in the regression model of General Electric stock
(General_Electric) against the S&P 500 index (S_and_P), we need to plot the residuals against
time. Residual autocorrelation occurs when the residuals of a regression model are correlated
with each other over time, indicating that there may be some pattern or structure left unexplained
by the model.

In this case, if the plot of residuals against time shows a clear pattern or trend, such as systematic
oscillations or clustering of points, it may suggest the presence of residual autocorrelation. On
the other hand, if the plot appears random with no discernible pattern, it indicates that the
residuals are independent and do not exhibit autocorrelation.
c) Test for the presence of serial correlation using the Breusch-Godfrey Serial Correlation LM Test with
two lags (the default in STATA). Also plot the partial autocorrelation function (PACF) of the OLS residuals
and determine the order of autocorrelation.

. estat bgodfrey,lag(2)

Breusch-Godfrey LM test for autocorrelation

lags(p) chi2 df Prob > chi2

2 104.636 2 0.0000

H0: no serial correlation


1.00
Autocorrelations of residual
-0.50 0.00 0.50
-1.00

0 10 20 30 40
Lag
Bartlett's formula for MA(q) 95% confidence bands

The output provided shows the results of a regression analysis between General Electric
(General_Electric) and S&P 500 index (S_and_P). The model indicates that there is a significant
relationship between General Electric and the S&P 500 index, as evidenced by the low p-value
(0.000) for S_and_P coefficient.

The Breusch-Godfrey Serial Correlation LM Test with two lags is used to check for
autocorrelation in the residuals of a regression model. If there is significant autocorrelation, it
suggests that there is a pattern in the residuals that is not explained by the model.

In this case, to conduct the Breusch-Godfrey Serial Correlation LM Test with two lags:
1.00
Partial autocorrelations of uhat
0.00 -0.50 0.50

0 10 20 30 40
Lag
95% Confidence bands [se = 1/sqrt(n)]

d) If the disturbances are auto correlated, apply the Cochrane-Orcutt transformation and re-estimate
the model.

. corc General_Electric S_and_P


Iteration 0: rho = 0.0000
Iteration 1: rho = 0.9834

(Cochrane-Orcutt regression)

Source SS df MS Number of obs = 110


F(1, 108) = 105.12
Model 96.8865236 1 96.8865236 Prob > F = 0.0000
Residual 99.5430918 108 .921695294 R-squared = 0.4932
Adj R-squared = 0.4885
Total 196.429615 109 1.80210656 Root MSE = .96005

General_El~c Coef. Std. Err. t P>|t| [95% Conf. Interval]

S_and_P .0189382 .0018471 10.25 0.000 .0152772 .0225992


_inter -7.652901 6.143068 -1.25 0.216 -19.82826 4.522461

rho 0.9828 0.0125 78.86 0.000 0.9581 1.0075

Durbin-Watson statistic (original) 0.047999


Durbin-Watson statistic (transformed) 2.001660
. reg General_Electric S_and_P

Source SS df MS Number of obs = 111


F(1, 109) = 92.66
Model 1896.50024 1 1896.50024 Prob > F = 0.0000
Residual 2230.84203 109 20.4664406 R-squared = 0.4595
Adj R-squared = 0.4545
Total 4127.34227 110 37.5212933 Root MSE = 4.524

General_El~c Coef. Std. Err. t P>|t| [95% Conf. Interval]

S_and_P .0234734 .0024385 9.63 0.000 .0186404 .0283064


_cons -7.623774 3.067215 -2.49 0.014 -13.70289 -1.544654

. predict uhat, residual

. br

. graph save Graph "C:\Users\Gech\Desktop\Graph 4.gph"


(file C:\Users\Gech\Desktop\Graph 4.gph saved)

. tsline uhat

. tsline uhat if e(sample)==1,yline(0)

. graph save Graph "C:\Users\Gech\Desktop\Graph 5.gph"


(file C:\Users\Gech\Desktop\Graph 5.gph saved)

. estat dwatson

Durbin-Watson d-statistic( 2, 111) = .0479987

. estate bgodfrey, lag(2)


command estate is unrecognized
r(199);

. estat bgodfrey, lag(2)

Breusch-Godfrey LM test for autocorrelation

You might also like