EViews Tutorial
EViews Tutorial
R. R. Johnson
University of San Diego
Introduction
In the Introduction:
1. Purpose of this guide
2. EViews help
3. EViews basics and objects
4. Mathematical expressions in EViews
5. Areas in EViews main window
Purpose of this guide:
Econometrics is defined by A. H. Studenmund1 to be "the quantitative measurement and analysis
of actual economic and business phenomena." This definition highlights the importance of
learning econometrics by working through examples. This guide demonstrates how to use
EViews to complete the econometric analysis illustrated in the text. EViews output can be copied
and pasted into word processing files to facilitate the research report writing process.
Each chapter in this guide corresponds to a chapter in Using Econometrics: A PracticalGuide
(UE), by A. H. Studenmund. All of the econometric processes examined in a chapter are
reproduced in the corresponding chapter of this guide, using EViews whenever a data set is
provided.2 This guide is a do-it-yourself manual and students should be able to reproduce the
econometric analysis described in UE, without further assistance from the instructor. Best results
are achieved when the text chapter is read first and then the operations are performed as you read
the guide. Most procedures described in this guide are explained in a step-by-step manner so that
even the novice user should be able to follow. The reader is advised to consult the owner's
manual or the help function in EViews in cases where: a deeper understanding of EViews'
functions is desired, a description of how EViews performs the calculations is desired, or
references to the source of the econometric theory applied by EViews is sought.
I would like to thank A. H. Studenmund for his helpful comments and a special thanks to Pat Johnson for her
superb editorial assistance and for making sure that the instructions in this guide are clear and easy to follow. Your
feedback is very valuable - send your comments about this site and this guide to mailto:[email protected].
1
A. H. Studenmund, Using Econometrics, A PracticalGuide (fourth edition), Addison Wesley, 2000, p. 3.
2
For a variety of reasons, data sets for some of the examples presented in the text are not available.
To create an object: select Objects/New Object from the main menu or workfile menu, click on
the type of object that you want to create, provide a name and then click on OK. For some object
types, another dialog box will open, prompting you to describe your object in more detail. For
most objects, however, the object window will open immediately. A workfile must be open
before an object can be created. The process of creating a workfile and objects will be explained
later in this guide.
Mathematical expressions in EViews:
EViews contains an extensive library of built-in operators and functions that allow you to
perform complicated mathematical operations with your data using just a few keystrokes. 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 found in time series data. All of the operators described below may be used in
expressions involving series and scalar values. When applied to a series expression, the operation
is performed for each observation in the current sample.
EViews follows the usual order in evaluating expressions from left to right, with operator
precedence order (from highest precedence to lowest):
1.
2.
3.
4.
5.
^
*, /
+, subtraction (-)
<, >, <=, >=, =
and, or
For a list and description of all of the operators and special functions available in EViews, click
on: Help/Function Reference.
The table below explains the function of each mathematical operator used by EViews.
Expression
+
*
/
^
>
<
=
<>
<=
>=
and
or
Operator
add
subtract
multiply
divide
raise to the power
greater than
less than
equal to
not equal to
Description
x+y adds the contents of X and Y
xy subtracts the contents of Y from X
x*y multiplies the contents of X by Y
x/y divides the contents of X by Y
x^y raises X to the power of Y
x>y takes the value 1 if X exceeds Y, and 0 otherwise
x<y takes the value 1 if Y exceeds X, and 0 otherwise
x=y takes the value 1 if X and Y are equal, and 0 otherwise
x<>y takes the value 1 if X and Y are not equal, and 0 if they are
equal
less than or equal to
x<=y takes the value 1 if X does not exceed Y, and 0 otherwise
greater than or equal to x>=y takes the value 1 if Y does not exceed X, and 0 otherwise
logical and
x and y takes the value 1 if both X and Y are nonzero, and 0
otherwise
logical or
x or y takes the value 1 if either X or Y is nonzero, and 0 otherwise
Refer to the graphic above as you read a description of the various areas of the EViews window
below. References to these areas will be made throughout this guide.
The title bar: The title bar, labeled EViews Student Version, is at the very top of the main
window.
The main menu: Just below the title bar is the main menu. If you move the cursor to an entry in
the main menu and click on the left mouse button, a drop-down menu will appear. Clicking on an
entry in the drop-down menu selects the highlighted item. Some of the items in the drop-down
menu may be listed in black and others in gray. In menus, black items may be executed while the
gray items are not available.
The command window: Below the main menu bar is an area called the command window
where EViews commands are typed. The command is executed as soon as you hit ENTER.
The status line: At the very bottom of the window is a status line, which is divided into four
sections. The left section will sometimes contain status messages sent to you by EViews. These
status messages can be cleared manually by clicking on the box at the far left of the status line.
The next section shows the default directory that EViews will use to look for data and programs.
The last two sections display the names of the default database and workfile.
The work area: The area in the middle of the window is the work area where EViews will
display the various object windows that it creates. Think of these windows as similar to the
sheets of paper you might place on your desk as you work. The windows will overlap each other
with the foremost window being in focus or active. Only the active window has a darkened
titlebar.
Using Econometrics, A Practical Guide (fourth edition), by A. H. Studenmund will be referred to as (UE) when
referenced in this handbook.
2
For monthly, quarterly, or annual time series data, with observations ranging from the beginning of 1980 to the end
of 1996, select from the following options: for monthly data, set the Workfile frequency: to monthly, and specify the
Start date, 1980:01, and the End date, 1996:12. For quarterly data, set the Workfile frequency: to quarterly, and
specify the Start date, 1980:1, and the End date, 1996:4. For annual data, set the Workfile frequency: to annual, and
specify the Start date, 1980, and the End date, 1996. See Help/Contents/EViews Basics/Workfile Basics for more
information about creating and using workfiles in EViews.
changed after the workfile has been created. Note that all new workfiles will contain two objects
boxed in red: the coefficient vector named c and the residual series named resid. (see the figure
below).
Step 5. To save your workfile,
select Save on the workfile
menu bar or File/Save or
File/Save As on the main menu
bar and enter htwt1.wf1 in the
File name: window, select the
destination drive in the Save in:
window and click OK. It is
advisable to save the workfile
after it is created and frequently
thereafter.
Entering data into an EViews
workfile:
Complete the section entitled
Creating an EViews workfile
before attempting this procedure. To enter the data for height (inches above 5') and weight from
columns (2) and (3) of Table 1.1, (UE, p. 20) into the newly created workfile, follow the steps
below.
Step 1. To create a new series for the weight (Y) variable, select Objects/New Object/Series from
the main menu or the workfile menu, enter Y in the Name for Object: window and click OK. All
of the observations in the series will be assigned the missing value code 'NA'.3
Step 2. To enter data into the newly created series, double click the series in the workfile window
and click edit+/- on the series window menu bar. The numbers from the table can be entered to
replace the NA's in the spreadsheet, pressing Enter after each entry. After the numbers have
been entered, 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
button in the upper right corner of
the series window.
Step 3. Repeat the process for the height (X) variable.
Step 4. To save changes to your workfile, click Save on the workfile menu bar.
Most data are available in spreadsheet file or ASCII text file format, which can be imported
directly into the workfile. The procedure for importing the weight and height data from an ASCII
text file will be explained in Chapter 2. The edit procedure described above is mostly used to
adjust data series after they are imported. In cases where expressions can be used to assign
values for the series, click on Quick/Generate Series or click on Genr on the workfile window
menu bar and enter the expression defining the series. For more information on how to generate
a series using expressions, see Help/Contents/EViews Basics/Working with Series.
3
A series can also be created by clicking on Quick/Generate Series on the main menu bar or by clicking on Genr
on the workfile window menu bar and enter the expression Y = NA or any other mathematical expression.
You must name a group object if you want to keep its results. Unnamed objects are labeled UNTITLED and the
results are lost when the object window or the workfile is closed. To name a group, click Name on the group menu
bar and enter the name in the Name to identify object: window. Once named, a 'group object' is saved with the
workfile and can be viewed by double clicking its icon (i.e.,
) in the workfile window.
5
Features of Groups: A group is simply a list of series identifiers, not a copy of the data in the series. If you
change the data for one of the series in the group, you will see the changes reflected in the group. If you delete a
series from the workfile, it will disappear from any group that included the series. If the deleted series is the only
series in a group, the group will also be deleted. Renaming a series changes the reference in every group containing
the series. Groups, like other EViews objects, contain their own views and procedures. A detailed description can be
found in Help/Contents/Statistical Views and Procedures/Group Views and Procs.
Figure 1b
250
200
150
Y
100
50
0
0
10
15
20
The conditional value typed within a set of parenthesis is equal to one when the condition is true and zero if the
condition is false. Thus, the condition (residual>=-10 and residual<=10) is equal to one if the residual falls within
the range -10 to +10 and zero if it is outside of this range. The condition (residual<-10 or residual>10) is equal to
one if the residual is less than -10 or greater than +10 and zero if it falls within the range -10 to +10.
Exercises:
13.
a.
b.
c.
d. The data for this exercise are available in an EViews file named help1.wf1. However, it is
a good idea to take this opportunity to make sure that you understand how to create a
workfile and enter data. If you want to skip these steps, open the EViews workfile named
help1.wf1 and skip steps 1 through 6 below.
Follow these steps to create a new workfile for the help-wanted advertising index (hwi) and
unemployment rate (ur) data set printed in the table accompanying exercise 13.
Step 1. Select File/New/Workfile on the EViews main menu bar. Set the workfile frequency to
Quarterly. Enter 1962:1 for the Start date: and 1967:4 for the End date: (see footnote 2). Click
OK to open a new untitled workfile.
Step 2. To save your workfile, select Save on the workfile menu bar or File/Save or File/Save As on
the main menu bar and enter help1.wf1 in the File name: window, select the destination drive in
the Save in: window, and click OK.
Step 3. To create a new series for the help-wanted advertising index (hwi) variable, select
Objects/New Object/Series from the main menu or the workfile menu, enter hwi in the Name
for Object: window and click OK. All of the observations in the series will be assigned the
missing value code 'NA'.
Step 4. To enter data into the newly created series, double click the series in the workfile window
and click edit+/- on the series window menu bar. The numbers from the table can be entered to
replace the NA's in the spreadsheet, pressing Enter after each entry. After the numbers have
been entered, 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
button in the upper right corner of
the series window.
Step 5. Repeat the process for the unemployment rate (ur) variable.
Step 6. To save changes to your workfile, click Save on the workfile menu bar.
The process of running a regression is explained, in detail, in Chapter 2, but a short description
of the process is presented here. Follow these steps to run the regression between hwi and ur:
Step 1. Open the EViews workfile named Help1.wf1.
Step 2. Select Objects/New Object/Equation and click OK (or Quick/Estimate Equation from the
main menu).
Step 3. Enter the dependent variable (hwi), the constant (c) and the independent variable (ur) in the
Equation Specification: window that appears, using spaces between each term. It is important to
enter the dependent variable first (hwi in this case).
Step 4. Select the estimation method {LS - Least Squares (NLS and ARMA)}. EViews uses this as
the default setting because it is selected most of the time.
Step 5. The workfile sample range is automatically entered but it can be changed if another sample
range is desired.
Step 6. Click OK when finished to reveal the regression output generated by EViews.
Using Econometrics, A Practical Guide (fourth edition), by A. H. Studenmund will be referred to as (UE) when
referenced in this guide.
2
Alternately, select Quick/Estimate Equation from the main menu. If this method is used, the equation must be
named to save it. Click Name on the equation menu bar and enter the desired name and click OK.
Step 5. Select the estimation Method {LS - Least Squares (NLS and ARMA)}. This is the default
that will be used most of the time.
Step 6. The workfile sample range is automatically entered but it can be changed if another sample
range is desired. Click OK to view the EViews Least Squares regression output table.
Step 7. To save changes to your workfile, click Save on the workfile menu bar.
Contents of the EViews equation window:
Most of the important statistical information relating to a regression is reported in the EViews
equation window (see the figure below). General information concerning the regression is
printed in the top few lines, the coefficient statistics are reported in table format (middle five
columns), and summary statistics are printed in table format (bottom four columns) of the
equation window.
General Information Printed in the Top Portion of the Equation Output: The first five or
six lines identify (see arrow
in figure on right):
Line 1. Name of the
dependent variable.
Line 2. Regression method
used.
Line 3. Date & time the
regression was executed.
Line 4. Sample range used
in the regression.
Line 5. Number of
observations included in
your regression.
Line 6. Number of excluded
observations.
Line 6 is not reported in this
case because no observations are excluded (i.e., no variable, included in the regression, has
missing observations or is lagged with data not available for the pre-sample period).
Coefficient Results: Key information regarding the estimated regression coefficients is reported
in a table displayed in the middle of the regression output (see area highlighted in yellow). The
first column identifies each variable (C for the constant and X for height) and the second column
reports the estimated coefficient values (i.e., o & 1). Note that the estimated coefficients are
the same as those printed in (UE, Equation 1.21, pp. 20 & 21). The data printed in columns (3) (6) are the standard error of the coefficient, the t-statistic and the probability respectively. We
will not discuss these now, but they will be very important when Hypothesis Testing is discussed
in Chapter 5.
Summary Statistics: Key summary statistics are reported in four columns below the equation
output (see area outlined in red). Each will be defined and the page reference to where it is
discussed in UE is identified in parenthesis.
If you know the location and name for the spreadsheet file, you can skip steps 35. Instead, fill in the File name
box and click OK.
You must name a group object if you want to keep its results. Unnamed objects are labeled UNTITLED and the
results are lost when the object window or the workfile is closed. To name a group, click Name on the group menu
bar and enter the name in the Name to identify object: window. Once named, a 'group object' is saved with the
) in the workfile window.
workfile and can be viewed by double clicking its icon (i.e.,
2
The group view drop-down menu is divided into four blocks:
The views in the first block provide various ways of looking at the actual data in the group.
The views in the third block are for specialized statistics for time series data.
The fourth block contains the label view, which provides information regarding the group object.
The descriptive statistics printed in the table below are defined in footnote 3 at the bottom of this
page.3 See Chapter 16 to gain a better understanding of these statistics.
Step 3. Select View/Spreadsheet on the group window menu bar to restore the spreadsheet view for
GROUP 01.
Mean
Median
Maximum
Minimum
Std. Dev.
Skewness
Kurtosis
Y
125634.6
122015.0
166755.0
91259.00
22404.09
0.355246
1.920334
N
4.393939
4.000000
9.000000
2.000000
1.919300
0.555101
2.359612
P
103887.5
95120.00
233844.0
37852.00
55884.51
0.672915
2.280488
I
20552.58
19200.00
33242.00
13240.00
5141.865
0.933694
3.161758
Jarque-Bera
Probability
2.296908
0.317127
2.258639
0.323253
3.202315
0.201663
4.830791
0.089332
Observations
33
33
33
33
Displaying the simple correlation coefficients between all pairs of variables in a group (UE,
Table 3.1):
Step 1. Open the group object created in Display the spreadsheet view of a group of variables by
double clicking the
icon in the workfile window.
Step 2. Click View/Correlations on the group window menu bar to display the simple correlation
coefficients between all pairs of variables included in the group object (see the table below).4
Y
N
P
I
Y
1.000000
-0.144225
0.392568
0.537022
N
-0.144225
1.000000
0.726251
-0.031534
P
0.392568
0.726251
1.000000
0.245198
I
0.537022
-0.031534
0.245198
1.000000
All of the statistics are calculated using observations in the current sample.
Mean is the average value of the series, obtained by adding up the series and dividing by the number of
observations. Median is the middle value (or average of the two middle values) of the series when the values are
ordered from the smallest to the largest. The median is a robust measure of the center of the distribution that is less
sensitive to outliers than the mean. Max and Min are the maximum and minimum values of the series in the current
sample. Std. Dev. (standard deviation) is a measure of dispersion or spread in the series. Skewness is a measure of
asymmetry of the distribution of the series around its mean. Kurtosis measures the peakedness or flatness of the
distribution of the series. Jarque-Bera is a test statistic for testing whether the series is normally distributed. The test
statistic measures the difference of the skewness and kurtosis of the series 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. The reported Probability is the probability that a Jarque-Bera statistic exceeds (in absolute value) the
observed value under the nulla small probability value leads to the rejection of the null hypothesis of a normal
distribution.
4
View/Correlations displays the correlation matrix of the series in the selected group. Observations for which any
one of the series has missing data are excluded from the calculation.
You can copy the last line and paste it into your word processing file to get the first line of UE,
Equation 3.7.
5
Alternately, select Quick/Estimate Equation from the main menu. If this method is used, you must name the
equation to save it. Click Name on the equation menu bar and enter the desired name in the Name for object:
window and click OK.
6
Restrictions on naming an object include, the name cannot exceed 16 characters and it cannot be a reserved name.
The following names are reserved and should not be used for series: ABS, ACOS, AR, ASIN, C, CON, CNORM,
COEF, COS, D, DLOG, DNORM, ELSE, ENDIF, EXP, LOG, LOGIT, LPT1, LPT2, MA, NA, NRND, PDL,
RESID, RND, SAR, SIN, SMA, SQR, and THEN.
Select View/Estimation Output on the group window menu bar to restore the estimation output
view for EQ01.
Displaying the actual, fitted, residual, and a plot of the residuals for a regression (see UE,
Table 3.2, p. 76):
Step 1. Open the EViews workfile named Woody3.wf1 and open the equation named EQ01 by double
clicking the equation icon in the workfile window.
Step 2a. Click View/Actual,Fitted,Residual/Actual,Fitted,Residual Table on the equation window
menu bar (see figure below left). Click OK to reveal the figure below right.
Step 2b. Alternately, to display a graph of the actual, fitted, and residuals for a regression, click
View/Actual,Fitted,Residual/Actual,Fitted,Residual Graph (see figure below left). Click OK
to reveal the figure below right. Other views available in the equation window will be explained
in future chapters of this guide.
Step 3. Type the following commands in the command window, press Enter after each command:
BETA.WRITE(T=XLS) EXCEL
CREATE BETAWF U 1 20
READ(T=XLS) EXCEL 1
RENAME SER01 BETA
BETA.HIST
SAVE
The first command writes the matrix named BETA as a series to an Excel file named EXCEL, the
second command creates a new undated EViews workfile named BETAWF with 20
observations,2 the third command reads the series named excel into the EViews workfile and
names it SER01, the fourth command renames SER01 to BETA, the fifth command creates a
histogram of the sample s, and the last command saves the EViews file.
This number should be set equal to the number of rows in the matrix named beta. See footnote 1.
The three figures below show how the probability distribution of the estimated sample series
more closely approximates the normal distribution as the number of observations increase from
20 to 2,000 and finally to 8,000. For an explanation of the histogram and descriptive statistics
represented, see Chapter 16.
The graphic on the right
shows the
View/Descriptive
Statistics/Histogram and
Stats EViews for beta with
20 observations.
Coefficient
102192.4
-9074.674
0.354668
1.287923
0.618154
0.578653
14542.78
6.13E+09
-360.9930
1.758193
Std. Error
12799.83
2052.674
0.072681
0.543294
Mean dependent var
S.D. dependent var
Akaike info criterion
Schwarz criterion
F-statistic
Prob(F-statistic)
t-Statistic
7.983891
-4.420904
4.879810
2.370584
Prob.
0.0000
0.0001
0.0000
0.0246
125634.6
22404.09
22.12079
22.30218
15.64894
0.000003
All information needed for hypothesis testing using the t-test is found in the middle of the
EViews equation output table (highlighted in yellow). The first column identifies the name of the
variable. The second column reports the estimated coefficient ( k) for each variable, and the
third column reports the standard error for the estimated coefficient (SE k). The fourth column
prints the calculated t-value given that the border value implied by the null hypothesis (Ho) is
zero (i.e., the t-value in this case is ( k)/(SE k)).
1
The EViews program uses the term t-Statistic rather than the term t-value, which is used in UE and this guide.
Calculating critical t-values and applying the decision rule (UE 5.2.2):
The critical t-value (tc) is the value that separates the "acceptance" region from the "rejection"
region. Look up this value in UE, Statistical Table B-1, p.607. Its value depends on the degrees
of freedom (printed in column one of Table B-1) and the level of Type I error specified (i.e., the
number at the top of the column in Table B-1 for two-tailed tests or double the value for onetailed tests). Alternately, you can follow these steps to have EViews calculate the one-tailed and
two-tailed, 5% significance level critical t-values (tc):
Step 1. Open the EViews workfile named Woody3.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter Y C N P I in the
Equation Specification: window, and click OK.
Step 3. Select Name on the equation window menu bar, enter EQ01 in the Name to identify object:
window, and click OK.
Step 4. To create a vector object named result with 10 rows (to store the results of the test statistics
for Woody's Restaurants regression), type the following command in the command window:
vector(10) result and press Enter.2
Step 5. To compute the two-tailed critical t-value (tc) for the 5% significance level and save the value
in the first row of the vector object named result, type the following equation in the command
window and press Enter:3
result(1)=@qtdist(.975,(eq01.@regobs-eq01.@ncoef)).4
Step 6. To compute the one-tailed critical t-value (tc) for the 5% significance level and save the value
in the second row of the vector object named result, type the following equation in the command
window and press Enter:
result(2)=@qtdist(.95,(eq01.@regobs-eq01.@ncoef)).
Step 7. Double click on the Vector Object named result in the workfile window to view the two-tailed
and one-tailed, 5% significance level critical t-value (tc) for the Woody's Restaurants regression.
In this case, the value reported in row one of the result vector is 2.045230 and the value reported
in row two is 1.69912702653.
Population was hypothesized to have a positive effect on the number of customers eating at
Woody's Restaurants. This implies that the coefficient on P is expected to be positive and a onetailed test is appropriate. Thus, the hypothesis that the coefficient is zero ( p = 0) is rejected at
the 5% significance level because the calculated t-value (4.879810) is greater than the one-tailed
critical t-value (5% level of significance), calculated in Step 6 to be 1.69912702653.
While it is important to be able to apply the decision rule by comparing the calculated t-value
(reported in the EViews output) with the critical t-value just calculated, EViews makes it
2
Alternately, select Objects/New Object/Matrix-Vector-Coef from the main menu or the workfile menu. Write
result in the Name for Object: window, and click OK. Select Vecto in the Type window, enter 10 in the Rows
window, enter 1 in the Columns window, and click OK.
3
The command, @qtdist(p,v), calculates the value where the cumulative density function (CDF) of the t-distribution
with (v) degrees of freedom equals (p) probability, leaving 1-p% of the t-distribution in each tail. Note that you
should enter 0.975 for "p" for the two-tailed 5% significance level calculation and 0.95 for "p" for the one-tailed 5%
significance level. In this case, v equals (eq01.@regobs-eq01.@ncoef), which calculates the degrees of freedom for
equation eq01. The {eq01.} Part can be omitted if the calculation relates to the last regression run.
4
If you omit the result(1), EViews returns a scalar value on the status line located in the lower left of your screen.
possible to test the null hypothesis that a coefficient is zero (i.e., Ho = 0) without knowing the
critical t-value. Instead, you can examine the probability (Prob.) value in the last column of the
EViews OLS regression output (see the EQ01 Estimation Output table). The Prob. value shows
the probability of drawing a t-value as extreme as the one actually observed when, in fact, the
coefficient value is actually zero5. This probability is also known as the p-value or the marginal
significance level. In terms of UE, it represents the probability of making a Type I error if the
null hypothesis, that the coefficient is zero, is rejected. Given a p-value, you can tell at a glance if
the null hypothesis, that the true coefficient is zero against a two-sided alternative that it differs
from zero, should be rejected or accepted. For example, a p-value lower than .05 suggests
rejection of the null hypothesis, for a two-tailed test at the 5% significance level. The appropriate
probability is one-half that reported by EViews, for a one-sided test. This is comparable to
reading the value at the top of the Critical t-Value table that is double the significance level that
you are testing for a one-tailed test (i.e., using 0.10 instead of 0.05 for 5% significance level).
Applying the Prob. value, one-tailed test to the population (P) variable in the Woody's
Restaurants regression, the hypothesis that the coefficient is zero ( p = 0) is rejected at the 5%
significance level if one-half of the Prob. value in the last column is less than or equal to 0.05.
Note that the null hypothesis is also rejected at the 1% significance level.
Calculating confidence intervals (UE 5.2.4):
Complete steps 1-4 of the section entitled Calculating critical t-values and applying the decision
rule before attempting this section (i.e., an equation object named EQ01 and a vector object
named result with 10 rows should already be present in the workfile). To calculate and record the
90% confidence interval for a coefficient using EViews:
Step 1. Open the EViews workfile named Woody3.wf1.
Step 2. To calculate the lower value for the 90% confidence interval for the population coefficient,
enter the following formula in the command window, and press Enter:6
result(3)= eq01.@coefs(3)-(@qtdist(.95,(eq01.@regobs-eq01.@ncoef)))*eq01.@stderrs(3).
Step 3. To calculate the upper value for the 90% confidence interval for the population coefficient,
enter the following formula in the command window, and press Enter:
result(4)= eq01.@coefs(3)+(@qtdist(.95,(eq01.@regobs-eq01.@ncoef)))*eq01.@stderrs(3).
Step 4. To view the lower and upper confidence interval values, double click the vector icon named
result. Note that the values 0.231175 and 0.478162 are printed in rows three and four
respectively (the same values are reported in UE, p. 128).
5
Under the assumption that the errors are normally distributed, or that the estimated coefficients are asymptotically
normally distributed.
6
eq01.@coefs(i) and eq01.@stderrs(i) are scalar values of the coefficient and standard error of the ith variable in
regression eq01,where i represents the coefficient number (including the constant) listed in the EViews OLS
Estimation Output. Since the population (P) variable is listed third in the Estimation Output, @coefs(3) and
@stderrs(3), calculates the value for the population coefficient and its standard error respectively. As in section
5.2.2, (@qtdist(.95,(eq01.@regobs-eq01.@ncoef))) calculates the value where the cumulative density function
(CDF) of the t-distribution equals 0.95 probability, leaving 5% of the t-distribution in each tail. The term
(eq01.@regobs-eq01.@ncoef) calculates the degrees of freedom for EQ01, with eq01.@regobs calculating the
number of observations used to estimate EQ01 and eq01.@ncoef calculating the number of coefficients estimated,
including the constant.
test statistic
result row
value
t-critical for regression - 5% level of significance (two-tailed test) =
R1 2.04523
t-critical for regression - 5% level of significance (one-tailed test) =
R2 1.699127
lower confidence interval =
R3 0.231175
upper confidence interval =
R4 0.478162
The simple correlation coefficient (r) =
R5 0.392568
t-calculated for correlation =
R6 2.376503
t-critical for correlation =
R7 2.039513
R8
15.64894
The F-statistic =
R9 2.93403
Critical value of the F-statistic - 5% level of significance =
R10
0
Since the 5% critical F-value for EQ01 (i.e., 2.934030) is significantly less than the calculated Fstatistic (i.e., 15.64894), we can reject the null hypothesis that all of the slope coefficients in
EQ01 are zero.
The p-value printed just below the F-statistic in the EViews regression output, denoted Prob(Fstatistic), represents the marginal significance level of the F-test. If the p-value is less than the
significance level you are testing, say .05, you reject the null hypothesis that all slope
coefficients are equal to zero. For EQ01, the p-value is 0.000003, so we reject the null hypothesis
that all of the regression coefficients are zero. Note that the F-test is a joint test so that even if all
the t-values are insignificant, the F-statistic can be highly significant.
Exercises:
16. EViews can be used to complete parts 1, b, c & f of exercise 16.
a. Review the section Calculating critical t-values and applying the decision rule to learn
how to use EViews to calculate the critical values for testing your hypothesis concerning
the regression coefficients in this exercise.
b. Review the section Performing the F-test of overall significance to learn how to use
EViews to calculate the critical value for the F-test of the overall significance of the
estimated equation.
c. Review the section Calculating confidence intervals to learn how to use EViews to
determine lower and upper confidence intervals for an estimated coefficient.
d.
e.
f. Review the section Using EViews to estimate a multiple regression model of beef
demand in Chapter 2, if you have trouble estimating this multiple regression model using
EViews.
Alternately, the EViews Estimation Output could have been preserved by selecting Freeze on the
equation menu bar. The Freeze button on the objects toolbar creates a duplicate of the current view of the
original object. The primary feature of freezing an object is that the tables and graphs created by freeze may
be edited for presentations or reports. Frozen views do not change when the workfile sample is changed or
when the data change. The purpose for freezing the regression output table is to allow us to view it later by
double clicking the objects icon in the workfile window. In order to do that, the frozen object must be
named.
In fact, nearly any transformation of the variables using EViews functions is allowed. See
Help/Reference(Commands and Functions)/Function Reference for a list of EViews functions.
This creates a new series with forecast values of Y based on the estimated coefficients for EQ02.
Note that the coefficient restrictions are written as C(i), where i represents the coefficient order number of
the variable as it was entered in the Equation Specification: window, following the dependent variable.
Thus, C(4),C(5) and C(6) represent the coefficients for YF^2 YF^3 YF^4 in the Equation Specification: Y C
PC YD YF^2 YF^3 YF^4.
5
The Chi-square statistic is equal to the F-statistic times the number of restrictions under test. In this
example, there are three restrictions, so the Chi-square test statistic is three times the size of the F-statistic,
but the p-values of both statistics indicate that we can decisively reject the null hypothesis that the three
coefficients are zero.
4
4.323568
12.92125
Test Equation:
Dependent Variable: Y
Method: Least Squares
Date: 07/27/00 Time: 07:26
Sample: 1951 1994
Included observations: 44
Variable
Coefficient
C
23.80305
PC
-0.591937
YD
0.360179
FITTED^2
0.023868
FITTED^3
-0.000748
FITTED^4
5.48E-06
R-squared
0.988647
Adjusted R-squared
0.987154
S.E. of regression
1.908510
Sum squared resid
138.4116
Log likelihood
-87.64622
Durbin-Watson stat
0.861509
Probability
Probability
0.010205
0.004810
Std. Error
t-Statistic
55.36771
0.429908
1.718030 -0.344544
0.714812
0.503880
0.082475
0.289394
0.001106 -0.676301
5.36E-06
1.022646
Mean dependent var
S.D. dependent var
Akaike info criterion
Schwarz criterion
F-statistic
Prob(F-statistic)
Prob.
0.6697
0.7323
0.6173
0.7739
0.5029
0.3129
43.37500
16.83854
4.256646
4.499945
661.8504
0.000000
The fitted terms are the powers of the fitted values from the original regression, starting with the square or
second power. For example, if you specify 3, then the test will add 2, 3, and 4 in the regression. If you
specify a large number of fitted terms, EViews may report a near singular matrix error message since the
powers of the fitted values are likely to be highly collinear. The Ramsey RESET test is applicable only to
an equation estimated by least squares.
Std. Error
t-Statistic
1.312586
23.99541
0.080020 -9.118941
0.045686
2.498536
0.016447
14.21738
Mean dependent var
S.D. dependent var
Akaike info criterion
Schwarz criterion
F-statistic
Prob(F-statistic)
Prob.
0.0000
0.0000
0.0167
0.0000
43.37500
16.83854
4.314378
4.476577
998.9207
0.000000
Step 3. Open EQ02 by double clicking its icon in the workfile window (see UE, Equation 6.9,
p. 161) to get the Estimation Output below.
Dependent Variable: Y
Method: Least Squares
Date: 07/26/00 Time: 08:01
Sample: 1951 1994
Included observations: 44
Variable
Coefficient
C
32.94193
PC
-0.700954
YD
0.272477
R-squared
0.984772
Adjusted R-squared
0.984030
S.E. of regression
2.127957
Sum squared resid
185.6562
Log likelihood
-94.10685
Durbin-Watson stat
0.946570
Std. Error
t-Statistic
1.251191
26.32845
0.084099 -8.334841
0.005936
45.90552
Mean dependent var
S.D. dependent var
Akaike info criterion
Schwarz criterion
F-statistic
Prob(F-statistic)
Prob.
0.0000
0.0000
0.0000
43.37500
16.83854
4.413948
4.535597
1325.737
0.000000
Note that the AIC & SC information criterion reported in EViews (see numbers
highlighted in yellow) are larger when PB is omitted from the OLS regression (i.e.,
EQ02). Both Akaike's and the Schwartz Criterion provide evidence that UE, Equation 6.8
(i.e., EViews EQ01) is preferable to UE, Equation 6.9 (i.e., EViews EQ02).
Exercise:
15. Open the EViews workfile named Drugs.wf1.
a.
i) Select Objects/New Object/Equation on the workfile menu bar, enter P C
GDPN CVN PP DPC IPC CV in the Equation Specification: window, and
click OK. Select Name on the equation window menu bar, enter EQ01 in the
Name to identify object: window, and click OK.
ii) Select Objects/New Object/Equation on the workfile menu bar, enter P C
GDPN CVN PP DPC IPC N in the Equation Specification: window, and click
OK. Select Name on the equation window menu bar, enter EQ02 in the Name
to identify object: window, and click OK.
b. Open EQ01 and EQ02 at the same time. Use information in these tables, UE 6.8
(Appendix) and the procedures outlined in this guide to determine whether CV
and/or N are irrelevant or omitted variables.
c.
d.
Y = 0 + 1(1/X1) + 2X2
7.5
7.20
Dummy*
Y C X1 D1
Y = 0 + 1X1 + 2D1
7.5
7.22
Dummy** Y = 0 + 1X1 + 2D1 + 3D1X1
Y C X1 D1 D1*X1
* Intercept dummy variable. ** Intercept and slope dummy variables.
Alternately, select Quick/Estimate Equation from the main menu. If this method is used you must name
the equation to save it. Select Name on the equation menu bar and enter the desired name in the Name to
identify object: window, and click OK.
The Forecast procedure in EViews gives you the option of forecasting the transformed dependent
variable (i.e., LOG(S) in this case) or the original variable (i.e., S in this case). Select S, since the
computation of quasi-R2 requires converting of LOG(S) to S by taking the anti-log of the dependent
variable (this can also be done by using the EViews command @exp(LOG(S)).
2.485049
2.485049
Probability
Probability
0.124472
0.114933
The null hypothesis is -C(2)=-100*C(5), since variable T is the second coefficient and
variable H is the fifth coefficient in the EViews Estimation Output from Step 2. The Fstatistic compares the residual sum of squares computed with and without the restrictions
imposed. If the restrictions are valid, there should be little difference in the two residual
sum-of-squares and the F-value should be small. Based on the Wald Test: results table,
the null hypothesis cannot be rejected at the 5% level of significance. The calculated Fstatistic of 2.49 is less than the critical F-value of 4.14. The critical F-value can be found
in UE, Table B-2, p. 609 for 1 degree of freedom in the numerator and 33 (interpolate
between the 30 and 40) degrees of freedom in the denominator or EViews can calculate
The coefficients should be referred to as C(1), C(2), and so on (do not use series names). Multiple
coefficient restrictions must be separated by commas and the restrictions should be expressed as equations
involving estimated coefficients and constants. The coefficients should be referred to as C(1), C(2), and so
on (do not use series names).
its value.4 The reported probability is the marginal significance level of the F-test. It
supports this result in that rejecting the null hypothesis would be wrong less than 12.44%
of the time.
The Chi-square statistic is equal to the F-statistic times the number of restrictions under
test. In this example, there is only one restriction and so the two test statistics are
identical with the p-values of both statistics indicating that we cannot reject the null
hypothesis, that the absolute value of the coefficient on Ti is 100 times larger than the
absolute value of the coefficient on Hi, at the 10% significance level. The 10%
significance critical value for the 2 test can be found in UE, Table B-8, p. 619 to be 2.71.
The Chow test, alternately termed Chow's Breakpoint Test (UE, Appendix 7.7):
Chow's Breakpoint Test divides the data into two sub-samples.5 It then estimates the
same equation for each sub-sample separately, to see whether there are significant
differences in the estimated equations. A significant difference indicates a structural
change in the relationship.
Follow these steps to apply the Chow breakpoint test, as described in UE, pp. 241-242, to
determine whether there was a structural change in the demand for chicken in 1976:
Step 1. Open the EViews workfile named Chick6.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter Y C PC PB YD
in the Equation Specification: window, and click OK.
Step 3. Select Name on the equation menu bar, write EQ01 in the Name to identify object:
window, and click OK.
Step 4. Select View/Stability Tests/Chow Breakpoint Test on the equation menu bar, enter
1976 in the Enter one date (observation) for the Forecast Test or one or more dates for the
Breakpoint Test: window, and click OK to reveal the following output:
Chow Breakpoint Test: 1976
F-statistic
Log likelihood ratio
4.542962
17.98027
Probability
Probability
0.004498
0.001245
EViews reports two test statistics for the Chow breakpoint test. The F-statistic is based on
the comparison of the restricted and unrestricted sum of squared residuals. EViews
calculates the F-statistic using the formula printed in UE, Equation 7.36, p. 242. In this
4
To have EViews calculate the 5% critical F-value for this problem, type the following equation in the
command window =@qfdist(0.95,1,eq01.@regobs-eq01.@ncoefs), press Enter and view the following
value on the status bar in the lower left of the screen
. For the 10% critical Fvalue type =@qfdist(0.90,1,eq01.@regobs-eq01.@ncoefs) in the command window, and press Enter and
.
view the following value on the status bar in the lower left of the screen
5
One major drawback of the breakpoint test is that each sub-sample requires at least as many observations
as the number of estimated parameters. This may be a problem if, for example, you want to test for
structural change between wartime and peacetime where there are only a few observations in the wartime
sample.
case, the calculated F-statistic of 4.54 exceeds the critical F-value of 2.63 for the 5% level
of significance so the null hypothesis of no structural change can be rejected. The critical
F-value can be found in UE, Table B-2, p. 609 for 4 degrees of freedom in the numerator
and 36 (interpolate between the 30 and 40) degrees of freedom in the denominator or
EViews can calculate its value.6 The reported probability is the marginal significance
level of the F-test. It supports this result in that rejecting the null hypothesis would be
wrong less than 0.4498% of the time.
The log likelihood ratio statistic is based on the comparison of the restricted and
unrestricted maximum of the log likelihood function. The LR test statistic has an
asymptotic 2 distribution with degrees of freedom equal to (m-1)*(k+1) under the null
hypothesis of no structural change, where m is the number of sub-samples and k is the
number of independent variables in the model (i.e., m = 2 in this case because one
breakpoint is selected and k = 3). The calculated value for LR test statistic of 17.98
exceeds of 9.49 for the 5% level of significance and 13.28 for the 1% level of
significance so the null hypothesis of no structural change can be rejected.7 The reported
probability is the marginal significance level of the 2 test. It supports this result in that
rejecting the null hypothesis would be wrong less than 0.1245% of the time.
To have EViews calculate the 5% critical F-value for this problem, type the following equation in the
command window =@qfdist(0.95,eq01.@ncoef,eq01.@regobs-2*eq01.@ncoef), press Enter
.
and view the following value on the status bar in the lower left of the screen
7
2
The critical value for the test can be found in UE, Table B-8, p. 619.
Chapter 8: Multicollinearity
In this chapter:
1. Perfect multicollinearity (UE 8.1.1)
2. Detecting multicollinearity with simple correlation coefficients (UE 8.3.1)
3. Calculating Variance Inflation Factors (UE 8.3.2)
4. Transforming multicollinear variables (UE 8.4.3)
5. Exercises
Perfect multicollinearity (UE 8.1.1):
EViews is incapable of generating estimates of regression coefficients when the model
specification contains two or more variables that are perfectly collinear. When the
equation specification contains two or more perfectly collinear (or even some highly
collinear) variables, EViews will put out the error message Near singular matrix.
The next two sections explain how EViews can be used to detect severe multicollinearity
(UE 8.3). The data for the fish/Pope example found in UE, Table 8.1, p. 267, will be used
to demonstrate the two methods discussed in UE.
Detecting multicollinearity with simple correlation coefficients (UE 8.3.1):
High simple correlation coefficients between variables is a sign of multicollinearity.
Follow these steps to compute the simple correlation coefficient between variables:
Step 1. Open the EViews workfile named Fish8.wk1.
Step 2. Create a group object for the variables found in UE, Equation 8.24, p. 268 (i.e., F PF
PB log(YD) N P). An easy way to create a group object for a set of variables from a
regression model is to select Procs/Make Regressor Group on the equation window
menu bar (refer to Chapter 3 to review the usual way of creating a group object).
Step 3. Select View/Correlations on the group object menu bar to reveal the simple
correlation coefficients between all of the variables in the group.
Step 4. Select Freeze on the group object menu bar to create a table of the simple correlation
coefficients. Select Name on the table object menu bar to name the table.
F
F
1.000000
PF
0.847590
PB
0.818532
LOG(YD) 0.780012
N
0.736549
P
0.585630
PF
0.847590
1.000000
0.958096
0.915320
0.883207
0.734643
PB
0.818532
0.958096
1.000000
0.814890
0.781400
0.663162
LOG(YD)
0.780012
0.915320
0.814890
1.000000
0.945766
0.744500
N
0.736549
0.883207
0.781400
0.945766
1.000000
0.571129
P
0.585630
0.734643
0.663162
0.744500
0.571129
1.000000
Exercises:
8.
a.
b. Follow the steps outlined in Detecting multicollinearity with simple correlation
coefficients and Calculating Variance Inflation Factors to check for high
correlations and high VIF's in the implied regression model.
13. Follow the steps outlined in Detecting multicollinearity with simple correlation
coefficients and Calculating Variance Inflation Factors to check UE, Equation 8.25,
p. 269 for high correlations and high VIF's.
16.
f. Run the regressions for this problem using the Mine8.wf1 data set.
a) Refer to Chapter 5 for help with this part.
b) Refer to Detecting multicollinearity with simple correlation coefficients for
help with this part.
c) Refer to Transforming the multicollinear variables for help with this part.
d) Refer to Table with EViews specification for functional forms for help with
this part.
Plotting of the error term to detect serial correlation (UE, pp. 313-315):
Complete the section entitled Creating a residual series from a regression model before
attempting this section (i.e., Equation EQ01 and series E should already be present in the
workfile). Follow these steps to view a residuals graph in EViews:
Step 1. Open EQ01, by double clicking the
icon in the workfile window.
Step 2. Select View/Actual, Fitted, Residual/Residual Graph on the equation window menu
bar to reveal the graph on the left below. Note the residual series exhibits a pattern akin to
the graphs displayed in UE, Figure 9.1, p. 313. Thus, graphical analysis indicates positive
serial correlation. Steps 3 and 4 below show how to generate a time series plot of the
same residual series E.
Step 3. Open the residual series named E in a new window by double clicking the series icon
in the workfile window to open the residual series from EQ01 in a new window.
Step 4. Select View/Line Graph to reveal a time series graph of the residuals shown below.
Using regression to estimate , the first order serial correlation coefficient (UE,
Equation 9.1, pp. 311-312):1
Complete the section entitled Creating a residual series from a regression model before
attempting this section (i.e., Equation EQ01 and series E should already be present in the
workfile). Follow the steps below to estimate the first order serial correlation coefficient
and test for possible first order serial correlation:
Step 1. Open the EViews workfile named Chick6.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter E C E(-1) in
the Equation Specification: window, and click OK to reveal the regression output shown
in the graphic below. Rho () is used to symbolize the coefficient on E(-1) and it
represents the first-order autocorrelation coefficient in this regression. In this case, the
value of is positive and significant at the 1% level (t-statistic = 3.69 and Prob value =
0.0006). It is important to note that this is not a test of serial correlation, but the value of
is related to the value of the Durbin-Watson d statistic discussed in the next section.2
Step 3. Select Name on the equation menu bar, enter EQ02 in the Name to identify object:
window, and click OK.
Step 4. Select Save on the workfile menu bar to save your changes.
To test for possible second order serial correlation, regress the residuals against its value lagged one
period and two periods by entering E C E(-1) E(-2) in the Equation Specification: window, and click OK.
To detect seasonal serial correlation in a quarterly model, regress the residuals against its value lagged four
periods enter E C E(-4) in the Equation Specification: window, and click OK. Similarly, to detect seasonal
serial correlation in a monthly model, regress the residuals against its value lagged twelve periods enter E C
E(-12) in the Equation Specification: window, and click OK.
2
The Durbin-Watson d statistic is approximately equal to 2(1-).
Step 3. Use the Sample size printed after Included observations: (i.e., 44) and the number of
explanatory variables listed in the Variable column (i.e., 3) and follow the instructions in
UE, p. 612 to find the upper and lower critical d value in UE, Tables B-4, B-5 or B-6, pp.
613 - 615).
The Durbin-Watson statistic is a test for first-order serial correlation. More formally, the DW statistic
measures the linear association between adjacent residuals from a regression model. The Durbin-Watson is
a test of the hypothesis =0 in the specification:
t = t-1 + t.
If there is no serial correlation, the DW statistic will be around 2. The DW statistic will fall below 2 if there
is positive serial correlation (in the worst case, it will be near zero). If there is negative correlation, the
statistic will lie somewhere between 2 and 4. Positive serial correlation is the most commonly observed
form. As a rule of thumb, with 50 or more observations and only a few independent variables, a DW
statistic below about 1.5 is a strong indication of positive first order serial correlation.
Estimating generalized least squares (GLS) equations using the AR(1) method (UE
9.4.2):
Follow these steps to estimate the chicken demand model using the AR(1) method of
GLS equation estimation.
Step 1. Open the EViews workfile named Chick6.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter Y C PC PB
YD AR(1) in the Equation Specification: window, and click OK to reveal the output
below. EViews automatically adjusts your sample to account for the lagged data used in
estimation, estimates the model, and reports the adjusted sample along with the remainder
of the estimation output.
The estimated coefficients, coefficient standard errors, and t-statistics may be interpreted
in the usual manner. The estimated coefficient on the AR(1) variable is the serial
correlation coefficient of the unconditional residuals.4
4
Unconditional residuals are the errors that you would observe if you made a prediction of the value of
using contemporaneous information, but ignoring the information contained in the lagged residual. For AR
models estimated with EViews, the residual-based regression statisticssuch as the, the standard error of
regression, and the Durbin-Watson statistic reported by EViews are based on the one-period-ahead
forecast errors.
The most widely discussed approaches for estimating AR models are the Cochrane-Orcutt, PraisWinsten, Hatanaka, and Hildreth-Lu procedures. These are multi-step approaches designed so that
estimation can be performed using standard linear regression. EViews estimates AR models using
nonlinear regression techniques. This approach has the advantage of being easy to understand, generally
applicable, and easily extended to nonlinear specifications and models that contain endogenous right-hand
side variables.
Step 5. To calculate the new residual series, enter the following formula in the command
window: series E = LOG(SDH)-(EQ03.@COEFS(1) + EQ03.@COEFS(2)*LOG(USD)
Statistical output for previously saved equations can be recalled by typing the equation name followed by
a period and the reference to the specific output desired. In this case, the value for from EQ02 (recall that
was coefficient # 2 on the E(-1) term) can be recalled with the command EQ02.@coefs(2). The
expression EQ02.@coefs(2) can be used for in the Equation Specification: window.
6
The equation can be viewed by selecting View/Representations on the equation menu bar. The equation
should read: LOG(SDH)-EQ02.@COEFS(2)*LOG(SDH(-1)) = 0.1506791883 +
0.107961186*(LOG(USD)-EQ02.@COEFS(2)*LOG(USD(-1))) + 0.1368904004*(LOG(SY)EQ02.@COEFS(2)*LOG(SY(-1))) - 0.000837025419*(LOG(SP)-EQ02.@COEFS(2)*LOG(SP(-1))). Select
View/Estimation Output on the group window menu bar to restore the estimation output view for EQ01.
15. Follow the steps explained in the Estimating generalized least squares (GLS)
equations using the Cochrane-Orcutt method section, using SDL as the dependent
variable instead of SDH.
You can re-run an equation by opening the equation in a window, selecting Estimate on the equation
menu bar, and clicking OK. You can re-run the series e equation by clicking the cursor anywhere on the
equation in the command window and hitting Enter on the keyboard.
8
The number 3.55208248072 was computed in Step 7 above.
observations (n) times the R2 from the test regression. Whites test statistic is
asymptotically distributed as a 2 with degrees of freedom equal to the number of slope
coefficients, excluding the constant, in the test regression (five in this example).
Step 4. The critical 2 value can be calculated in EViews by typing the following formula in
the EViews command window: =@qchisq(.95,5).1 After typing the formula and hitting
Enter on the keyboard,
appears in the lower left of the EViews
screen (the same value found in UE, Table B-8). Since the nR2 value of 33.2256393731 is
greater than the 5% critical 2 value of 11.0704976935, we can reject the null hypothesis
of no heteroskedasticity. The probability printed to the right of the nR2 value in the
EViews output for Whites heteroskedasticity test (i.e., 0.000003) represents the
probability that you would be incorrect if you rejected the null hypothesis of no
heteroskedasticity.2 The F-statistic is an omitted variable test for the joint significance of
all cross products, excluding the constant. It is printed above White's test statistic for
comparison purposes.
Remedies for heteroskedasticity: weighted least squares (UE 10.4.1):
Follow these steps to estimate the weighted least squares using REG as the
proportionality factor:
Step 1. Open the EViews
workfile named
Gas10.wf1.
Step 2. Select Objects/New
Object/Equation on
the workfile menu bar,
enter PCON/REG
1/REG REG/REG
TAX/REG in the
Equation
Specification:
window, and click
OK. Note the
coefficients
highlighted in yellow.
c=@qchisq(p,v) calculates the percentile of the 2 distribution . The formula finds the value c such that
the prob(2 with v degrees of freedom is c) = p. In this case, the prob(2 with 5 degrees of freedom is
11.0704976935) =95%. In other words, 95% of the area of a 2 distribution, with v=5 degrees of freedom,
is in the range from 0 to 11.0704976935 and 5% is in the range from 11.0704976935 to (in the tail).
2
The probability value is calculated with the formula =@chisq(x,v), which returns the probability that a
chi-squared statistic with v degrees of freedom exceeds x. To verify this, type the formula
=@chisq(33.2256393731,5) in the EViews command window and read the value of 3.39442964858e-06 on
the lower left of the EViews screen.
1
EViews performs weighted least squares by first dividing the weight series by its mean, then multiplying
all of the data for each observation by the scaled weight series. The scaling of the weight series is a
normalization that has no effect on the parameter results, but makes the weighted residuals more
comparable to the un-weighted residuals. The normalization does imply, however, that EViews weighted
least squares is not appropriate in situations where the scale of the weight series is relevant, as in frequency
weighting.
You can include a consecutive range of lagged series by using the word "to" between the lags. YD(0 to -3) is
equivalent to YD YD(-1) YD(-2) YD(-3).
Testing for serial correlation in Koyck distributed lag models using Durbins h test (UE
12.2.2):
Estimate the Koyck distributed lag model before attempting this section (i.e., Equation EQ02
should already be present in the workfile). To conduct a Durbins h test for UE, Equation 12.11,
follow these steps:
Step 1. Open the EViews workfile named Macro14.wf1.
Step 2. To determine whether the value in parenthesis, in the denominator under the square root sign in
UE, Equation 12.17, is positive, enter the following command in the command window:
scalar denominator=1-eq02.@regobs*(eq02.@stderrs(3)^2).
Press Enter to create a scalar object named denominator. Double click the scalar object icon
named denominator in the EViews workfile and view its value in the left corner of the status bar
(bottom of the EViews window). If the number is positive, continue with the next step; if not,
Durbins h test is not valid.
Step 3. To compute Durbins h test statistic shown in UE, Equation 12.17, enter the following
command in the command window and press Enter:
scalar dhtest=(1-(0.5*eq02.@dw))*sqr(eq02.@regobs/denominator).
Step 4. To view this scalar, double click the scalar object icon named dhtest and view its value in the
left corner of the status bar (bottom of the EViews window). If the number is 1.96, reject the
null hypothesis of no first order serial correlation.
Testing for serial correlation in Koyck distributed lag models using the Lagrangian Multiplier
(LM) (UE 12.2.2):
Estimate the Koyck distributed lag model before attempting this section (i.e., equation EQ02
should already be present in the workfile). To conduct a Lagrangian Multiplier (LM) test for UE,
Equation 12.11, follow these steps:
Step 1. Open the EViews
workfile named
Macro14.wf1.
Step 2. Open the Equation
named EQ02 by
double clicking its
icon in the workfile
window.
Step 3. Select
View/Residuals
Tests/Serial
Correlation LM
Test on the
equation menu bar
(see highlighted
selections in the
graphic on the right).
Step 4. Change the number in the Lags to include: to 1 in the Lag Specification: window.2 Click OK
to reveal the following EViews output:
Breusch-Godfrey Serial Correlation LM Test:
F-statistic
11.77690 Probability
Obs*R-squared
9.414982 Probability
0.001946
0.002152
Test Equation:
Dependent Variable: RESID
Method: Least Squares
Date: 07/01/00 Time: 10:25
Presample missing value lagged residuals set to zero.
Variable
Coefficient
Std. Error
t-Statistic
C
-22.30297
26.12643 -0.853656
YD
0.113797
0.104157
1.092547
CO(-1)
-0.119235
0.110340 -1.080614
RESID(-1)
0.602362
0.175526
3.431748
R-squared
0.303709 Mean dependent var
Adjusted R-squared
0.226343 S.D. dependent var
S.E. of regression
25.75902 Akaike info criterion
Sum squared resid
17915.24 Schwarz criterion
Log likelihood
-142.5581 F-statistic
Durbin-Watson stat
1.630947 Prob(F-statistic)
Prob.
0.4008
0.2842
0.2894
0.0019
3.67E-14
29.28568
9.455361
9.640392
3.925632
0.019027
The null hypothesis of the LM test is that there is no serial correlation up to lag order p, where p
is equal to 1 in this case. The Obs*R-squared statistic is the Breusch-Godfrey LM test statistic.
This LM statistic is computed as the number of observations times the R2 from the test
regression. The LM test statistic is asymptotically distributed as a 2 with p degrees of freedom
(p is equal to 1 in this case).
Step 5. To determine whether the null hypothesis can be rejected in this case, determine the critical
2(1) value from UE Table B-8. The critical 2 value can also be calculated in EViews by typing
the following formula in the EViews command window: =@qchisq(.95,1).3 EViews returns a
scalar value of 3.84. Since the calculated Breusch-Godfrey LM test statistic of 9.42 exceeds the
critical 2(1) value, we can reject the hypothesis of no serial correlation up to lag order 1 at the
95% confidence level. The probability printed to the right of the Obs*R-squared statistic in the
EViews output (i.e., 0.002152) represents the probability that you would be incorrect if you
rejected the null hypothesis of no serial correlation up to lag order 1 at the 95% confidence level.
EViews enters 2 lags by default (i.e., testing for second order serial correlation). We will enter 1 lag to estimate the
LM statistic for UE, Equation 12.20, p. 421.
3
c=@qchisq(p,v) calculates the percentile of the 2 distribution . The formula finds the value c such that the prob(2
with v degrees of freedom is c) = p. In this case, the prob(2 with 1 degree of freedom is 3.84) =95%. In other
words, 95% of the area of a 2 distribution, with v=1 degrees of freedom, is in the range from 0 to 3.84 and 5% is in
the range from 3.84 to (i.e., in the tail of the distribution).
Obs
28
F-Statistic
2.05100
4.57141
Probability
0.13748
0.01291
Step 5. Based on the Probability values reported in the table, the hypothesis that YD does not
Granger Cause CO cannot be rejected, but the hypothesis that CO does not Granger cause YD
can be rejected. Therefore, it appears that Granger causality runs one way, from CO to YD, but
not the other way.5
Testing for nonstationarity by calculating the auto correlation function ACF (UE 12.4.1,
Equation 12.24, p. 425):
Follow these steps to calculate the auto correlation function ACF:
Step 1. Open the EViews workfile named Macro14.wf1.
Step 2. Open CO in one window by double clicking the series icon in the workfile window.
Step 3. To view the Autocorrelation and Partial Correlation, Select View/Correlogram, on the
CO series menu bar and a Correlogram Specification dialog box appears. Select level in the
Correlogram of: window and enter 16 (the EViews default in this case) in the Lag Specification:
lags to include: window, and click OK to reveal the EViews output below.
4
In general, it is better to use more rather than fewer lags, since the theory is couched in terms of the relevance of all
past information. You should pick a lag length that corresponds to reasonable beliefs about the longest time over
which one of the variables could help predict the other.
5
The reported F-statistics are the Wald statistics for the joint hypothesis that the coefficients on the lagged values of
the other variable are zero for each equation (CO in the first equation and YD in the second equation for the table
printed above). In case you want to determine significance by comparing the calculated F statistic with the critical F
value from the F Table, the numerator degrees of freedom are given by the number of coefficient restrictions in the
null hypothesis (i.e., the number of lags) and the denominator degrees of freedom are given by the total regression
degrees of freedom.
If the AC(1) is nonzero, it means that the series is first order serially correlated. If AC(k) dies off more or less
geometrically with increasing lag k, it is a sign that the series obeys a low-order autoregressive (AR) process. If
AC(k) drops to zero after a small number of lags, it is a sign that the series obeys a low-order moving-average (MA)
process. EViews also reports the Partial Correlations (PAC) in the same window. The partial correlation at lag k
measures the correlation of CO values that are k periods apart, after removing the correlation from the intervening
lags. If the pattern of autocorrelation is one that can be captured by an autoregression of order less than k, then the
partial autocorrelation at lag k will be close to zero. The PAC of a pure autoregressive process of order k cuts off at
lag k, while the PAC of a pure moving average (MA) process asymptotes gradually to zero.
Perron (PP) test (select ADF for this example).7 Second, specify whether to test for a unit root in
the Level, 1st difference, or 2nd difference of the series (select level for this example).8 Third,
specify whether to include an Intercept, a Trend and intercept, or None in the test regression.
Select Trend and intercept for this example. To see why, read footnote 18, UE, p. 427. Fourth,
specify the number of lagged first difference terms to add in the test regression (0 for the DF
test). The theory behind each of these selections is beyond the scope of UE and this guide.
Advanced econometrics courses deal with these issues. When finished with the selections click
OK to reveal the following table:
ADF Test Statistic
-1.633006
1% Critical Value*
-4.2826
5% Critical Value
-3.5614
10% Critical Value
-3.2138
*MacKinnon critical values for rejection of hypothesis of a unit root.
Prob.
0.1137
0.0534
0.1003
72.14839
38.54897
10.18860
10.32737
1.688951
0.202992
Step 5. The test fails to reject the null hypothesis of a unit root in the CO series at any of the reported
significance levels, since the ADF Test Statistic9 is not less than (i.e., does not lie to the left of)
the MacKinnon critical values.
EViews refers to both the Dickey-Fuller and the Augmented Dickey-Fuller tests as ADF tests. You will face two
practical issues in performing the ADF test. First, you will have to specify the number of lagged first difference
terms to add to the test regression (selecting zero yields the DF test; choosing numbers greater than zero generates
ADF tests). The usual (though not particularly useful) advice is to include lags sufficient to remove any serial
correlation in the residuals. Second, EViews asks you whether to include other exogenous variables in the test
regression. You have the choice of including a constant, a constant and a linear time trend, or neither in the test
regression.
8
You can use this option to determine the number of unit roots in the series. If the test fails to reject the test in levels
but rejects the test in first differences, then the series contains one unit root and is of integrated order one I(1). If the
test fails to reject the test in levels and first differences but rejects the test in second differences, then the series
contains two unit roots and is of integrated order two I(2).
9
The output reports the ADF Test Statistic, but in reality, it is the DF test statistic, since zero lags were chosen.
10
To use first differencing to rid a series of nonstationarity, simply enter D(CO) for the series in any EViews
procedure. For example, entering D(CO) as the dependent variable in a least squares regression is the same as
entering CO-CO(-1).
Estimating the Weighted Least Squares (WLS) correction for heteroskedasticity in the linear
probability model (UE 13.1.3, pp. 441-442):
To estimate the weighted least squares model specified in UE, Equations 13.7 & 13.8, follow
these steps:
Step 1. Open the EViews workfile named women13.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter J/Z C 1/Z M/Z S/Z in
the Equation Specification: window, and click OK to generate the same coefficients and standard
errors reported in UE, Equation 13.8.
Step 3. Select Name on the equation menu bar, enter EQ02a in the Name to identify object: window,
and click OK.
Step 4. To perform the same analysis using the WLS feature in EViews: select Objects/New
Object/Equation on the workfile menu bar, enter J Z C M S in the Equation Specification:
Options button, check Weighted LS/TSLS and type 1/Z in the Weight:
window, select the
window. Click OK twice to generate the same coefficients and standard errors reported in UE,
Equation 13.8. Note that the coefficient on the Z variable is the constant (i.e., Z*(1/Z) = 1) and
the coefficient on the constant, C, is the coefficient on the variable 1/Z (i.e., C*(1/Z)).
Step 5. Select Name on the equation menu bar, enter EQ02b in the Name to identify object: window,
and click OK.
Step 6. Select Forecast on the equation menu bar, enter JFWLS in the Forecast name: window, and
click OK.
Step 7. Enter the formula series JFWLSP = JFWLS >= 0.5 in the command window and press Enter.
A series named JFWLSP is created that predicts whether a women is expected to be in the labor
force based on the linear probability model. The formula applies the decision rule: JFWLSP is 1
if, the probability value, JFWLSi 0.5 and JFWLSP is 0 if JFWLSi < 0.5.
Step 8. Enter the formula series WLSP =JFWLSP=J in the command window and press Enter to
calculate a series that equals 1 if the WLS model predicted correctly and 0 if not.
Step 9. Enter the formula scalar R2pWLS = @sum(WLSP)/@obs(WLSP) in the command window
and press Enter to calculate the R2p value for the WLS model. Double click the R2pWLS icon to
reveal the percentage of correct predictions from the WLS model (0.83 for this exercise).
Step 10. Select Save on the workfile menu bar to save your changes.
Estimating the binomial logit model (UE 13.2):
To estimate the binomial logit model printed in UE, Equation 13.15, follow these steps:
Step 1. Open the EViews workfile named women13.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar.
Step 3. From the Estimation Settings:, Method: window, select the BINARY - Binary choice (logit,
probit, extreme value) estimation method. The window will change to reflect your choice.
Step 4. There are two parts to the binary model specification. First, in the Equation Specification:
field, you should type the name of the Binary dependent variable followed by a list of regressors
(i.e., enter J C M S in the Equation Specification: window for this example). Second, check logit
as the Binary estimation method: (this is the default setting in EViews). Click OK to run the logit
regression.
Step 5. Select Name on the equation menu bar, enter EQ03 in the Name to identify object: window,
and click OK.
Step 6. Select Forecast on the equation menu bar, enter JFLOG in the Forecast name: window, and
click OK.
Step 7. Enter the formula series JFLOGP = JFLOG >= 0.5 in the command window and press Enter.
A series named JFLOGP is created that predicts whether a women is expected to be in the labor
force based on the linear probability model. The formula applies the decision rule: JFLOGP is 1
if, the probability value, JFLOGi 0.5 and JFLOGP is 0 if JFLOGi < 0.5.
Step 8. Enter the formula series LOGP = JFLOGP=J in the command window and press Enter to
calculate a series that equals 1 if the LOG model predicted correctly and 0 if not.
Step 9. Enter the formula scalar R2pLOG = @sum(LOGP)/@obs(LOGP) in the command window
and press Enter to calculate the R2p value for the LOG model. Double click the R2pLOG icon to
reveal the percentage of correct predictions from the LOG model (0.8 for this exercise).
Step 10. Select Save on the workfile menu bar to save your changes.
The linear probability model results and the binomial logit model results can be compared by
opening both regression equation results in the work area (i.e., double click the EQ01 and EQ03
equation icons in the workfile window.
Estimating the binomial probit model (UE 13.3.1):
To estimate the binomial probit model printed in UE, Equation 13.19, follow these steps:
Step 1. Open the EViews workfile named women13.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar.
Step 3. From the Equation Specification: window, select the BINARY - Binary choice (logit, probit,
extreme value) estimation method. The window will change to reflect your choice.
Step 4. There are two parts to the binary model specification. First, in the Equation Specification:
field, you should type the name of the Binary dependent variable followed by a list of regressors
(i.e., enter J C M S in the Equation Specification: window for this example). Second, check
probit as the Binary estimation method: (logit is the default setting in EViews). Click OK to run
the probit regression.
Step 5. Select Name on the equation menu bar, enterEQ04 in the Name to identify object: window,
and click OK.
Step 6. Select Forecast on the equation menu bar, enter JFPRO in the Forecast name: window, and
click OK.
Step 7. Enter the formula series JFPROP = JFPRO >= 0.5 in the command window and press Enter.
A series named JFPROP is created that predicts whether a women is expected to be in the labor
force based on the linear probability model. The formula applies the decision rule: JFPROP is 1
if, the probability value, JFPROi 0.5 and JFPROP is 0 if JFPROi < 0.5.
Step 8. Enter the formula series PROP = JFPROP=J to calculate a series that equals 1 if the PRO
model predicted correctly and 0 if not.
Step 9. Enter the formula scalar R2pPRO = @sum(PROP)/@obs(PROP) to calculate the R2p value
for the PRO model. Double click the R2pPRO icon to reveal the percentage of correct
predictions from the PRO model (0.8 for this exercise).
Step 10. Select Save on the workfile menu bar to save your changes.
Estimating two-stage least squares regression using EViews TSLS method (UE, 14.3.1):
To estimate the two-stage least squares
model printed in UE, Equation 14.29,
follow these steps:
Step 1. Open the EViews workfile named
Macro14.wf1.
Step 2. Select Objects/New
Object/Equation on the workfile
menu bar, and select TSLS Two-Stage
Least Squares (TSNLS and ARMA) in
the Method: window under Estimation
Settings: and the dialog will change to
include an Instrument list: window (see
graphic on the right).
Step 3. Enter CO C YD CO(-1) in the
Equation Specification: window and C G T NX CO(-1) R(-1) in the Instrument list: window.1
The graphic above shows the relevant selections/entries highlighted in yellow. Click OK to
reveal the Estimation Output view printed below. The yellow highlighted portions of the
regression output reflect the selections made in the dialog window shown above.2
Dependent Variable: CO
Method: Two-Stage Least Squares
Date: 07/10/00 Time: 15:12
Sample(adjusted): 1964 1994
Included observations: 31 after adjusting endpoints
Instrument list: C G T NX CO(-1) R(-1)
Variable
Coefficient
Std. Error
t-Statistic
C
-24.73014
34.90233 -0.708553
YD
0.441638
0.153839
2.870773
CO(-1)
0.540309
0.163000
3.314782
R-squared
0.997890 Mean dependent var
Adjusted R-squared
0.997739 S.D. dependent var
S.E. of regression
30.53734 Sum squared resid
F-statistic
6615.725 Durbin-Watson stat
Prob(F-statistic)
0.000000
Prob.
0.4845
0.0077
0.0025
2445.210
642.2594
26110.82
0.982576
Step 4. Select Name on the equation window menu bar, enter TSLS_CO in the Name to identify
object: window, and click OK.
Step 5. Select Save on the workfile menu bar to save your changes.
1
The constant, C, is always a suitable instrument, so EViews will add it to the instrument list if you omit it.
EViews identifies the estimation procedure, as well as the list of instruments in the header. This information is
followed by the usual coefficient, t-statistics, and asymptotic p-values. EViews uses the structural residuals in
calculating all of the summary statistics. These structural residuals should be distinguished from the second-stage
residuals that you would obtain from the second-stage regression if you actually computed the two-stage least
squares estimates in two separate stages.
Estimating two-stage least squares regression using two distinct stages and OLS (UE, 14.3.1):
To estimate the two-stage least squares equation printed in UE, Equation 14.28, using ordinary
OLS and two distinct phases, follow these steps:
Step 1. Open the EViews workfile named Macro14.wf1.
Step 2. To estimate the reduced form equation for YD (UE, Equation 14.27, p. 480), select
Objects/New Object/Equation on the workfile menu bar, enter YD C G NX T CO(-1) R(-1) in
the Equation Specification: window, and click OK.
Step 3. To generate the forecast values from this equation, select Forecast on the equation menu bar,
enter YDF in the Forecast name: window, and click OK. EViews will create a new variable in
the workfile named YDF.
Step 4. To estimate the second stage equation for CO (UE, Equation 14.29, p. 481), select
Objects/New Object/Equation on the workfile menu bar, enter CO C YDF CO(-1) in the
Equation Specification: window, and click OK. Note that we have used the instrumental variable
YDF instead of the actual variable YD for disposable income. The method, dependent variable,
and variable names are highlighted in yellow in the OLS regression output shown below.
Step 5. Select Name on the equation window menu bar, enter TSLS_OLS_CO in the Name to
identify object: window, and. click OK.
Step 6. Select Save on the workfile menu bar to save your changes.
Dependent Variable: CO
Method: Least Squares
Date: 07/05/00 Time: 15:44
Sample(adjusted): 1964 1994
Included observations: 31 after adjusting endpoints
Variable
Coefficient
Std. Error
t-Statistic
Prob.
C
YDF
CO(-1)
-24.73014
0.441638
0.540309
41.09577
0.181138
0.191924
-0.601769
2.438126
2.815219
0.5522
0.0214
0.0088
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
Durbin-Watson stat
0.997075
0.996866
35.95622
36199.78
-153.4608
1.485932
2445.210
642.2594
10.09425
10.23302
4771.906
0.000000
Exercises:
9. Open EViews and open the EViews workfile named Macro14.wf1.
a. Refer to Estimating CO with least squares.
b. Refer to Step 2 of Estimating two-stage least squares regression using two distinct stages
and OLS.
c. Refer to Steps 3 & 4 of Estimating two-stage least squares regression using two distinct
stages and OLS.
d. Refer to Estimating two-stage least squares regression using EViews TSLS method.
12. Double click the
icon in the EViews Macro14.wf1 workfile window to reactivate the UE, Equation 14.29. Click Estimate on the equation menu bar and click OK.
The reason for this is to make sure that the residuals in the EViews workfile are from the
icon is not in the workfile, you must go back and
TSLS_CO equation. If the
follow the steps outlined in Estimating two-stage least squares regression using EViews
TSLS method.
a. Follow the procedures outlined in Chapter 9.
b.
13. Open EViews and open the EViews workfile named Oats14.wf1.
a.
b.
c.
d. Refer to Estimating CO with Least Squares (OLS) and Estimating two-stage least squares
regression using EViews TSLS method.
e. Refer to Comparing the OLS, EViews TSLS, and OLS two-stage models.
1995
1996
1997
Y
80.30000
81.90000
83.70000
PC
6.500000
6.700000
7.700000
PB
61.80000
58.70000
63.10000
YD
200.6200
208.5000
216.3100
Step 6. Select Objects/New Object/Equation on the workfile menu bar, enter Y C PC PB YD in the
Equation Specification: window, change the Sample: to 1951 - 1994, and click OK.1
Step 7. Select Name on the equation window menu bar, enter EQ01 in the Name to identify object:
window, and click OK.
Step 8. Select Forecast on the equation menu bar, enter YFOLS in the Forecast name: window, set
the Sample range to forecast: to 1951 1997, and click OK.
Step 9. Open YFOLS & Y in a group window by holding down the Ctrl button, clicking on YFOLS
& Y, selecting Show from the workfile toolbar, and clicking OK. Scroll to the bottom of the
group spreadsheet and make sure that it looks like the table below. Note that the predicted values
for YFOLS in the EViews spreadsheet are a slightly different than those in the UE, p. 502 table,
because the text uses rounded coefficient values for Equation 6.8 and we used non-rounded
EViews estimated coefficients.
1995
1996
1997
YFOLS
80.71830
82.06108
83.65985
Y
80.30000
81.90000
83.70000
Step 10. Select Save on the workfile menu bar to save your changes.
Forecasting chicken consumption using a generalized least squares model estimated with the
AR(1) method (UE, 15.2.2):
Complete the section entitled Forecasting chicken consumption using OLS before attempting this
section. The OLS estimate for chicken consumption should already have been estimated and
saved as EQ01 in the Chick6.wf1 workfile and the workfile range & sample should have been
expanded to 1997 and the data for 1995 - 1997 entered into the workfile spreadsheet.
Step 1. Open the EViews workfile named Chick6.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter Y C PC PB YD AR(1)
in the Equation Specification: window, change the Sample: to 1951 - 1994, and click OK.
Step 3. Select Name on the equation window menu bar, enter EQ04 in the Name to identify object:
window, and click OK.
Step 4. Select Forecast on the equation menu bar, enter YFAR1 in the Forecast name: window, set
the Sample range to forecast: to 1951 1997, and click OK.
Step 5. Open YFAR1 & Y in a group window by holding down the Ctrl button, clicking on YFOLS
& Y, selecting Show from the workfile toolbar, and clicking OK. Scroll to the bottom of the
group spreadsheet and make sure that it looks like the table below.
YFAR1
Y
1995 80.05606 80.30000
1996 81.67044 81.90000
1997 83.85621 83.70000
Step 6. Select Save on the workfile menu bar to save your changes.
1
The reason for changing the workfile sample back to the original setting is to ensure that the equation estimation
uses only the data in the original sample (i.e., 1951-1994).
Forecasting chicken consumption using a generalized least squares model estimated with the
Cochrane-Orcutt method(UE, 15.2.2):
The Cochrane-Orcutt method is a multi-step procedure that requires re-estimation until the value
for the estimated first order serial correlation coefficient converges. Follow these steps to use the
Cochrane-Orcutt method to estimate a GLS model for chicken consumption. If you have
questions concerning the procedure, review the appropriate section of Chapter 9. Complete the
section entitled Forecasting chicken consumption using OLS before attempting this section. The
OLS estimate for chicken consumption should already have been estimated and saved as EQ01
in the Chick6.wf1 workfile and the workfile range & sample should have been expanded to 1997
and the data for 1995 - 1997 entered into the workfile spreadsheet.
Step 1. Open the EViews workfile named Chick6.wf1, select Sample on the workfile menu bar,
change the End date from 1997 to 1994, and click OK.
Step 2. Open EQ01 by double clicking its icon in the workfile window. Create a new series for the
residuals (errors) for EQ01, by selecting Procs/Make Residual Series on the EQ01 window
menu bar, enter the name E as the Name for residual series, and click OK.
Step 3. Select Objects/New Object/Equation on the workfile menu bar. Enter E C E(-1) in the
Equation Specification: window and click OK. The coefficient on the E(-1) term (i.e., ), is
positive and significant at the 1% level (t-statistic = 3.69 and Prob value = 0.0006). This
evidence points to positive serial correlation. Select Name on the equation menu bar, enter EQ02
in the Name to identify object: window, and click OK.
Step 4. Select Objects/New Object/Equation on the workfile menu bar, enter YEQ02.@COEFS(2)*Y(-1) C PC-EQ02.@COEFS(2)*PC(-1) PB-EQ02.@COEFS(2)*PB(-1) YDEQ02.@COEFS(2)*YD(-1) in the Equation Specification: window, and click OK. Select Name
on the equation menu bar, enter EQ03 in the Name to identify object: window, and click OK.2
Step 5. Calculate the new residual series by typing the following formula in the command window:
series E = Y-(EQ03.@COEFS(1) + EQ03.@COEFS(2)*PC + EQ03.@COEFS(3)*PB +
EQ03.@COEFS(4)*YD) and pressing Enter on the keyboard.
Step 6. Re-run EQ02, EQ03 and the series E equation3 in step 5 sequentially until the estimated (i.e.,
the coefficient on the E(-1) term from EQ02) does not change by more that a pre-selected value
such as 0.001. After 6 iterations, the value for converged (i.e., changed from 0.902484 to
0.902802 between the 5th and 6th iteration).
Step 7. Convert the constant from the final version of EQ03 by typing the following formula in the
command window: scalar beta0=EQ03.@COEFS(1)/(1-EQ02.@COEFS(2)) and pressing Enter
on the keyboard.
icon in the workfile window and read the value, 26.72580, for the
Step 8. Double click the
estimated constant in the lower left of the screen. The final GLS equation for chicken
consumption is Y = 26.72580 - 0.109891*PC + 0.090293*PB + 0.242032*YD, similar to the
truncated coefficient model printed in UE, Equation 9.22, p. 507.
2
Note that the variable names are truncated in the EViews regression output table because they don't fit in the
variable name cell. Nonetheless, the regression is correct. The equation, with the entire variable names printed out,
can be viewed by selecting View/Representations on the equation menu bar.
3
You can re-run an equation by opening the equation in a window, selecting Estimate on the equation menu bar and
clicking OK. You can re-run the series e equation by clicking the cursor anywhere on the equation in the command
window and hitting Enter on the keyboard.
Step 9. Select Sample on the workfile menu bar and change the End date from 1994 to 1997. Open
EQ03 and select Forecast on the equation menu bar. Make sure that Y is checked in the Forecast
of: window. Change the Forecast name: to
YFGLS. Check to make sure that the Sample
range to forecast: is set to 1951 1997, and
click OK (see graphic on the right).
Step 10. Open YFGLS & Y in a group window by
holding down the Ctrl button, clicking on
YFGLS & Y, selecting Show from the
workfile toolbar, and clicking OK. Scroll to
the bottom of the group spreadsheet and
make sure that it looks like the table below.
1995
1996
1997
YFGLS
80.05495
81.66931
83.85514
Y
80.30000
81.90000
83.70000
Step 6. Select Procs/Make Residual Series on the EQ01 window menu bar. Enter the name E as the
Name for residual series, and click OK.
Step 7. Generate a new series for the residuals squared (i.e., E2) by selecting Genr on the workfile
menu bar, entering the equation: E2=E^2 in the Enter equation: window, and clicking OK.
Step 8. Generate a new series named XDEV2 for the residuals squared by selecting Genr on the
workfile menu bar, entering the equation: XDEV2=(x-@mean(x))^2 in the Enter equation:
window, and clicking OK.
Step 9. To calculate the upper confidence interval for the 6'1" student, type the following formula (all
one equation) in the command window, and press Enter on the keyboard:
scalar YF_HIGH=Yf(21)+((@sum(E2)/@obs(E2)*(1+(1/@obs(E))+((X(21)@mean(X))^2/@sum(XDEV2))))^.5)*@qtdist(.975,(eq01.@regobs-eq01.@ncoef))
Double click YF_HIGH in the workfile window to view the upper confidence interval in the
lower left of the screen (i.e.,
).
Step 10. To calculate the lower confidence interval for the 6'1"student, type the following formula
(all one equation) in the command window and press Enter on the keyboard:
scalar YF_LOW=Yf(21)-((@sum(E2)/@obs(E2)*(1+(1/@obs(E))+((X(21)@mean(X))^2/@sum(XDEV2))))^.5)*@qtdist(.975,(eq01.@regobs-eq01.@ncoef))
Double click YF_LOW in the workfile window to view the upper confidence interval in the lower
left of the screen (i.e.,
)
Forecasting with simultaneous equation systems (UE 15.2.4):
EViews has a Type of Object: named Model that enables you to solve a system of simultaneous
equations and use the model for forecasting and simulation. EViews models do not contain
unknown coefficients to be estimated. Instead, the Model object allows you to solve for
unknown values for the endogenous variables. For a description of various methods of creating
model objects in EViews and techniques for using these objects to forecast and perform
simulations see Help/Contents/Hypothesis Testing and Forecasting/Model Solve (Forecast
and Simulation).
This topic is beyond the scope of this guide but, if you were to do it, you would follow these
steps to forecast with a simultaneous equation model:
Step 1. Create a model by selecting Object/New Object/Model in the main toolbar, type in a name
for your model in the Name for Object: window, click OK, and enter the previously estimated
equations in the model window.
Step 2. To solve the model, simply select the Solve button in the model toolbar. You should see the
Model Solution dialog box offering various options for controlling the solution process. EViews
solves for the endogenous variables, given data for the exogenous variables.
UE did not present an example of ARIMA estimation, but one will be estimated here to
demonstrate how to estimate an ARIMA model in EViews. In Chapter 12 we determined that CO
was integrated order one and probably followed an AR(1) process. For purposes of illustration,
follow these steps to estimate an ARIMA(1,1,2)4 model for CO:
Step 1. Open the EViews workfile named Macro14.wf1.
Step 2. Select Objects/New Object/Equation on the workfile menu bar, enter D(CO) C AR(1)
MA(1) MA(2) in the Equation Specification: window, and click OK to view the EViews
Estimation Output printed below.
Dependent Variable: D(CO)
Method: Least Squares
Date: 07/15/00 Time: 10:35
Sample(adjusted): 1965 1994
Included observations: 30 after adjusting endpoints
Convergence achieved after 100 iterations
Backcast: OFF (Roots of MA process too large for backcast)
Variable
Coefficient
Std. Error
t-Statistic
C
67.74008
3.655560
18.53070
AR(1)
0.718868
0.251279
2.860836
MA(1)
-0.943222
0.362834 -2.599598
MA(2)
-0.773132
0.292764 -2.640801
R-squared
0.588152 Mean dependent var
Adjusted R-squared
0.540631 S.D. dependent var
S.E. of regression
26.57083 Akaike info criterion
Sum squared resid
18356.23 Schwarz criterion
Log likelihood
-138.8161 F-statistic
Durbin-Watson stat
2.201209 Prob(F-statistic)
Inverted AR Roots
.72
Inverted MA Roots
1.47
-.53
Estimated MA process is noninvertible
1995
1996
1997
1998
COF
3536.473
3604.213
3671.953
3739.694
ARIMA(1,1,2) represents a model that has a first order autoregressive term (i.e., AR(1)), is integrated order one
and has two moving average terms (i.e., MA(1) & MA(2)).
Exercises:
2.
a.
b. Refer to Running a simple regression for Woody's Restaurants example to estimate
Equation 3.7 and Forecasting chicken consumption using OLS to make an unconditional
forecast of the gross sales volume at the three proposed restaurant sites.
c. Open the EViews workfile named Fish8.wf1, select Objects/New Object/Equation on
the workfile menu bar, enter F C PF/PB log(YD) P in the Equation Specification:
window, and click OK. Then follow the steps in Forecasting chicken consumption using
OLS to make an unconditional forecast of F for 1971-1974, given the numbers printed in
the table in UE, Exercise 2c, p.517.
3. Open the EViews workfile named Htwt1.wf1, select Objects/New Object/Equation on the
workfile menu bar, enter Y C X in the Equation Specification: window, and click OK. Ask
three students their height (X=the height in inches exceeding 5'). Then follow the steps in
Forecasting chicken consumption using OLS to make the Unconditional forecast of the
weight (YF) for each student in your sample. Ask these students their actual weight (Y) and
compare Y with YF.
4.
a. Follow the steps in Forecasting confidence intervals to calculate the 95% confidence
interval for the weight for a person standing 5'9" tall (i.e., X = 9).
b.
6. Follow the steps in Chapter 1 for each part of this exercise.
The EViews output shows a histogram of the data series plus major descriptive statistics. The
histogram divides the series range (the distance between the maximum and minimum values)
into a number of equal length intervals or bins and displays a count of the number of
observations that fall into each bin. The histogram is useful when investigating the distributional
characteristics of a series (see UE 16.2).
The descriptive statistics window on the right of the graphic displays the standard descriptive
statistics. All of the statistics are calculated using observations in the current sample. The top of
the window identifies the series name, sample, and the number of observations. The descriptive
statistics described in UE 16.1 are presented next and they are defined as follows:
1. Mean (the average value of the series, obtained by adding up the series and dividing by the
number of observations)
2. Median (the middle value (or average of the two middle values) of the series when the values
are ordered from the smallest to the largest)
3. Maximum (the maximum value of the series in the current sample)
4. Minimum (the minimum value of the series in the current sample)
5. Std. Dev. (standard deviation) is a measure of dispersion or spread in the series
Individual scalar values for the following descriptive statistics1 can be obtained by typing the
functions, printed in the first column of the table below, in the command window, and pressing
Enter. The values can be viewed on the status line in the lower left portion of the screen.
Function
=@obs(Y1997)
=@mean(Y1997)
=@median(Y1997)
=@min(Y1997)
=@max(Y1997)
=@stdev(Y1997)
=@sum(Y1997)
=@sumsq(Y1997)
=@var(Y1997)
=@var(Y1997)*(@obs(Y1997)/(@obs(Y1997)-1))
Name
number of observations
mean
median
minimum
maximum
sample standard deviation
sum
sum-of-squares
variance
sample variance =@stdev(Y1997)^2
Note that EViews calculates the population variance, which is a biased measure of the population
variance in samples. Since the variance is calculated as the sum of the squared deviations of a
series observations about its mean divided by the number of observations (i.e., divided by n
instead of an unbiased estimator, which divides by n-1), it is better to calculate the sample
variance as the square of the unbiased sample standard deviation {i.e., =@stdev(Y1997)^2}. Due
to the way EViews calculates variance, think of the variance as the square of the standard
deviation instead of the other way around.
The variable Y1997 is used for demonstration purposes so you can try it out in the Mutual16.wf1 workfile.
Substitute any variable name, for Y1997, to calculate the statistic for that variable in a workfile. Other measures
obtainable by EViews commands can be found in Help/Function Reference under the heading: Descriptive
Statistics Functions.
The remaining four numbers displayed in the descriptive statistics window (see the graphic on
the first page) are defined below:
1. Skewness (the skewness of a symmetric distribution, such as the normal distribution, is zero)
2. Kurtosis (the kurtosis of the normal distribution is 3)
3. Jarque-Bera test (under the null hypothesis of a normal distribution, the Jarque-Bera statistic
is distributed as 2 with 2 degrees of freedom
4. Probability (the probability that a Jarque-Bera statistic exceeds the observed value under the
null indicates that a small probability value leads to the rejection of the null hypothesis of a
normal distribution)
These measures of normality are not discussed in UE but the normal distribution and its
properties are described in UE 16.2.5, pp. 539 - 543.
The same descriptive statistics can be calculated for a group of variables, sans the histogram, by
opening a group of variables in one window and selecting View/Descriptive
Statistics/Histogram and Stats on the workfile menu bar.
Probability distributions (UE 16.2):
EViews enables you to calculate the cumulative distribution density (CDF or inverse CDF) or
probability functions, cumulative distribution, and random number generators for 17 statistical
distributions. We have already used EViews to calculate the critical t-value for t-tests (see
Chapter 5 and Calculating a confidence interval for a population mean) and generated random
numbers for the Monte Carlo Simulation to demonstrate that the estimated s are drawn from a
normal distribution (see Chapter 4). Further discussion of this topic is beyond the scope of this
guide, but further a explanation of EViews capabilities relating to statistical distribution
functions can be found in Help/Function Reference.
Standardized variables (UE 16.2.4):
Complete Steps 1 & 2 of Describing data prior to attempting this section. To calculate the
standardized values for Y1997, follow these steps:
Step 1. Open the EViews workfile named Mutual16.wf1.
Step 2. Type series Y1997standized = (y1997-@mean(Y1997))/@stdev(Y1997) in the command
window and press Enter on the keyboard. Y1997standized successfully computed. will appear in
the status line in the lower left of the screen.
Step 3. To view the standardized values for Y1997, double click the Y1997standized series icon in
the workfile menu.
Calculating a confidence interval for a population mean (UE 16.4.6):
Complete Steps 1 & 2 of Describing data before attempting this section. To calculate the 95%2
confidence interval for the population mean of Y1998:
2
To compute the 99% confidence interval, substitute .995 for .975 in Step
Value
-7.509381
Probability
0.0000
EViews prints values for the: Test of Hypothesis: Mean, Sample mean, Sample Std. Dev., tstatistic: Value (based on the formula for t printed in UE, p. 558), and Probability. The t-statistic
value of -7.509381 is equal to the value printed in UE, p. 558. This value can be compared with
the critical t-value found in the UE, Table B-1 using the one-tailed or two-tailed test at various
levels of confidence. The reported Probability is the p-value, or marginal significance level,
against a two-sided alternative. If this probability value is less than the size of the test, say 0.05,
we reject the null hypothesis (i.e., Mean = 28.10000). The probability value for a one-sided
alternative is one-half the p-value of the two-sided test.
You can enter a value for the series standard deviation in the window under Mean Test Assumption:, if it is known.
If unknown, leave the window blank and EViews will use the sample standard deviation in the test calculation.
Exercises:
3. Follow the steps in Describing data to calculate the mean and standard deviation.
10. Follow the steps in Describing data to create a workfile for the problem. Then follow the
steps in Calculating a confidence interval for a population mean to calculate the 99%
confidence interval (check footnote 2). You could also answer this problem by following the
procedures in Hypothesis testing, the test statistic, and statistical significance.
13. Follow the steps in Describing data to create a workfile for the problem. Then follow the
steps in Hypothesis testing, the test statistic, and statistical significance to calculate the tvalue and probability that the sample is drawn from a population with a mean value of 11.2.