Introduction to EViews
• We will use data on the monthly stock price of the
following:
– SandP (market index)
– Ford
– General Electric (GE)
– Microsoft
– Oracle
• The data is from January 2002 to April 2013
When you start EViews, you will see the screen shown below,
called the command window.
When you are using EViews, you can tell it what to do by typing
commands (in the command window) or by using menus.
There are a number of ways to import data that is
stored in Excel
• In the command window, type:
create m 2002:01 2013:04 (separated by space)
• m data is monthly
• 2002:01 data starts at January 2002
• 2013:04 data ends at April 2013
When you press enter ( ), you will see an untitled workfile.
This workfile has two objects that appear automatically: C and
RESID (will be explained later).
The pop-up screen tells you that the range for the data is
January 2002 to April 2013.
Then type data followed by the names of the variables
(all separated by space) in the command window:
data SandP Ford GE Microsoft Oracle
• Rules for assigning names to variables:
– Every name must begin with a letter, but subsequent
characters may be letters or digits.
– Space between characters is not allowed.
– Do not use reserved names (e.g., c, resid, ma, exp, log, etc.)
– EViews accepts both capital letters and lower case letters in the
names you assign to your variables and is not case-sensitive.
– SandP, sANDp, sandp are all the same objects in EViews.
When you press on enter a spread sheet will appear (empty -
with no data).
Copy the data from Microsoft Excel
Paste the data in the EViews spreadsheet
The workfile is now ready for any subsequent analysis
• Click on exit (x) on Group: UNTITLED
• When asked ‘Delete Untitled GROUP?’, click on YES.
• You are simply closing the spreadsheet (your data
will not be lost)!
• We can also directly import data from MS Excel to EViews.
• To do so, make sure that:
– The variable names appear on the first line in the Excel
worksheet
– The first variable is on the first line and first column
(column A)
– The data appear starting from the second line on the
Excel worksheet
To import data, select:
File Import Import from file…
Go to the directory and folder where the data file under
consideration is stored
Click on Open and, under Predefined range, make sure that the
name of the worksheet is the one that contains the specific data
of interest (in our case, asset prices)
Click on Finish. That’s all!
• To save the data file:
• Click on: File Save as…
• Select the directory where the file is to be stored
• Assign a filename (say, asset prices data nov 2019) and then
click on Save (click on OK again on the pop-up window).
You will see that the workfile has been assigned the name:
ASSET PRICES DATA NOV 2019
To view data on selected variables:
Click on Show on the Workfile, and then type the name of your
variables (separated by space) in the pop-up window.
Note that you don’t need to type the full name of a variable. When
you enter the initial letter of a variable, EViews will highlight that
variable. Then just double-click on it.
A spreadsheet containing data on the variables listed
above pops up.
To obtain descriptive statistics:
Click on Quick Group Statistics Descriptive Statistics
Individual samples
List the variables (separated by space) in the pop-up window
(with header: Series List)
When you click on OK, you will see: Mean, Median, Maximum,
Minimum, Std. Dev., Skewness, Kurtosis and Jarque-Bera test of
normality (with probability = p-value)
Click on exit (x) on Group: UNTITLED. When asked to delete Untitled
GROUP:
a) if you don’t need the output, click on YES
b) if you want to save the output, click on Name, type a name for the
output (say, descriptive_stat) and then click on OK (you should see the
name in the variable list).
To obtain graphs:
Click on: Quick Graph
List the variables (separated by space) in the pop-up window
(with header: Series List)
Click on OK and choose the type of graph (say, Line & Symbol).
Then click on OK to get your graph.
To save your graph, click on Name, type a name for the graph
(say, line_graph) and then click on OK.
You should see the name of your graph in the variable list.
Generating a new series
• One of the most powerful features of EViews is its ability to
process mathematical expressions.
• EViews contains an extensive library of built-in operators and
functions that allow you to perform complicated
mathematical operations on your data.
• In addition to supporting standard mathematical and
statistical operations, EViews provides a number of
specialized functions for automatically handling the leads,
lags and differences that are commonly used in time series
analysis.
• An EViews expression is a combination of numbers,
series names, functions, and mathematical and
relational operators.
• You can use these expressions, for example, to
calculate a new series from existing series.
To compute a new variable from the existing variables, Click on:
Quick Generate Series
A pop-up window (with header: Generate Series by Equation)
will appear. Type in the mathematical expression for the new
series to be generated e.g.: Ln_Ford = log(ford)
Example: The return of an asset X is defined as:
To generate the return series for an asset (say Ford), we write:
Return_Ford=log(ford)-log(ford(-1))
When you click on OK, you should see the new series (variable) among
the variables in the active workfile
The graph of the asset price as well as return of Ford are shown below.
We can see that the return series is stable around zero with only small
fluctuations (i.e., it is stationary).
You can also generate the return series by typing the following in
the command window and then pressing Enter ( ):
genr Return_Ford=log(ford)-log(ford(-1))
To study cyclical (or long-term) variation of a time series, we can use
moving averages. To generate this component in the Microsoft price
series, for example, type the following in the command window:
genr MA_Microsoft=@MOVAV(microsoft,15)
Press Enter and graph the new series together with Microsoft price
series.
From the moving average we see a downturn in price levels from
2007–2009. This period corresponds to the recession in the US.
OLS regression
Suppose we want to obtain a regression model with the return
of Ford as the dependent variable and S & P market index
return as the independent variable. First generate the S & P
market return: click on Genr, type the following and click on OK:
return_sandp=log(sandp)-log(sandp(-1))
Before estimating the regression model, it would be a good idea
to plot a scatter diagram of the variables under study. To do so,
click on Quick, and then Graph…, and type the following:
return_sandp return_ford
Click on OK and select Scatter among the types of graphs.
Click on OK to view the scatter diagram. We can see that there is
approximate linear relationship between return of Ford and S &
P market index return.
To obtain OLS regression, click on:
Quick Estimate Equation…
• You will see a pop-up window (with header: Equation
Estimation).
• To obtain a regression model in EViews, where the dependent
variable is Y and the independent variables are X1, X2, X3, we
first enter the dependent variable, followed by c (for the
constant term), and then each of the independent variables
(all separated by space).
Y c X1 X2 X3
To obtain a regression model of return of Ford on S & P market
index return, type the following (separated by space) under the
box entitled Equation specification:
return_ford c return_sandp
Under Estimation settings, you have a number of options.
You have to choose the appropriate model (or method of
estimation) from the list.
In this case we go for Ordinary Least Squares: LS – Least Squares
(NLS and ARMA) (the default). When you click on OK, you will
see the fitted linear regression model with several model-fit
statistics.
You can also get the least-squares model by typing:
return_ford=c(1)+c(2)*return_sandp
under the Equation specification box and clicking on OK. Here c(1)
is the intercept, while c(2) is the slope coefficient (CAPM-beta).
• The adequacy of a model, significance of variables, or any
decision as to whether the null hypothesis has to be rejected
or not is based on probability values (or p-value) that are
displayed in EViews outputs.
Definition: (p-value)
• A p-value is the smallest level of significance () for which
the null hypothesis is to be rejected.
For instance:
• If p-value = 0.002, then we can reject the null hypothesis for
all values of greater than 0.002 but less or equal to 0.05
(such as = 0.01, = 0.05).
• If p-value = 0.03, then we can reject the null hypothesis for all
values of greater than 0.03 but less or equal to 0.05 (such as
= 0.05).
• If p-value = 0.07, then we can not reject the null hypothesis at
both 5% and 1% levels of significance since 0.07 exceeds both
0.01 and 0.05.
• In general, we do not reject the null hypothesis if the p-value
is greater than 0.05.
• Note: In EViews output, the p-value corresponds are displayed
in the column under Prob.
• The significance of the independent variable (S & P market
index return) can be tested using the p-value that is produced
for this variable in EViews output.
Null hypothesis: 𝐻0 : 𝛽 = 0
– the independent variable is not significant (it has no
significant influence on the dependent variable)
Alternative hypothesis: 𝐻1 : 𝛽 ≠ 0
– the independent variable is significant
• Decision rule: reject the null hypothesis if the p-value is less
than 0.05.
• In our output, the p-value of RETURN_SANDP is 0.0000.
• Since this figure is less than 0.01, we reject the null
hypothesis at the 1% level of significance and conclude that
the Standard & Poor’s market index return has a significant
influence on the price return of Ford.
• The estimated value of β is 2.020214. Thus, when the
Standard & Poor’s market index return increases by 1%, the
price return of Ford is expected to increase by 2.02%.
• To test whether the asset is highly risky or not:
Null hypothesis: 𝐻0 : 𝛽 = 1
– The asset has the same level of risk as the market index
Alternative hypothesis: 𝐻1 : 𝛽 > 1
– the risk of this asset is greater than that of the market
index (suggesting that the asset is rather risky)
• Decision rule: reject the null hypothesis if the p-value is less
than 0.05.
To conduct this test, in the equation window click on View, select
Coefficient Diagnostics and then Wald Test-Coefficient Restrictions…
Type c(2)=1 under the box entitled Wald Test
When you click on OK, you will get the test results. The t-statistic is
4.281132 with a p-value (probability) of 0.0000. Since p-value < 0.05,
we reject the null hypothesis. Thus, CAPM-beta is significantly greater
than one, and the asset is rather highly risky.