A Guide To Eviews: Danijela Markovic
A Guide To Eviews: Danijela Markovic
Universität
zu Berlin
Danijela Markovic
A guide to
EViews
Based on a Practical Guide by R. R. Johnson
Professor of Economics, The University of San Diego
WS 2002/2003
A Guide to EViews 2
C ontents
WS 2002/2003
A Guide to EViews 3
In this section:
Data set:
If data sets are not in EViews data format, you’ll need to create an EViews workfile
and to either enter or import the data into the created workfile.
WS 2002/2003
A Guide to EViews 4
To enter the per capita disposable income in year t into the newly created workfile
follow the steps bellow:
Select Object/New Objects/Series from the main menu or the workfile menu,
enter I in the Name for Object and click OK. All of the observations in the series
will be assigned to the missing value code ‘NA’.
To enter the data, double click on the name of the series (I) and click edit+/- on
the series window menu bar. The numbers can be entered into the table to
replace NA’s pressing Enter after each entry. After the changes are done, click
edit +/- on the series window menu bar to save the changes and exit the edit
function. The series window can be closed by clicking the U button in the upper
right corner of the series window.
Select the file location, select Excel (*.xls) for the file type and click Open.
Fill in Upper
left data cell A2
(this is the location
of the first data),
and in the field
Names for series
or Number.. enter
either b P, or 2.
Note that when
you enter the
number of the
series, EViews will
enter the names of
the series that are
printed in the row
above each data
series.
Click OK to
complete the
import process.
WS 2002/2003
A Guide to EViews 5
The data on the per capita disposable income are given in thousands of dollars. Let’s
assume that from the some reason it would be better if these data re in dollars. The
new variable which we will name I1 will be therefore 1000 I.
To generate I1, click Genr on the workfile menu and enter the formula:
I1=I*1000
Click OK and the new variable named I1 will appear in the workfile window.
EViews provides specialised tools for working with group of variables. Follow these
steps to create a group object containing the data on the per capita disposable
income-I1, per capita consumption of beef-B and the price of beef-P:
To create a group object for the I1, B and P data, hold down Ctrl button and click
on each of these variable names and then select Show from the workfile toolbar.
To name a group, click Name or Object/Name on the group menu bar and then
enter BI1P in the name to identify object-window.
To save the changes in your workfile, click Save on the workfile menu bar.
WS 2002/2003
A Guide to EViews 6
Enter the name of the equation- eq1 in the Name for Object-window and click OK.
Enter the
dependant
variable (B-
consumption of
beef), the
constant( C ) ,
and the
independent
variables (P-price
of beef, I1- the
income) in the
Equation
specification. It
is important to
enter the
dependant
variable first!
Select the estimation Method: LS – Least Squares (NLS and ARMA) and click OK to
view the EViews Least Squares regression output table:
WS 2002/2003
A Guide to EViews 7
Coefficient- the estimated coefficients. The least squares regression coefficients are computed by
the standard OLS formula
Standard Error - reports the estimated standard errors of the coefficient estimates. The standard
errors measure the statistical reliability of the coefficient estimates-the larger the standard
errors, the more statistical noise in the estimates. The standard errors of the estimated
coefficients are the square roots of the diagonal elements of the coefficient covariance matrix.
You can view the whole covariance matrix by choosing View/Covariance Matrix.
t-Statistics- the ratio of an estimated coefficient to its standard error, is used to test the
hypothesis that a coefficient is equal to zero. To interpret the t-statistic, you should examine
the probability of observing the t-statistic given that the coefficient is equal to zero.
Probability- the probability of drawing a t-statistic as extreme as the one actually observed, under
the assumption that the errors are normally distributed, or that the estimated coefficients are
asymptotically normally distributed. Given a p-value, you can tell at a glance if you reject or
accept the hypothesis that the true coefficient is zero against a two-sided alternative that it
differs from zero. For example, if you are performing the test at the 5% significance level, a p
value lower than 0.05 is taken as evidence to reject the null hypothesis of a zero coefficient. If
you want to conduct a one-sided test, the appropriate probability is one-half that reported by
EViews.
Summary Statistics
R-squared- measures the success of the regression in predicting the values of the dependent
variable within the sample. In standard settings, may be interpreted as the fraction of the
variance of the dependent variable explained by the independent variables. The statistic will
equal one if the regression fits perfectly, and zero if it fits no better than the simple mean of
the dependent variable. It can be negative for a number of reasons.
Adjusted R-squared- penalises the for the addition of repressors which do not contribute to the
explanatory power of the model. The R2 is never larger than the , can decrease as you add
repressors, and for poorly fitting models, may be negative.
Standard Error of the Regression- a summary measure based on the estimated variance of the
residuals.
Log Likelihood- the value of the log likelihood function (assuming normally distributed errors)
evaluated at the estimated values of the coefficients.
Durbin-Watson Statistic- measures the serial correlation in the residuals. As a rule of thumb, if
the DW is less than 2, there is evidence of positive serial correlation. The DW statistic in our
output is very close to one, indicating the presence of serial correlation in the residuals.
There are better tests for serial correlation. In Testing for Serial Correlation, we discuss the Q-
statistic, and the Breusch-Godfrey LM test, both of which provide a more general testing
framework than the Durbin-Watson test.
Akaike Information Criterion- often used in model selection for non-nested alternatives-smaller
values of the AIC are preferred.
Shwarz Criterion- an alternative to the AIC that imposes a larger penalty for additional
coefficients
F-Statistic- from a test of the hypothesis that of the slope coefficients (excluding the constant, or
intercept) in a regression are zero.
Prob(F-statistic)- is the marginal significance level of the F-est. If the p-value is less than the
significance level you are testing, say 0.05, you reject the null hypothesis that all slope
coefficients are equal to zero.
WS 2002/2003
A Guide to EViews 8
In this section:
Data set:
The goal is to determine the best location for the next Denny’s restaurant, where
Denny’s is a 24-h family restaurant chain. This can be achieved by building a
regression model to explain gross sales a s a function of location. With the given
model, building and location costs, the owners of Denny’s should be able to make a
decision.
Create an EViews group for Denny’s restaurant data (hold down Ctrl button, click
on Y, N, P and I, select Show from the workfile toolbar and click OK) . Name the
data group “denny”.
To save the table, click Freeze on the group menu bar and define the name for
created object by clicking Name on the window menu bar.
WS 2002/2003
A Guide to EViews 9
with those from the normal distribution. Under the null hypothesis of a normal
distribution, the Jarque-Bera statistic is distributed as with 2 degrees of freedom.
Probability is the probability that Jarque-Bera statistic exceeds (in absolute value)
the observed value under the null hypothesis of a normal distribution.
Open the group created in previous section (“denny”) by double clicking the
name of the group in the workfile menu.
To save the results click click Freeze on the group menu bar and define the name
for created object by clicking Name on the window menu bar.
WS 2002/2003
A Guide to EViews 10
Select Procs/Make Equation on the group menu bar. EViews will automatically
choose the first variable from the group as dependant variable and others as
independent. You can change this by respecification of variables. After choosing
Estimation settings click OK.
To name the equation click Name on the equation menu bar, enter the name and
click OK.
Get the equation window open (click two times on the name of the equation in
the workfile menu)
Estimation Command:
=====================
LS Y P N I C
Estimation Equation:
=====================
Y = C(1)*P + C(2)*N + C(3)*I + C(4)
Substituted Coefficients:
=====================
Y = 0.3546683674*P - 9074.674399*N + 1.287923391*I + 102192.4277
WS 2002/2003
A Guide to EViews 11
For getting tabular or graphical interpretation of results you would need first to
have equation window open
For displaying the table of the actual, fitted and residuals for a regression click
View/Actual,Fitted,Residual/Actual,Fitted,Residual Table and you should
get something like the figure below:
For displaying a graph of the actual, fitted and residuals for a regression click
View/Actual,Fitted,Residual/Actual,Fitted,Residual Graph
WS 2002/2003
A Guide to EViews 12
Hypothesis testing
In this section:
Data set:
Before performing above named procedures, it is advisable to create one table for
storing all results.
To compute the two tailed critical t-value for the 5% significance level and to
assign this result to the first cell of the table hypothesis_testing type the following
command in the command window and press Enter:
hypothesis_testing (1,1)=@qtdist(.975,(eq01.@regobs-eq01.@ncoef))
To compute the one tailed critical t-value for the 5% significance level and to
assign this result to the second cell of the table hypothesis_testing type the
following command in the command window and press Enter:
hypothesis_testing (2,1)=@qtdist(.95,(eq01.@regobs-eq01.@ncoef))
WS 2002/2003
A Guide to EViews 13
It is advisable to put a description of the result in the cell next to the result. To do
this, have in mind that for the table cells, matrix notation is valid and type each
text within quotation marks (“ ”). For example, to print the description of the first
calculated variable type the following in the command window and press Enter:
Note that when you have one command in the command window, the next one you don’t have to
really type but to simple correct the existing one and than to press Enter.
To calculate the lower value for the 90% confidence interval for the
population coefficient (the first independent variable in our eq01 listing) and to
assign the result to the third cell of the table hypothesis_testing enter the
following command in the command window and press Enter:
hypothesis_testing (3,1)=eq01.@coefs(1)-(@qtdist(.95,(eq01.@regobs-eq01.@ncoef)))*eq01.@stderrs(1)
To calculate the upper value for the 90% confidence interval for the
population coefficient (the first independent variable in our eq01 listing) and to
assign the result to the fourth cell of the table hypothesis_testing enter the
following command in the command window and press Enter:
hypothesis_testing (4,1)=eq01.@coefs(1)+(@qtdist(.95,(eq01.@regobs-eq01.@ncoef)))*eq01.@stderrs(1)
To calculate the simple correlation coefficient and to assign it to the fifth cell
of the table hypothesis_testing, type the following in the command window and
press Enter.
hypothesis_testing (5,1)=@cor(y,p)
To convert the simple correlation coefficient between Y and P into a t-value and to
store it into a table hypothesis_testing type the following in the command window
and press Enter:
hypothesis_testing (6,1)=(@cor(y,p)*((@obs(y)-2)^.5))/((1-@cor(y,p)^2)^.5)
To calculate the critical t-value for the t-distribution with N-2 degrees of freedom
(N is the number of observations) and to store it in the seventh cell of the table
type the following in the command window and press Enter:
hypothesis_testing (7,1)=@qtdist(.975,(@obs(y)-2))
WS 2002/2003
A Guide to EViews 14
The F-statistics test the hypothesis that all of the slope coefficients excluding the
constant are zero. The null hypothesis can be rejected if the calculated F-statistics
exceeds the critical F-value at a chosen significance level.
To calculate the F-statistic for the Denny’s restaurant data and to store result in
row eight of the table hypothesis_testing type the following into the command
window and press Enter:
hypothesis_testing (8,1)=eq01.@f
To calculate the 5% critical F-value for the Denny’s restaurant data and to store result
in row nine of the table hypothesis_testing type the following into the command
window and press Enter:
hypothesis_testing (9,1)=@qfdist(.95,eq01.@ncoef-1,eq01.@regobs-eq01.@ncoef)
If you have successfully completed steps from the previous section you should have a
table hypothesis_testing with all results and the description of results. You noticed probably that
the table cells are to narrow to give a nice results visualisation. To change the table options try the
buttons from the table window menu (Font, InsDel,Width…). Your table should contain the
following results:
WS 2002/2003
A Guide to EViews 15
In this section:
Data set:
Hold Ctrl and select PCON, REG, TAX. (Pay always attention that the first
selected variable is the dependant variable. Order of the successive variables is
not important.) The fastest way now to estimate the model is to press the
right mouse button, select Open/As Equation and press Enter.
WS 2002/2003
A Guide to EViews 16
To have this figure saved you should first press Freeze on the graph window.
Then you can name it by pressing Name.
1200
800
400
-400
-800
5 10 15 20 25 30 35 40 45 50
PCON Residuals
Select Objects/New Object/Equation on the workfile menu bar, type for the
equation name Autocorr, in the Equation specification window enter Errors C
Errors (-1) and press Enter. You should get this as an output:
WS 2002/2003
A Guide to EViews 17
To make a simple scatter graph of an error against REG hold Ctrl and select first
REG and than error from the EViews workfile. Press right mouse button and
select Open/As Group. From the group window menu select
View/Graph/Scatter/simple Scatter. To save the figure use the previous
explanations (Freeze and than Name). For crating graph of error against TAX use
the same procedure by replacing REG with TAX.
1200 1200
800 800
400 400
ERRORS
0 ERRORS 0
-4 0 0 -4 0 0
-8 0 0 -8 0 0
0 5000 10000 15000 20000 4 6 8 10 12 14 16
REG TA X
The critical 5% χ2
value can be
calculated by typing
the following formula
in EViews command window:
WS 2002/2003
A Guide to EViews 18
=@qchisq(.95,5)
Scalar=11.0704976935.
Since the White test statistic has a value of 33.22564 what is greater than the 5%
critical χ2 value we can reject the null hypothesis that there is no heteroscedasticity.
Select Objects/New
Object/Equation on the
workfile menu bar and name
the equation WLS. Enter
PCON REG TAX C in the
equation specification window
and select the Options
button.
WS 2002/2003
A Guide to EViews 19
Select Objects/New Object/Equation on the workfile menu bar and name the
equation HCSE. Enter PCON REG TAX C in the equation specification window and
select the Options button.
Check the
Heteroscedasticity
Consistent Coefficient
Covariances box and
select White option.
Now you can estimate
the equation by
pressing OK in the
Equation specification
window.
WS 2002/2003