22.02.2007/01.03.2007
In this classes we will learn about some basic features of Eviews. This classes are meant to be just introduction to Eviews, not a full description of the program. Data for the classes are on the web pages www.wne.uw.edu.pl/ ~krosiak and www.wne.uw.edu.pl/~pwojcik and in EViews installation di- rectory (U:/Program Files/Eviews/Example Files/Data). You should copy the following ﬁles: demo.wf1, demo.xls and macromod.wf1 into chosen folder. Data description of DEMO workﬁle: M1– money supply, GDP–gross domestic prod- uct, RS– short term interest rate, PR–price level
1.1 Getting data into Eviews
There are two ways of opening Excell workﬁles in Eviews:
1. drag-and-drop the ﬁle onto the Eviews icon
2. File/Open/Eviews workﬁle ...
1.1.1 Opening an existing Workﬁle
If you saved the above mentioned workﬁles, you can easily open them by File/Open/Eviews workﬁle (ctrl+O command)→ desired ﬁle: demo.wf1
1.1.2 Opening an Excel ﬁle
You may drag-and-drop the ﬁle onto the Eviews icon or click on File/Open/Eviews
workﬁle ...
→ Files of types: Excel → desired ﬁle: demo.xls
1
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
Eviews opens the Excel Read wizard. There are two steps, generally you can choose default settings. If preview window does not correctly display your data, then choose other options available on the second page of wizard.
When you click Finish, eviews will create a new workﬁle, displaying the group of variables imported from Excel ﬁle. You may check them, compare with the original Exel ﬁle and create a group of those variables. To do this, click on Name, give some name of the group and accept by clicking OK.
Now, to work further with the workﬁle, you should save it. Do it now.
2
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
1.1.3 Creating a new Workﬁle
Click on File/New/Workﬁle and ﬁll in the Workﬁle structure type dialog box and the Date speciﬁcation (for example, choose Dated-regular frequency and Fre- quency: Quarterly). Then you have to specify ﬁrst and last date in your sample (choose 1952:1 and 1996:4 respectively). Click OK.
Notice:
1. The workﬁle window displays two pairs of dates: one of the range of dates contained in the workﬁle, and the second for the current workﬁle sample.
2. The workﬁle contains the coeﬃcient vector C and the series RESID. All Eviews workﬁles will contain these two objects.
Now, you may create new objects by clicking right mouse button and choosing
New Object ...
You will see the main object types available in Eviews. You will
learn about them in more details later. You may also import Excel-ﬁle: click on
Proc/Import/Text-Lotus-Excel...,
locate the demo.xls and double click on the ﬁle
name. Fill in the new dialog box (see below) and click OK.
1.2 Basic data analysis
To open the default spreadsheet view of the series, simply double click one of the series. You can now use several entries of the View and Proc menus to analyse
3
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
several characteristics of the series. Explore the contents of the View and Proc menus in the chosen series window. Try for example the following commands:
View/Descriptive statistics/Stats Table ... View/Graph/Line ...
...
Task: Anwser the question, whether according to Jarque-Bera test is GDP normally distributed?
You can create new series, which is the function of the existing series. For
example, let us create natural logarithm of GDP series. To do this write in the command line:
genr log gdp=log(gdp) Now you can work with that new series. Try the further commands from the View and Proc menus, for example:
View/Descriptive statistics/Histogram and Stats ... View/Distribution/Empirical Distribution Tests ... ... Task: Show the correlogram of the natural logarithm of GDP. You can create group of new series without creating new series in the workﬁle. For example to create group that contains natural logarithms of the series M1
and GDP, the level of RS and ﬁrst diﬀerence of natural logarithm of PR, write in the command line:
show log(m1) log(gdp) rs dlog(pr)
Now you can work with the group similar as with the single series. Note
that the entries for group object diﬀer from those for a series object. Try to plot
the group: View/Graphs/Line
or display table of descriptive statistics for each
Explore
... of the series in the group: View/Descriptive Stats/Individual Samples other entries. Task: Show the correlation matrix of the series in the group.
...
4
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
1.3 Regression estimation
We will estimate the following model for M1, using data over the period from
1952Q1-1992Q4
log(M1 _{t} ) = α _{0} + α _{1} log(GDP _{t} ) + α _{2} RS _{t} + α _{3} ∆log(PR _{t} ) + _{t} . (1)
To open the estimation dialog box select Quick→Estimate Equation
and
... enter the equation speciﬁcation. List ﬁrst dependent variable, then C if you want to include constant in the regression and then expressions for each of the independent variables. Then you should choose the Method of estimation (de- fault is least squares method) and Sample. Change text in that box to „1952Q1
1992Q4“.
Click OK to estimate the equation and display estimation results. To display
a graph of actual and ﬁtted values of dependent variable, along with residu-
als select: View/Actual,Fitted, Residual/Actual,Fitted, Residual Graph
...
You can
choose other view of your equation. Task: Display coeﬃcient covariance matrix. You can save created equation object. To do this, click on Name, give some name of the equation and accept by clicking OK.
1.4 Hypotheses testing
You can now easily perform several hypotheses using the estimated equation.
Wald test
View/Coeﬃcient test/Wald–coeﬃcient Restrictions
...
and enter the
restriction (example C(2)=1) Note: Coeﬃcients are assigned in the order that the variables appear in the speciﬁcation, for example coeﬃcient for PR term is labeled C(4).
5
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
Breusch-Godfrey test for serial correlation in the residuals View/Residual Tests/Serial Correlation LM Test ...
1.5 Equation modiﬁcation
The tests results suggest that you should modify the equation to take into account the serial correlation. To edit the speciﬁcation click Estimate.
Adding new variables
Now you can add lags of the variables:
log(m1(−1))
log(gdp(−1))
rs(−1)
dlog(pr(−1))
Click OK to estimate new speciﬁcation. Task: Save this equation.
Including ARMA terms Other common method of accounting for serial correlation is to include AR and MA terms in the equation. To estimate the equation with AR(p) or MA(q) error speciﬁcation enter ar(p) or ma(q) terms at the end of equation speciﬁcation. Do the following steps:
1. Copy the equation: Object/Copy Object ...
2. Give the name of the new equation: you know how
3. Edit the copied equation: you know how
4. Modify the equation: you know how
5. Estimate and analyse the new equation: you know how
You should receive the following results:
Task: Basing on Akaike and Schwarz information criteria, compare the two models and choose better one.
6
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
1.6 Forecasting
Click on Forecast. You will see the followin dialog box:
You should choose the variable to forecast (logarithm of M1 or M1), provide the names for forecast series, forecast standard errors (if you want to create them and save in the workﬁle), forecast method, forecast sample and what you want to display as output. If you choose dafault options for output and then click OK, you will see graph of forecasts and statistics evaluating quality of the ﬁt to the actual data. Task: Display on the same line graph M1 and the forecast of M1.
Now open the workﬁle named CS.wf1. To display data description click on Details+/−.
2.1 System speciﬁcation
To create the system of equations click on Object/New Object
/System and
... give some name of your system in the Name for object box (you can also type
system in the command line).
Enter your equations, by formula, using standard EViews expressions. For example consider two equation system:
7
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
Key rules for specifying equations:
–Equations can be nonlinear in variables, coeﬃcients, or both.
y=c(1)+c(2)*x^2+z^c(3)
–You may impose cross equation coeﬃcient by using the same coeﬃcients in diﬀerent equations.
y=c(1)+c(2)*x
z=c(3)+c(2)*w+(1-c(2))*x
–You may impose adding up constaraints.
y=c(1)*x+c(2)*z+(1-c(2)-c(3))*w
–Equations may contain AR error speciﬁcations.
y=c(1)+c(2)*x+[ar(1)=c(3)]
2.2 System estimation
Once you created and speciﬁed your system of equations, you can estimate it, simply by clicking on Estimate button. In the System Estimation dialog box you should select Method of estimation and Sample.
Click OK to display estimation results.
8
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
2.3 Examining the system
View Generally system view is similar to view of single equation object. You may, for example, perform hypothesis tests on the coeﬃcients, display graph of residuals, graph endogenous variables etc.
Task: Perform Wald test to check if GDP coeﬃcients are equal in both equations.
Procs
Task: Create a new group containing the two series of residuals from
the system of equations. Check for cross correlations in the residuals.
Open the workﬁle named MACROMOD.wf1 Task: Identify the speciﬁcations of equations in the workﬁle and analyse their ﬁt to the data.
3.1 Model speciﬁcation
Having estimated the equations, you can easily create model. Select Object/New
Object
...
/Model
enter the name of the model and click OK to save it. To add
stochastic equations to the model, simply copy and paste them. Select the equa- tions in the workﬁle window, then ctrl+c, click anywhere in the model object window and use ctrl+v. Double clicking on any equation will bring up a dialog
box of properties of that equation. The equations are inserted as links. That means if you reestimate any eqaution, you should update the equations in the model by using Proc/Links/Update All Links-Recompile model.
To add the identity, click the right mouse botton anywhere in the model
window and select Insert
In the displayed dialog box simply type the identity:
Click OK. The model speciﬁcation is complete.
9
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
3.2 Model solving
To solve the model click on Solve in the model window. There is many options available from the dialog box, but now you should use the basic settings. Set the sample to 1960q1 to 1999q4 and use default options. Click OK to start calculations.
View Select View/Variables to display variables from the model. The lines contain the icons indicating the variable type, the name of the variable, the associated equation and the description of the variable.
Procs For example, to display on the line graph actual and ﬁtted values of endogenous variables in the model, simply select the four variables (by holding down the control key and clicking on he variable names), then select Procs/Make
Graph
In the dialog box check Actuals and set the Sample for graph to 1960q1
... to 1999q4 and click OK.
Task: Save the graph.
3.3 Specifying scenarios
The last exercise today is to examine how the model bahaves under some as- sumptions with respect to the exogenous variables. EViews provides a simply
tool to carry out such an exercise. Using View/Scenarios
you can override a
... subset of the exogenous variables in a model to give them new values, while using the values stored in the actual series for the remaider of the variables. To add new scenario, click on Create New Scenario botton.
Once you have created the scenario, you can modify the scenario from the baseline case by overriding one of your exogenous variables. To do this, return to the variable window of the model, click on the variable M, use the right mouse button to call up the Properties dialog box for the variable, and then in the Scenario box, click on the checkbox for Use override series in scenario. A message will appear asking if you would like to create the new series.
10
Katarzyna Lada, Piotr Wójcik
Macroeconometrics 2007
Click on Yes to create the series, then OK to return to the variable window. In the variable window, the variable name M should now appear in red, indicating that it has been overridden in the active scenario. This means that the variable M will now be bound to the series M 2 instead of the series M when solving the model. To contract the money supply over the period 1990q1 to 1999q4, you can simply use the following lines of commands:
smpl 1990q1 1999q4 m 2=500
smpl
@all
Task: Solve the scenario 2 of the model. Once the solution is complete, you can compare the results obtained for
unrestricted and restricted money supply. Go back to variable view, check the
exogenous variables and use Proc/Make Graph
to display the results. Check
... both the Active and Compare solution checkboxes, making sure that the active scenario is set to Scenario 2, and the comparison scenario is set to Baseline. Set
the sample to 1980Q1 to 1999Q4. Task: According to the model, how the cut in money supply aﬀects the in- terest rates, invetment, income and consumption?
PLEASE, LEARN MORE ABOUT THE ABOVE MENTIONED TOPICS READING CHAPTERS 2, 23 AND 26 OF Eviews 5 User’s Guide.
11