EViews
EViews
EViews
LOAD DATA
• Click on EViews icon.
• Click on File, New, Workfile.
• In the dialog box specify annual data, and put 1871 2000 in the boxes for
beginning and end.
• The file is Shiller.xls in G:ems data; eviews courses is also on Ron Smith’s
home page.
• You will then get a box with two variables, C for the constant and Resid for
the residuals.
• Choose File, Import, Read Text Lotus Excel.
In the dialog box where it asks for Names or numbers type 5, and OK. Notice that it
will start reading data at B2. This is correct, column A has years, which it already
knows and row 1 has names, which it will read as names
Five Variables will appear in the box. These are US data for
ND nominal dividends for the year
NE nominal earnings for the year
NSP nominal standard and poors stock price index, January value
PPI producer price index, January Value
R average interest rate for the year
Highlight ND and NE in the box. Click Quick, Graph, Line Graph, OK the two
variables and you will get a graph of dividends and earnings. After looking at it, close
it and delete it. You could save it if you want.
Dependent Variable: ND
Method: Least Squares
Date: 11/05/04 Time: 15:21
Sample(adjusted): 1871 1999
Included observations: 129 after adjusting endpoints
Variable Coefficient Std. Error t-Statistic Prob.
C 0.336833 0.089865 3.748188 0.0003
NE 0.421626 0.008437 49.97162 0.0000
R-squared 0.951604 Mean dependent var 2.611163
Adjusted R -squared 0.951223 S.D. dependent var 3.984932
S.E. of regression 0.880097 Akaike info criterion 2.597813
Sum squared resid 98.37048 Schwarz criterion 2.642151
Log likelihood -165.5590 F-statistic 2497.163
Durbin-Watson stat 0.533942 Prob(F-statistic) 0.000000
On the equation Window click View. Then click Actual, Fitted Residual and then
Actual, Fitted Residual Graph. These do not look like random residuals. The Durbin-
Watson shows severe serial correlation. Close the equation and delete.
This estimates
d t = α 0 + β0 et + β1et −1 + α1d t −1 + γ t + ut
Click View, Actual Fitted Residual Graph. This looks better than before, but
there are still some outliers.
Click View on the equation box, choose Residual Tests, Serial Correlation LM
tests, and accept the default number of lags to include 2. You will get the LM serial
correlation test. Note that neither lagged residual is individually significant (t value
less than 2, p value >0.05) nor are they jointly significant F stat p value is 0.19. So we
do not have a serial correlation problem with this equation. On diagnostic tests, the
null hypothesis is that they are well specified, p values below 0.05 indicate that there
is a problem.
Click View, Residual tests, histogram- normality test. You will get the
histogram and in bottom right the JB test of 56.59 and a p value of 0.0000. There is
clearly a failure of normality, caused by the outliers.
Click View, residual, White Heteroskedasticity (no cross terms) p value is
0.24977, so no indication of heteroskedasticity.
Click View, coefficient tests, redundant variables, enter
LNE(-1) @trend
OK, you will get
Test Equation:
Dependent Variable: LND
Method: Least Squares
Date: 11/12/04 Time: 14:52
Sample: 1872 1999
Included observations: 128
The F stat has a p value of 0.227, so the two variables are jointly insignificant, as
well as being individually insignificant in the previous regression, so we can drop
them. This equation estimates
d t = θ 0 + θ1et
*
∆dt = λ (d t − d t −1 ) + ε t
*
d t = λθ 0 + λθ1et + (1 − λ ) dt −1 + ε t
So the implied estimate of λ = 1 − 0.670366 = 0.329634 and of
θ1 = 0.301918/0.329634 = 0.915919 . Rather than working them out directly we can
use EViews non-linear options to get them directly.
D(lnd)=c(1)*(c(2)+c(3)*lne-lnd(-1))
The D(…) first differences the data. This estimates the partial adjustment model
giving estimates of the long-run parameters and speed of adjustment directly:
∆dt = λ (θ0 + θ1et −dt −1 ) + ut
You might get results almost identical to those above
Notice the R squared is lower because here we are explaining the change in log
dividends (the growth rate of dividends) not the level of log dividends. The long-run
elasticity of dividends to earnings is 0.91 and significantly different from unity, the
speed of adjustment is 33% a year. Notice that this is the same equation as we had
above, with exactly the same standard error of regression.
MULTIPLE MAXIMA
However, you might get
This is clearly rubbish. What has happened is that the likelihood function has multiple
maxima and when the starting values are set at c(1)=0 c(2)=0 c(3)=0, it goes to this
local maximum. To get the global maximum we need to set other starting values. The
minimum is quite close to zero, so even starting the coefficients a little bit positive
will solve the problem. To do this type
param c(1) 0.05 c(2) 0.0 c(3) 0.05
in the command window at the top under the toolbar. With these starting values it will
get to the global maximum. When doing non-linear estimation, try to start with
sensible starting values, using the economic interpretation or preliminary OLS
regressions to give you sensible values.
ESTIMATE AN ARIMA(1,1,1)
Estimate an ARIMA(1,1,1) model for log stock prices.
Click quick, estimate equation, set the sample to 1871 1990 and type in
D(LNSP) C AR(1) MA(1)
Notice that both the AR (t=-3.06) and MA (t=5.50) terms are significant. Click
forecast on the equation box. Set the forecast period to 1990 2000 look at the graph. It
will save the forecast as LNSPF. Close the equation and graph LNSP and LNSPF.
This is clearly a terrible forecast, you will see that the actual and predicted steadily
diverge over the 1990s.
Click OK and you will get the output below. The coefficient on inflation in the cointegrating
vector is almost exactly –1 as it should be (I chose a sample that gave a nice result), and we
cannot reject the hypothesis that the coefficient is 1; t= (1.04-1)/0.32=0.125. From the View,
Representations option you can find out that the long-run real interest rate is 2.76. Below the
cointegrating equation are given the equation for the change in interest rate (first column) and
change in inflation rate (second column). The adjustment coefficient on CointEq1 for the
interest rate is negative as it should be and quite rapid 21% a year, the adjustment coefficient
on inflation is positive, as it should be, but quite small 5% a year, and insignificant. All the
adjustment is being done by interest rates. Lagged inflation is insignificant in the interest rate
equation, but lagged interest rates are significant.
INF(-1) -1.040971
(0.32255)
[-3.22729]
C -2.765076
C 0.109011 0.136277
(0.24247) (0.66912)
[ 0.44959] [ 0.20367]
R INF
-0.300688 0.313007
0.221839 0.137724
Click View Cointegration Graph and it will plot the cointegration relation or error, the deviation
of the real interest rate from its long-run value. There are long-periods away from equilibrium,
which is why we get little evidence of cointegration.
Click View, lag structure, Granger Causality, you will get the output below, which shows that
inflation is not Granger Causal for interest rates, but interest rates is Granger Causal for
inflation. The null hypothesis is that the coefficients are zero, No Granger Causality.