ECON 140 - Econometrics
WINTER 2000
Professor Oscar Jorda
User’s Guide to Using EViews
This is a quick reference guide to the most important EViews commands
that you will need for the class. The manuals are available in the "help"
option of the main menu of EViews. There will be a copy of the manuals
available for consultation in the computer room. In addition, you have
the option to purchase the student version of EViews which includes the
manuals. A good introduction to EViews fundamentals can be found at http://faculty.washington.edu/ezivot/eviews.htm
. I highly recommended it if you feel you need additional help.
-
Getting Started
To begin a project you need to create a "workfile" to store all your work
(series, graphs, equations, etc.). Create a new workfile by clicking File/New/Workfile
and provide the necessary information in the dialog that appears:
-
Click the appropriate frequency (annual, monthly, …, undated)
-
Enter the Start Date
-
Enter the End Date
-
Click OK
Now you can fill your workfile with "objects" such as series, equations,
graphs, etc.
-
Creating Objects
If you want to enter data by hand:
-
Click Quick/Empty Group(Edit Series)
-
A Spreadsheet window will open
-
Type in the data
-
Rename the series with mnemonics (like "unem" for unemployment rate rather
than having "SER1")
-
When you are done close the window and the series will appear in the workfile
window.
-
To be on the safe side, save your workfile by clicking on Save in
the workfile menu and follow instructions.
If you want to import data from an external file:
EViews can handle text files, excel files and lotus files.
-
In the workfile window click Procs/Import Data…
-
Locate the file that contains the data you wish to import
-
In the next dialog box, specify whether your data is in columns or rows
and give a name to each series in the file from which you are importing.
-
Elementary Statistics
The first step is to take a look at the data by graphing it and inspecting
the basic statistics associated with it.
-
Graphs
Select the series that you wish to graph by highlighting them with the
mouse. You may want to have individual graphs for each series or have two
or more series into one graph. For this example, suppose you want to inspect
two series.
-
Select the two series you want to graph and double click.
-
Click Open Group
-
In the group window click View/Graph
-
You will see a graph of both series. You can change the appearance by double
clicking in the graph itself. However, if you want to do extensive manipulations
(adding titles, shading, etc.) and save it as an object, then you should
click Freeze in the group window.
-
Double clicking on the graph opens a dialog box that allows you to make
extensive changes to the graph. In addition you can click on AddText
and AddShade to add titles, subtitles, etc in the graph.
-
Once you have modified the graph to your liking, save it by clicking on
Name
in the "graph" window.
-
You can always click on the different objects inside the graph and modify
their position or appearance by double clicking on them and following the
instructions.
-
Combining graphs is also possible. From the workfile menu select the "graphs"
objects that you wish to combine and double click. This will create a new
graph that combines the ones you selected and allows you to make modifications
and to save it as a different graph object altogether.
-
Elementary Statistics
-
Select the series that you wish to analyze and double click on them.
-
Select Open Group
-
In the "group window" select Descriptive Stats/Common Sample
-
You will get a spreadsheet with the statistics corresponding to each series
-
To get the variance and covariances of the series change the View of the
group window to View/Covariances
-
To view the correlation matrix change the View of the group window to View/Correlations
-
If you want the descriptive statistics of one series, select the series,
double click on it and select View/Histogram and Stats
-
If you need to modify the series with a mathematical formula you can use
the command window and type genr newseries = mathematical
formula (old series) and then hit enter. For example genr log_unem
= log(unem). Another example genr unem2 = unem^2 (this calculates
the square of the series unem). The new series automatically appears in
the workfile as a new series object.
-
EViews has a built in calculator. Any calculation can be accomplished by
typing =math formula in the command window. For example, to calculate
the square of 23 simply type =23^2 in the command window and hit
enter. The result will appear at the bottom of the workfile window.
-
For a list of operators and formulas available look in the help menu.
-
A clever way to store computations that you might need later on is the
following. Create a new object by clicking Objects/NewObject/Matrix-Vector-Coeff,
from the main menu. In the next dialog window choose Coefficient Vector
and choose enough rows not to run out of space. This will create a coefficient
vector which you can call result. For example, suppose that you
want to run a chi-squared test on the value of the variance, the hypothesis
being that it equals 0.4. Compute the statistic by typing in the command
window: genr result(1) = @obs(unem)*@var(unem)/0.4. This has the
following effect. @obs simply counts the number of observations
of the variable in brackets; @var calculates the variance; result(1)
is where you store the result of this computation, i.e. the first row of
the vector results. Next you can compute the chi-squared test by
typing: genr result(2) = @chisq(result(1), 9). The function
@chisq
computes the p-value of the first argument in parentheses with degrees
of freedom given by the second argument. The value will appear in the second
row of the vector results.
ECON 140 - Econometrics
WINTER 2000
Professor Oscar Jorda
User’s Guide to Using EViews – Part II
Here are some useful tips on regression analysis and new procedures
that are now available with the new version of EViews (3.0)
Data Management
EViews has improved the way you can import data from outside files.
Importing series from ASCII files has become easier. I encourage you to
explore the options by looking into the manuals or in the help menu, particularly
if you are working in other projects outside class.
Interesting Web sites
The Web provides an enormous amount of information that is very easy
to manipulate to load into EViews. The Library of the University of Michigan
offers a particularly good service. They organize the information by topics
and provide direct links to the original sources of data. They also provide
a brief explanation of what you will find in each site. The address is:
http://www.lib.umich.edu/libhome/Documents.center/stats.html
For economic data, the Federal Reserve Bank of St. Louis has a useful
site:
http://www.stls.frb.org/fred/
Other sites are listed in the courses main web page.
Hypothesis Testing on the Mean, Variance and Median
EViews 3.0 now allows you to directly test hypotheses regarding the
moments of a given sample. When you select a series, click View/Test
for Descriptive Stats/Simple Hypothesis Tests. You will get a dialog
box titled Series Distribution Tests with the option to provide
different values for the mean, variance and median that you would like
to test for. For example, if I want to test the null hypothesis that the
mean is 3, all you have to do is enter that value in the window titled
Mean
and hit OK. The test will provide the t-statistic and the p-value.
Regression analysis
The easiest way is to click on Quick/Estimate Equation in the
main menu. A dialog window will open. All you have to do is type in the
name of the dependant variable first, followed by "c" (to include a constant
in the regression if you wish) and the names of the explanatory variables,
all separated by a space. Hit OK and you will obtain the result.
Alternatively, you could have typed: LS Y C X1 X2 in the command
window and then hit enter. LS stands for "Least Squares", Y is the dependant
variable and X1 and X2 the independent variables in this example. Of course,
the names of the variables Y, X1, X2 will be different in your workfile
(they might be, for example, GDP, UNEM, INF)
Transformations of variables
The easiest method is using the command window. Suppose that I want
to create a new variable, say X2, which is the square of variable X. In
the command window type: genr X2 = X^2. This will create the new
variable X2.
Useful commands: + (add), - (subtract), * (multiply),
/
(divide), ^ (raise to the power), log(X) (take the log X)