Ecomtrics Assigmnt and Answers
Ecomtrics Assigmnt and Answers
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
. 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
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:
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.
. 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)
2 104.636 2 0.0000
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.
(Cochrane-Orcutt regression)
. br
. tsline uhat
. estat dwatson