Eviews - Introduction
Eviews - Introduction
Statistical and
Econometric Software
School of Statistics
University of the Philippines Diliman
What is EViews?
and,
Title bar
Dropdown
menu
A grayed-out
command means the
command is not
currently available.
An ellipse ()
following the command
means that a dialog
box (prompting you for
additional input) will
appear before the
command is executed.
4
Dropdown
menu
A check mark ()
indicates that the
option listed in the
menu is currently in
effect.
Most menu items
contain underlined
characters representing
keyboard shortcuts
5
EViews commands
may be typed in the
command window.
The command is
executed as soon as
you hit enter.
Status line
8
EViews
2. Workfile Basics
What is a workfile?
Most of the work in EViews will involve
objects that are contained in a workfile, so
the first step in any project will be to create
a new workfile or to load an existing
workfile into memory.
Workfiles hold a variety of EViews objects,
such as equations, graphs, and matrices.
10
What is a workfile?
Creating a workfile
2.
12
To create a new
workfile,
STEP 1: Select
File/New/Workfile
from the main menu
to open the Workfile
Create dialog.
13
Unstructured/ Undated:
2.
Dated-regular frequency:
14
2.
3.
4.
15
16
17
Importing data
Entering data
For small datasets in printed form, you may wish
to enter the data by typing at the keyboard.
STEP 1: To open a temporary spreadsheet
window in which you will enter the data, choose
Quick/Empty Group (Edit Series) from the main
menu.
STEP 2: Do the following steps:
18
Importing data
Entering data
19
Importing data
Entering data
STEP 3: If you are done typing the data,
name the untitled group by clicking the
Name button.
20
10
Importing data
Copy-and-pasting
Useful for small datasets and other software applications
(ex. Excel)
STEP 1: Highlight and copy the cells (including the
variable headings/names) to be imported into EViews.
STEP 2: In EViews, create or load a workfile and choose
Quick/Empty Group (Edit Series) from the main menu.
STEP 3: Place the cursor and click the upper-left cell just
to the right of the second obs label.
STEP 4: Select Edit/Paste from the main menu (or
simply use the right mouse click to paste).
21
Importing data
Importing data from a spreadsheet or text file
STEP 1: Make sure you have an open workfile
and that the workfile window is active.
STEP 2: Click on Proc/Import/Read Text-LotusExcel You will see a standard File Open dialog
box. Select a file type and file name.
STEP 3: Click OK. EViews fill open a dialog
prompting you for additional information about
the import procedure.
22
11
Importing data
Importing data from a spreadsheet or text file
(spreadsheet import)
23
Importing data
Importing data from a spreadsheet or text file
(ASCII text files import)
24
12
25
26
13
27
The sample
displays the range of
observations that are
to be used in
calculations and
statistical operations.
Just click sample
to change the range
of observations you
want to use.
28
14
Workfile
directory
Click to scroll
page tabs
30
15
Saving a workfile
To save your workfile, push the SAVE
button on the workfile toolbar.
You can also save a file using the
File/Save As or File/Save choices
from the main menu.
31
Single
32
16
Use compression
Choosing
33
34
17
EViews
3. Object Basics
What is an object?
Information in EViews is stored in objects.
Each object consists of a collection of
information related to a particular area of
analysis.
Associated with each type of object is a
set of views and procedures which can be
used with the information contained in the
object.
36
18
What is an object?
OBJECTS
37
Object types
38
19
39
20
Creating objects
STEP
42
21
22
Workfile titlebar
(inactive)
Equation titlebar
(active)
Equation
window toolbar
Workfile
window
Equation
window
45
View
Lets
Proc
Provides
Object
Lets
46
23
Print
Lets
Name
Allows
Freeze
Creates
Naming objects
24
Naming objects
STEP
Labeling objects
EViews
50
25
Labeling objects
STEP
Copy-and-pasting objects
Copying
26
Copy-and-pasting objects
STEP
53
Freezing objects
The
27
Deleting objects
STEP
Printing objects
28
EViews
4. Basic Data Handling
29
Data objects
Series
60
30
Series
Creating a series
STEP
Series
Creating a series
You
62
31
Series
Changing the spreadsheet display
Column widths
To
63
Series
Changing the spreadsheet
display
Display type
32
Series
Changing the spreadsheet
display
Display formats
You
Series
Changing the spreadsheet display
Narrow versus Wide
The
66
33
Series
Changing the spreadsheet display
Narrow versus Wide
Wide
display
67
Series
Changing the
spreadsheet display
Narrow versus Wide
To
34
Series
Changing the spreadsheet display
Sample subset display
By
69
Series
Editing a series
STEP 1: Open the spreadsheet view of the series.
STEP 2: Make certain that the spreadsheet window is in
edit mode. Use the Edit +/- button on the toolbar to
toggle between edit mode and protected mode.
STEP 3: To change a value for an observation, select
the cell, type in the value, and press ENTER.
Note: When editing series values, you should pay
particular attention to the series display format, which
tells you the units in which your series are displayed.
70
35
Series
Editing a series
STEP 4: When you have finished editing,
you should protect yourself from
inadvertently changing values of your data
by clicking on Edit +/- to turn off edit mode.
71
Series
Inserting and deleting observations in a series
STEP 1: Open the spreadsheet view of the
series and make certain that the spreadsheet
window is in edit mode.
STEP 2: Click on the cell where you want the
new observation to appear.
STEP 3: Right click and select InsDel. You will
see a dialog asking how many observations you
wish to insert or delete at the current position
and whether you wish to insert observations in
the selected series or in all of the series in the
group.
72
36
Series
Sorting a series
From the spreadsheet view of a series,
you can sort by pressing the Sort button
on the button bar or by pressing the rightmouse button and selecting Sort.
73
Groups
37
Groups
Creating groups
STEP 1: In the main menu, select Object/New Object
STEP 2: Select Group. You may, at this time, provide a
name for the group.
STEP 3: Enter the names of the series to be included in
the group, separated by spaces.
Note that a group may be included to be a part of a
group. Series expressions (mathematical expressions
that may involve one or more series) may also be added
in a group.
STEP 4: Click OK. A group window will open showing a
spreadsheet view of the group.
75
Groups
Creating groups
Alternatively, you can also create groups
by:
Selecting
76
38
Groups
Editing in a group
STEP 1: Open the group window and make certain that
the group spreadsheet is in protected mode.
STEP 2: To change a value for an observation, select
the cell, type in the value, and press ENTER.
Note: Since groups are simply references to series,
editing the series within a group changes the values in
the original series.
Note: As with series spreadsheet views, you may click
Smpl +/- to toggle between showing all the observations
in the workfile and showing only those observations in
the current sample.
77
Samples
The sample is the set (often a subset) of
observations in the workfile to be included
in the data display and in performing
statistical procedures.
Samples may be specified using ranges of
observations (usually for time series) and
if conditions that observations must
satisfy to be included.
78
39
Samples
The workfile sample
When you create a workfile, the workfile sample
or global sample is set initially to be the entire
range of the workfile.
It tells EViews what set of observations you wish
to use for subsequent operations.
You can always determine the current workfile
sample of observations by looking at the top of
your workfile window.
79
Samples
Changing the sample
There are 4 ways to set the workfile sample:
Clicking
80
40
Samples
Changing the sample
If you use one of the first 3
options, EViews will open the
Sample dialog box.
From the Sample dialog, you will
be asked to specify a range
and/or an if condition.
In the example, typing 1 50 as the
sample range pair means that
observations 1 to 50 will be your
sample while observations 51
and above will excluded.
81
Samples
Changing the sample
EViews provides special keywords that
may make entering sample date pairs
easier.
the entire workfile range;
@first first observation;
@last last observation.
@all
82
41
Samples
Changing the sample
In the box for specifying the if conditions, operators may be used to allow
for the construction of more complex expressions.
Operators include (but are not limited to):
Expression
+
*
/
^
>
<
=
<>
<=
>=
and
or
Operator
add
subtract
multiply
divide
raise to the power
greater than
less than
equal to
not equal to
less than or equal to
greater than or equal to
logical and
logical or
83
Samples
Changing the sample
You may find it easier to set your workfile
sample from the command window using
the smpl command.
STEP 1:In the command window just type:
Smpl start_obs end_obs if if_command
STEP 2: Press enter.
84
42
Samples
Changing the sample
Sample offsets (examples)
smpl
smpl
1953m1 1953m1+11
@first+1 @last
85
Sample Objects
It can become quite cumbersome and
time-consuming to re-enter sample
selection rules if you change samples
frequently.
EViews provides a method of saving
sample information in an object which can
then be referred to by name.
86
43
Sample objects
Creating a sample object
STEP 1:In the main menu, select Object/New Object
STEP 2: Select Sample. You may, at this time, provide a
name for the group. If you do not provide a name,
EViews will automatically assign one for you.
STEP 3: Click OK. EViews will open the sample object
specification dialog.
Note: In the dialog, there is a check box for setting the
workfile sample equal to the sample object. This means
that defining a sample object does not automatically
apply the sampling procedure in the workfile.
87
Sample objects
Creating a sample object
using a command:
sample sample_name start_obs end_obs
if if_command
88
44
Sample objects
Using a sample object
To use a previously defined sample object to set
the workfile sample,
STEP 1: Open a sample object by double
clicking on the name or icon.
STEP 2: Click the Set workfile sample check
box.
STEP 3: Click OK.
89
Sample objects
Using a sample object
Using a command: smpl sample_name
For many purposes, you may also use a named
sample object as though it were an ordinary
EViews series containing values 1 and 0, for
observations that are and are not included,
respectively.
This means that sample objects can be used in
EViews expressions and in the construction of
other sample objects.
90
45
Importing data
Entering data
For small datasets in printed form, you may wish
to enter the data by typing at the keyboard.
STEP 1: To open a temporary spreadsheet
window in which you will enter the data, choose
Quick/Empty Group (Edit Series) from the main
menu.
STEP 2: Do the following steps:
91
Importing data
Entering data
92
46
Importing data
Entering data
STEP 3: If you are done typing the data,
name the untitled group by clicking the
Name button.
93
Importing data
Copy-and-pasting
Useful for small datasets and other software applications
(ex. Excel)
STEP 1: Highlight and copy the cells (including the
variable headings/names) to be imported into EViews.
STEP 2: In EViews, create or load a workfile and choose
Quick/Empty Group (Edit Series) from the main menu.
STEP 3: Place the cursor and click the upper-left cell just
to the right of the second obs label.
STEP 4: Select Edit/Paste from the main menu (or
simply use the right mouse click to paste).
94
47
Importing data
Importing data from a spreadsheet or text file
STEP 1: Make sure you have an open workfile
and that the workfile window is active.
STEP 2: Click on Proc/Import/Read Text-LotusExcel You will see a standard File Open dialog
box. Select a file type and file name.
STEP 3: Click OK. EViews fill open a dialog
prompting you for additional information about
the import procedure.
95
Importing data
Importing data from a spreadsheet or text file
(spreadsheet import)
96
48
Importing data
Importing data from a spreadsheet or text file
(ASCII text files import)
97
Exporting data
Exporting to a spreadsheet or text file
STEP 1: Make sure you have an open workfile
and that the workfile window is active.
STEP 2: Click on Proc/Export/Read Text-LotusExcel You will see a standard SaveAs dialog
box. Select file name and the type of the output
file.
STEP 3: Click OK.
98
49
EViews
5. Working with Data
Numeric expressions
An EViews expression is a combination of
numbers, series names, functions, and
mathematical and relational operators.
You can use these expressions to:
Calculate
50
Multiplication
Numeric expressions:
lags and leads
102
51
x x(-1)
log(x) log(x(-1))
fourth order difference of x
first order difference of x with a
seasonal difference at lag 4
x with a seasonal difference at lag 4
103
Series
104
52
Series
Creating/modifying a series
STEP 1: Select
Quick/Generate Series
or click the Genr button on
the workfile toolbar.
EViews opens a window
prompting you for
additional information
105
Series
Creating/modifying a series (STEP 2)
Basic assignment
Type
53
Series
Creating/modifying a series (STEP 2)
Dynamic assignment
You
107
Scalars
54
Alpha series
An alpha series object contains a set of
observations on alphanumeric string
values.
If this type of data was entered into an
ordinary series, EViews will replace the
string with the numeric missing value, NA.
109
Alpha series
Creating an alpha series
55
Alpha series
Editing an alpha series
There is no difference between editing an
ordinary numeric series and editing an
alpha series.
Issues on working with strings shall be
addressed in later lectures.
111
EViews
6. Basic Data Analysis
56
113
Series
114
57
Series
115
Skewness positive
(negative) skewness
means that the distribution
has a long right (left) tail;
Kurtosis the kurtosis of
the normal distribution is 3;
if the kurtosis is greater
(less) than 3, the
distribution is leptokurtic
(platykurtic);
Jarque-Bera test statistic
for testing whether the
series is normally
distributed (null hypothesis:
normal distribution)
116
58
59
Select View/
Descriptive Statistics
& Tests/ Equality
Tests by
Classification and
the Tests by
Classification dialog
box appears
119
60
One-way tabulation
121
Correlogram
61
123
62
Graphing data
Constructing graphs from data is an
important part of the process of data
analysis and presentation.
The last part of this section shall focus on
describing the basics of graphing data in
series using the View/Graph menu item.
125
Graphing data
Another way of
graphing data is to
select Quick/Graph
You will then be
required to enter the
list of series, groups,
and/or series
expressions you want
to graph.
126
63
Graphing data
EViews
7. Basic Single-Equation
Analysis
64
Single-equation regression
Single-equation regression is one of the
most versatile and widely used statistical
techniques.
Basic regression techniques in EViews:
Click Quick/Estimate
equation to open
the Equation
Estimation dialog.
You then have to
specify:
Equation
specification
Estimation settings
130
65
131
66