2822 introduction to eviews 2004

Upload: al-shami-hamdan

Post on 06-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 2822 Introduction to EViews 2004

    1/17

    Introduction to EViews 5.0

    Prof. Anthony D. Becker

    Department of Economics

    St Olaf College

    Friday, September 09, 2005

    INTRODUCTION

    EViews is a Windows-based, advanced econometric analysis package that is used in Econ 385 -

    Econometrics. The program files forEViews are on the campus microcomputer network and can

    be accessedfrom any networked Windows computer on campus.

    Because we have only one set of complete manuals, this document will provide some basic

    instructions for usingEViews. As you use the program, experiment with the commands

    presented here and try other commands and options to learn about the system. You cannot causeany damage by experimenting. If you get stuck or have any questions, please talk to me. Your

    questions are an important part of the process of learning to useEViews.

    EachEViews menu command will prompt you for its required information. You should try

    clicking on the various windows logos to learn how they work. Like most Windows programs,EViews has a good help facility available from the menu at the top of the page. Using the help

    files can provide answers to specific questions about the parts ofEViews that you need to use.The combination of specific instructions in this document, your personal exploration, and

    reference to theEViews User's Guide (on-line as described below), and the help files should

    provide sufficient material for you to learn how to useEViews. Ask questions of both your

    classmates and of me when something is not clear or does not work as you think it should. Inmany cases one of your classmates will already have solved the problem.

    You are responsible for learning how to use EViews.

    EVIEWS BASICS

    In this document, the following conventions will be used.

    The names of computer files will be in boldface, Times Roman: for example, arms

    data.wf1

    The names of data series (variables) in EViews will be in Arial: mexicoexrate

    Words and commands you type at the keyboard will be in Courier: money

    Commands from a menu will be in italics; a greater-than sign will connect a series ofchoices:File > Save As

    Important words and concepts will be underlined: work file

  • 8/3/2019 2822 Introduction to EViews 2004

    2/17

    Introduction to EViews Page 2 of

    Two otherEViews documents are available on-line through the Application Explorer (Start > St.Olaf Apps > Economics). TheEViews Users Guide is the complete users guide forEViews; itcovers everything. A second document, theEViews Command Reference, gives the structure of

    all commands in EViews. Do not overlook theEViews help files as they cover almost all of the

    materials in the two guides.

    As with all handouts in this class, this document is available in the Class Materials Directory.

    Look in L:\2005-06 Semester 1\economics-385\Class Materials\ forIntroduction to EViews

    2004.pdfand Introduction to EViews 2004.doc.

    Starting EViews:

    There are a number of ways to startingEViews. For example, with any College-owned Windows

    PC, you can click on Start > St. Olaf Apps > Economics >EViews. You can also double-click

    on "My Computer," double-click on the P: drive, then Apps, and then EViews5. (That is,navigate to P:\>Apps>EViews5.) Look forEViews5.exe and double-click it to launch EViews.

    EViews Files and Logic:

    EViews organizes data, graphs, output, etc. as objects. Each of these objects can be copied,

    saved, cut-and-pasted into other Windows programs, or used for further analysis. Thus each

    object can be thought of as a piece of paper in your workspace that represents a specific task orresult in a larger project. Many of these objects will need to be discarded because they are not

    important results and you need to avoid too much clutter. Important and intermediate objects can

    be saved together in anEViews work file. Important objects may be copied into other Windowsprogram using cut-and-paste. You can use more than one work file at a time and can copy

    objects between them. Our version ofEViews also lets work files have multiple pages in muchthe same way that a Microsoft Excel file can have multiple pages. This feature lets you have

    data in multiple frequencies in the same work file.

    Work files should be saved regularly. I also strongly recommend that you maintain copies of all

    your work files on your personal network space and maybe even on a floppy disk, zip disk, etc.

    One should practice safe computing at all times.

    In addition to the work file, you will also useEViews databases in some projects. A database is

    where we can store a large number of objects (usually data) for selective access. For example,

    we will use a database of U.S. macroeconomic time series called the Haver Analytics Database.It contains data on over 17,000 variables. If we need only data on GDP=C+I+G+NX, why

    should we read in all 17,000? We shouldnt. Well useEViews database feature to fetch only

    the variables we need into our work file. There are a variety of database formats that EViewscan read. The two we will use most often are EViews (.edb) and RATS (.rat) formats.

    Most of the data entry, statistical estimation, graphing, etc. will be done with menu commands

    just like all other Windows programs. However, not all menus are accessed at the top of thewindow when usingEViews. Some are part of the objects they will act on. Well see some

    examples later.

  • 8/3/2019 2822 Introduction to EViews 2004

    3/17

  • 8/3/2019 2822 Introduction to EViews 2004

    4/17

    Introduction to EViews Page 4 of

    what you are doing is interpolating between values so you dont really have as many valid

    observations as it may appear. When combining data series of different frequencies, make yourwork files frequency the lowest of the various data series frequencies.

    3

    Simple Statistics:

    Lets get the statistics on us. There are two easy ways to do it:1) Use the main menu: Select Quick > Series Statistics > Histogram and Stats and then type

    us into dialog box that pops up.2) Double clickus in the work file window. A window titled Series: US will open. Click

    this windows View menu button and selectDescriptive Statistics > Histogram and Stats.

    Either way, you should get the picture at right.

    This is one of several views of

    the us object. Try clicking theBarorLine menu buttons for

    other views. Sheetwill show youa spreadsheet of the data.

    Notice theFreeze menu button.Click this to make a frozen copy

    this window as a graph object for

    future use. Why would you dothis? Because, if you change the

    values in a series or the sample

    range of your work file,EViewswill automatically update all

    objects in your work file, thats

    why. Also, graph objects copy

    well into other programs likeWord.

    If you create a new object with a command or menu (like theFreeze menu button) you need toname it (use theName menu button) to place it in your work file. ClickName and give it a name

    and description (optional) and youll see it appear in the list of objects in the work file.

    A Regression:

    The easy way to do a regression is by using the main menu: Quick > Estimate Equation. The

    window shown below will appear. Type soviet c soviet(-1) us(-1) into the window

    as shown.

    3 For example, if you are combining monthly (12 obs. per year) and quarterly (4 obs. per year) data series, make you

    work files frequency quarterly.

  • 8/3/2019 2822 Introduction to EViews 2004

    5/17

    Introduction to EViews Page 5 of

    What does this mean? It means we want soviet to be the dependent (Y) variable in a regressionequation with the independent (X) variables being a constant term (c), the previous years

    soviet, and the previous years us. The (-1) indicates we want the value one time period before,also called the first lag. Click OK to get the regression output:

    Parts of the regression output:

    o Dependent variables name

    o Estimation method

    o When the equation was

    estimated

    o Actual range of data usedo Number of observations

    o Variables, coefficients, standard

    errors, and test statistics

    o Equation diagnostic statistics

    Saving a Work File:

    Suppose the regression output looks good and you want to save it and your data and run off to

    dinner. Click theName button and give the regression output a name (and description if you

    like). You will see it appear as an object in your work file with in front of it showing that it isan equation. To save your work file, use the main menu commandFile > Save As and then

  • 8/3/2019 2822 Introduction to EViews 2004

    6/17

    Introduction to EViews Page 6 of

    save it in your own network space or on a floppy or zip disk.4

    Do not save on the hard drive of a

    public computer.

    TUTORIAL 2 USING AN EVIEWS DATABASE, CREATING A WORKFILE, AND GENERATINGNEW

    SERIES

    In this tutorial we will get data from anEViews

    database and put it in a work file to do someanalysis. But lets start with a hypothesis. If the

    Keynesian view of interest rate determination iscorrect, when the money supply grows faster than

    GDP we should see interest rates fall. Conversely, if

    money growth is less than GDP growth, interest r

    should rise. In this tutorial, we will try to test thishypothesis using data from the Italian economy.

    LaunchEViews and then use the commandFile >Open > Database. You will get the dialog window

    shown at right. Click Browse Files to navigate to t

    ates

    he

    location of your database. In this case, well use the EViews database named itaoecd.edb; it islocated in the class data directory (L:\2005-06 Semester 1\economics-385\Class Ma

    In the Open window, click navigate to the directory and double-click the file name to open the

    database. Click OK in the Database Specification dialog and you will then see the Database:ITAOECD window as shown below. We know we want data on GDP, interest rates, and

    money supply. To find these variables, we will askEViews what useful variables are in the

    database by clicking theEasy Query button. In the dialog box (shown at right) type grossin

    the space titled AND description MATCHES and then click OK.

    terials\Data).

    4 Of course, on your own computer you can save on the hard drive but be sure to back up the drive every so often.

  • 8/3/2019 2822 Introduction to EViews 2004

    7/17

    Introduction to EViews Page 7 of

    You will see three variable names show up in the database window. Double-click any of these to

    get more information about the variables. It turns out that we want itagdp, quarterly values ofnominal GDP. Note its frequency (quarterly) and date range (1971 Q1 to 1990 Q3).

    We need a work file for our data series and

    results so lets create one. Using the mainmenu, selectFile > New > Workfile. In thework file dialog, make sure the Workfile

    structure type is Dated regular frequency

    and select Quarterly for the DateSpecification Frequency. Enter a Start

    date and an End date of1971:1 and

    1990:3, respectively (meaning start at 1971,

    first quarter, and end at 1990, third quarter).

    Click OK.

    NowEViews will have both database and a work file windows open. Switch to the databasewindow and clickitagdp, then click theExportbutton. Click OK and the data object will be putinto your work file.

    5

    Now is a good time to save your work file:File > Save orFile > Save As will do it. Give it adescriptive name (how about tutorial 2?) and save it to your network drive or disk. A file

    with .wf1 will be created to contain all data series, saved output, and graphs.

    We still need data series for the money supply and interest rate so go back to the database

    window and clickEasy Query again. Find an interest rate by typing rate into the AND

    description MATCHES area; click OK. The interest rate series we want is itaibor. Export this

    to the Tutorial 2 work file. Find a money supply series by doing an Easy Query formoney inthe description. Export the nominal money supply, itam1, to the work file. Once this is done,you can close the database window. Save your work file again! Click the Save button on thework file window.

    Before we go on, its worth mentioning how EViews converts data of different frequencies. In

    this tutorial, we have a quarterly work file but have read monthly data on money and interestrates from the database. EViews has converted the monthly data to quarterly by taking an

    average of the three monthly values for each quarter. Taking an average will be appropriate inmost cases. However, when it is not, you can control howEViews converts frequencies by using

    the Options > Dates & Frequency Conversions main menu item.6

    See theEViews help files or

    manuals for more information about this.

    5 There are two other ways to export from a database to a work file. First, you can right-click the variable and select

    Export to workfile from the menu. Second, you can double-click a variable name and click theExport to WF

    button in the window that pops up.6 For example, in macroeconomic data, quarterly and monthly values are sometimes labeled as annual rates or

    SAAR (seasonally adjusted annual rates). If you wanted to convert to an annual frequency, an average would beappropriate. However, suppose you have monthly data on the number of housing starts that month. In converting to

    an annual frequency, you would want to use a sum (total), not an average.

  • 8/3/2019 2822 Introduction to EViews 2004

    8/17

    Introduction to EViews Page 8 of

    Create Some New Variables.

    Our hypothesis talks about GDPgrowth, moneygrowth, and changes in the interest rates and,

    because we have levels of GDP, money, and interest rates, well need to compute some new

    variables. We can generate a new series by clicking the Genrbutton on the work file window.To create the growth rate in GDP, click the Genrbutton, entergdpgrowth = (itagdp-

    itagdp(-1))/itagdp(-1) into the Enter equation: area of the dialog box, and click

    OK.7

    In the work file, double-clickgdpgrowth to look at the numbers to make sure they seemallright. Do they? Good! Now, using the same process, generate moneygrowth.8 The interestrate change (name it ratechange) we want is just the amount of change (not percentage change)in itaibor. Generate this either by using the equation ratechange = itaibor

    itaibor(-1) or the equation ratechange = d(itaibor). The d(x) function takes the

    difference (current minus past values) of a time series. Check your work against mine. You

    should find that you have 78 observations of each variable with the following sample statistics.

    GDPGROWTH MONEYGROWTH RATECHANGEMean 0.037228 0.034567 0.069274

    Median 0.031948 0.036591 -0.066667

    Maximum 0.085843 0.090124 7.160000

    Minimum 0.009804 -0.033673 -3.480000

    Std. Dev. 0.017328 0.024784 1.524537

    To get back to the hypothesis, we

    want to see if, when money grows

    faster than GDP, interest rates fall,and when it grows slower, if rates

    rise. In terms of our data series, wewant to see if (moneygrowth-gdpgrowth) is negatively related toratechange. A simple regression isall it will take to test this. From the

    main menu, select Quick > Estimate

    Equation. In the Equation

    Specification area enterratechange c

    (moneygrowth-

    gdpgrowth)and click OK. To

    EViews, this means, Regressratechange on the difference between moneygrowth and gdpgrowth, and include a constant.InEViews you can use a new variable in a regression without creating it by putting an expressionin parentheses. Check that you get the same regression output that is shown below.

    7 The equation says, gdpgrowth is equal to the difference between current and past GDP divided by past GDP.8moneygrowth = (itam1 itam1(-1))/itam1(-1)

  • 8/3/2019 2822 Introduction to EViews 2004

    9/17

    Introduction to EViews Page 9 of

    Dependent Variable: RATECHANGEMethod: Least SquaresDate: 09/08/04 Time: 13:47Sample(adjusted): 1971:2 1990:3Included observations: 78 after adjusting endpoints

    Variable Coefficient Std. Error t-Statistic Prob.

    C 0.032178 0.170358 0.188884 0.8507MONEYGROWTH-

    GDPGROWTH-13.93972 6.965078 -2.001373 0.0489

    R-squared 0.050065 Mean dependent var 0.069274Adjusted R-squared 0.037566 S.D. dependent var 1.524537S.E. of regression 1.495627 Akaike info criterion 3.668275Sum squared resid 170.0045 Schwarz criterion 3.728704Log likelihood -141.0627 F-statistic 4.005493Durbin-Watson stat 1.415211 Prob(F-statistic) 0.048922

    Youll notice that we could have computed GDP or money growth using the d(x) function: for

    example, moneygrowth = d(itam1)/itam1(-1). There are also two cooler tricks wecan use to compute a percentage change directly; one uses a built-in percentage change functionand the other uses the differences of the natural logs. First trick is to use the @pch(x) function

    like this: moneygrowth = @pch(itam1). The second trick uses one of the properties of natural

    logs, that ln(x+a)-ln(x)a/x. InEViews, there is a difference-of-the-logs function dlog(x) thatapproximates the percentage change. Of course, it wont work on zero or negative numbers.

    In fact, we could have estimated the equation without using Genr at all. We could have usedQuick > Estimate Equation and given the following equation specification:

    d(itaibor) c (@pch(itam1)-@pch(itagdp))

    Give this a try to make sure it gives the same results.

    Do the results support the Keynesian view? Yes, because the coefficient on (moneygrowth-gdpgrowth) is negative and statistically significant. This means that when money growth ishigher (larger) than GDP growth, the dependent variable, ratechange, will be smaller. Also,notice that the coefficient is statistically significant at the 95% level. The Prob is the p-value

    for the test that the true coefficient is zero. It is also useful to look at whether an independentvariable will have a large or small effect on the dependent variable. For example, if money

    growth is one percentage point larger than GDP growth, then the variable (moneygrowth-gdpgrowth) would have a value of +0.01. The effect of this on ratechange would be(-13.93972) x (0.01) = (-0.1393972). In other words, if the money supply grows one percentage

    point faster than nominal GDP (say, 11% vs. 10%) we could expect to see interest rates drop by

    over 1/8th of a percentage point. That much of a change in interest rates is not terribly large but itstill appears important.

    TUTORIAL 3 GETTING DATA FROM ANOTHERSOURCE

    Suppose you are interested in the day-to-day movement in the exchange rate between the U.S.and Mexico. You know (or you do now) that the Federal Reserve makes daily exchange rates

    available and the daily rates between the U.S. and Mexico are at:

  • 8/3/2019 2822 Introduction to EViews 2004

    10/17

    Introduction to EViews Page 10 of

    http://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htm. But a web page is neither anEViews database (.edb) nor work file (.wf1). What do you do? If you can get the data into a textfile (also called ASCII

    9) orMicrosoft Excelfile (.xls) you can read it directly intoEViews. You

    can also cut-and-paste from another Windows program (likeExcel) intoEViews. Well cover

    both methods.

    Both methods begin the same way. First,

    open a web browser (Internet Explorer,Netscape,Firefox, etc.) and navigate tothe Mexico exchange rate page. Now

    launch Microsoft Excel. Switch to the

    web browser and give it the Select Allcommand: from the main menuEdit >

    Select All, or from the keyboard Ctrl-A.

    Then give the Copy command:Edit >

    Copy or Ctrl-C. Switch back toExcel,

    click on the cell in column A, row 1 (cellA1) and give Excel the Paste Special

    command:Edit > Paste Special. In the dialog box (shown at right) click Text and then OK.If you do not usePaste Specialin Excel this will not work so be careful. You should have a

    view that looks something like this:

    9 If you care, ASCII = American Standard Code for Information Interchange.

    http://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htmhttp://www.federalreserve.gov/releases/h10/Hist/dat00_mx.htm
  • 8/3/2019 2822 Introduction to EViews 2004

    11/17

    Introduction to EViews Page 11 of

    On to Method 1: Reading an External File into EViews

    Notice that the exchange rate data begins in cell B16 and that it is daily data with five-day

    weeks. (There is no currency trading on weekends.) Save the file with some descriptive name

    such as mexico exchange rates.xls. Now, and this is important, close the worksheet inExcel.

    OtherwiseEViews may not be able to open it.

    LaunchEViews and create a new work file.

    This time, we are creating a work file with ddata and the date format is a little differe

    Click the little button next to Daily (5 day

    weeks) and enter a start date of 1/3/20an ending date of whatever today is. Click O

    Next, give the commandFile > Import > ReadText-Lotus-Excel. At the bottom of the dialogbox, change Files of type: to Excel .xls so

    that you can see your spreadsheet. Navigate towhere you saved the spreadsheet and open it.

    You will now see the Excel Spreadsheet Import dialog box. You need to fill in a few thingsFirst, your data is By Observation so make sure this is clicked. Next, your data begins in cel

    B16, the Upper-left data cell. Then, the Excel 5+ sheet name is probably Sheet 1 so type

    this in. Finally, there is only one series so give the data series a name. I chose mexicoexrate.The completed dialog box is shown below. Click OK to read in the data.

    ailynt.

    00 andK.

    .l

    ts a good idea at this point to switch back to your web page and make sure whatEViews says isI

    the value for various days agrees with the web page.

  • 8/3/2019 2822 Introduction to EViews 2004

    12/17

    Introduction to EViews Page 12 of

    Now for Method 2 Cut-and-paste

    Sometimes you might want to cut-and-paste data into

    EViews or even type it in by hand. To do this, you first

    need to make a series object to hold the data. On your w

    files window youll see a button for Objects. Click iand select Series as the Type of Object. Name the

    object something different than any existing objects.

    Because we plan on pasting in the same exchange rate data

    for Mexico, use a new name for the new object: mexrate.Click OK to create the object.

    ork

    t

    n

    bservation.

    ave

    omesting

    ny further. I chose tutorial 3.wf1 as the name for my work

    Next, get your data on screen by launchingExceland

    loading the spreadsheet with the Mexican exchange ratedata. Select and Copy the data in Excel as follows:

    o Point to cell B16 (the top of the data column) with

    the mouse and click once; theno Either hold down the button and drag to the end of the data ORo Hold down Shift and Ctrl (at the same time) and press the down arrow key.o Copy the data either by usingFile > Copy or Ctrl-C.

    Switch to EViews and double-click your new (empty) object. I

    the window that opens, click the

    Edit +/- button. Point to thespace in the first column next to

    the date for your first o

    Then Paste by usingFile >

    Paste or Ctrl-V. You should ha window like that shown at the

    right.

    More of Tutorial 3: Groups, SManipulations, and a Foreca

    Model

    Save your work file before going a

    file. Check to see ifmexicoexrate and mexrate are the same; they should be. Here are acouple of ways to do it.

    1) Compute sample statistics on each and compare them. (See Tutorial 1)

    2) Compute the difference between the two variables (See Tutorial 2) and see if this variableis always zero.

    3) Open the two variables as a group and compute their correlation.

  • 8/3/2019 2822 Introduction to EViews 2004

    13/17

    Introduction to EViews Page 13 of

    Groups:

    EViews lets you create a group of series and keep these in your work file along with individual

    data series objects. Be careful because any changes you make to series will be reflected in the

    group and any changes to data in the group will be reflected in the individual series. To create a

    group, click once on a series you want to be in the group. Then hold down Crtl and click onceon the other series you want in the group. When you have selected all the series for the group

    right-click on the series and select Open > As Group from the pop-up menu. A new window will

    open with both series in it. Click this windows View button and select Correlations. (Youcan also use the main menu and select Quick > Group Statistics > Correlations and then click

    OK.) If the series are the same, you should get correlations of one in all cases. If all is OK,

    close the group window; respond OK to the delete group message.

    In you work file window, double-click on one of the exchange rate series. Click the series

    windows View button and selectLine Graph to see the values graphically over time. Thisseries is what we call non-stationary.

    That is, it is not staying around the samevalue all the time. It even looks like it

    may even have a break point some timearound June 2002. Lets see if we can

    make a stable series out of it by taking

    differences. The first difference (as wementioned above) is the difference

    between a current periods value and the

    past periods value. The seconddifference is the difference of the first

    differences.

    Series Manipulation:

    To compute the first and second

    differences, well use EViews built-in

    difference functions like we did in Tutorial 2. Click the Genr button on the work file window

    (or use the main menu command Quick > Generate Series). In the Enter Equation space

    type dmexrate=d(mexrate). Of course, if you named your Mexican exchange rate

    something other than mexrate, use that series name. To compute the second difference, we canuse the same d() function but with a small addition. Click Genr again and this time use an

    equation ofd2mexrate=d(mexrate,2). The ,2 part tellsEViews to use the second

    difference. You will now have two new series objects in your work file: dmexrate (the firstdifference) and d2mexrate (the second difference). To see all the different functions, use themain menu commandHelp > Function Reference or check theEViews manuals. You may want

    to look at line graphs or descriptive statistics of your two new series to see what they look like.

    8.5

    9.0

    9.5

    10.0

    10.5

    11.0

    11.5

    12.0

    3/01/00 1/30/02 12/31/03

    MEXRATE

    A Simple Forecasting Model:

  • 8/3/2019 2822 Introduction to EViews 2004

    14/17

    Introduction to EViews Page 14 of

    One of the simplest single-equation forecasting models is called the AR(p) where AR means

    autoregressive and p is a number of lags. For example, the AR(2) forecasting model forvariable X is:

    tttt XXX +++= 22110

    Xt is the current periods value of the variableXandXt-1 andXt-2 are the two previous periods

    values ofXcalled the first and second lags ofX. The models coefficients are 0, 1, and 2 and

    t is the error term. An AR(3) model would have three lags, an AR(4) would have four, etc.

    Remember that our Mexican exchange rate data is daily with five-day weeks. With daily data,

    an AR(20) model should be OK.10

    First, lets estimate the AR(20) model for dmexrate. From

    the main menu, use Quick > Estimate Equation. Enterdmexrate c dmexrate(-1 to -

    20) for the Equation Specification. This specification means that dmexrate is the dependentvariable, a constant term (c) should be included, and the first twenty lags ofdmexrate should bethe right-hand-side variables. When you get the equation window, click the Name button and

    name this object FIRST for first difference. Repeat this using d2mexrate and name thatequation object SECOND.

    Your output from these two models should be similar to that in the tables below.11

    At first

    glance, the second-difference model seems to be a better forecasting model. Notice that it has

    statistically significant coefficients and a much larger R2

    coefficient. Now this is notproofthat itis better but it is an indication that it may be better.

    Dependent Variable: DMEXRATEMethod: Least SquaresDate: 09/13/04 Time: 11:30Sample(adjusted): 4/14/2000 8/31/2004

    Included observations: 392Excluded observations: 751 after adjusting endpoints

    Variable Coefficient Std. Error t-Statistic Prob.

    C -0.000337 0.002535 -0.132839 0.8944DMEXRATE(-1) -0.009282 0.053401 -0.173820 0.8621DMEXRATE(-2) -0.000225 0.052808 -0.004263 0.9966DMEXRATE(-3) -0.012796 0.051525 -0.248337 0.8040DMEXRATE(-4) -0.034092 0.051587 -0.660873 0.5091DMEXRATE(-5) 0.036732 0.051179 0.717728 0.4734DMEXRATE(-6) -0.050948 0.051505 -0.989188 0.3232DMEXRATE(-7) 0.046132 0.053672 0.859511 0.3906DMEXRATE(-8) 0.125885 0.052027 2.419610 0.0160

    DMEXRATE(-9) 0.012956 0.052120 0.248584 0.8038DMEXRATE(-10) 0.076776 0.052822 1.453501 0.1469DMEXRATE(-11) 0.087370 0.053437 1.635017 0.1029DMEXRATE(-12) -0.028600 0.052070 -0.549259 0.5832DMEXRATE(-13) -0.043228 0.051499 -0.839405 0.4018

    10 As a rule of thumb, for annual data, two or three lags should be enough, 8 to 12 lags for monthly data, and for 24

    to 36 lags for monthly data. There isnt a rule of thumb for daily data but 20 or 30 may be a good starting point.11 You will have a different sample size, ending date, and excluded observations. You will also have slightly

    different results.

  • 8/3/2019 2822 Introduction to EViews 2004

    15/17

    Introduction to EViews Page 15 of

    DMEXRATE(-14) 0.053767 0.051638 1.041245 0.2984DMEXRATE(-15) 0.028977 0.052036 0.556863 0.5780DMEXRATE(-16) -0.017710 0.051655 -0.342843 0.7319DMEXRATE(-17) -0.027767 0.050744 -0.547189 0.5846DMEXRATE(-18) -0.070434 0.050497 -1.394794 0.1639DMEXRATE(-19) 0.020264 0.051680 0.392107 0.6952DMEXRATE(-20) -0.068769 0.051782 -1.328037 0.1850

    R-squared 0.049695 Mean dependent var -0.000357Adjusted R-squared -0.001534 S.D. dependent var 0.049822S.E. of regression 0.049860 Akaike info criterion -3.107107Sum squared resid 0.922318 Schwarz criterion -2.894361Log likelihood 629.9930 F-statistic 0.970058Durbin-Watson stat 1.832205 Prob(F-statistic) 0.498196

    Dependent Variable: D2MEXRATEMethod: Least SquaresDate: 09/13/04 Time: 11:22Sample(adjusted): 4/17/2000 8/31/2004Included observations: 370Excluded observations: 772 after adjusting endpoints

    Variable Coefficient Std. Error t-Statistic Prob.

    C -0.000582 0.002598 -0.223992 0.8229D2MEXRATE(-1) -0.932754 0.054232 -17.19919 0.0000D2MEXRATE(-2) -0.873662 0.076219 -11.46257 0.0000D2MEXRATE(-3) -0.876875 0.093566 -9.371687 0.0000D2MEXRATE(-4) -0.897055 0.109169 -8.217091 0.0000D2MEXRATE(-5) -0.832703 0.120841 -6.890930 0.0000D2MEXRATE(-6) -0.859224 0.128799 -6.671045 0.0000D2MEXRATE(-7) -0.762470 0.134130 -5.684563 0.0000D2MEXRATE(-8) -0.557285 0.136833 -4.072734 0.0001

    D2MEXRATE(-9) -0.493434 0.136250 -3.621531 0.0003D2MEXRATE(-10) -0.386028 0.135911 -2.840302 0.0048D2MEXRATE(-11) -0.274529 0.135932 -2.019604 0.0442D2MEXRATE(-12) -0.263963 0.134195 -1.967006 0.0500D2MEXRATE(-13) -0.257135 0.129943 -1.978826 0.0486D2MEXRATE(-14) -0.123966 0.125211 -0.990061 0.3228D2MEXRATE(-15) -0.036381 0.118683 -0.306542 0.7594D2MEXRATE(-16) -0.015965 0.109679 -0.145559 0.8844D2MEXRATE(-17) -0.005354 0.101351 -0.052828 0.9579D2MEXRATE(-18) -0.026842 0.090656 -0.296083 0.7673D2MEXRATE(-19) 0.013287 0.073750 0.180165 0.8571D2MEXRATE(-20) -0.046618 0.052495 -0.888049 0.3751

    R-squared 0.494164 Mean dependent var -0.001135

    Adjusted R-squared 0.465176 S.D. dependent var 0.068037S.E. of regression 0.049757 Akaike info criterion -3.108259Sum squared resid 0.864031 Schwarz criterion -2.886141Log likelihood 596.0280 F-statistic 17.04732Durbin-Watson stat 1.898082 Prob(F-statistic) 0.000000

  • 8/3/2019 2822 Introduction to EViews 2004

    16/17

    Introduction to EViews Page 16 of

    Note that the coefficients for lags 14 through 20 are zero. We can probably eliminate them from

    the equation. To re-estimate the equation using only lags 1 to 13 we just have to click theEstimate button on the equation output window and change the 20 to 13. Try it.

    TUTORIAL 4 USING RATS FORMAT DATABASES

    The departments OECD Main Economic Indicators databases are in format thatEViews calls

    RATS 4.x format. They are located in P:\Apps\EconData\OECD2004 and all the data file

    names end with .rat. In this short tutorial, well explain how to open these as databases.(EViews does allow us to open them as work files but dont do this.)

    Use the following command:File > Open > Database. You will see the dialog box at right.

    Click Browse Files and navigate to the OECD directory mentioned above. You will see all the

    RATS data files. Their names begin with a three-

    letter code that identifies the country followed by

    oecd.rat. For example, there is mexoecd.rat for

    Mexico,jpnoecd.rat for Japan, etc.

    Double click on the datebase for the country youwould like to use. You will return to the dialog at

    right only it will show the Database/File Type tobe RATS 4.x File and the DB File name/pathwill be for the file you selected. Click OK.

    The database will open in a window as before. Now

    you can do your Easy Query to find the time series

    you would like to use. If you already know the name of the variable you want, you can switch to

    your work file and click Fetch. A list of all the variables in all the OECD files and country codesis in L:\2005-06 Semester 1\economics-385\Class Materials\OECD_List_2004.pdf.

    12

    A NOTE ON THE ECONOMICS DEPARTMENT DATABASES

    Two of the large econometric databases the department purchases are the OECD Main Economic

    Indicators and the Haver Macroeconomic Database. See Tutorial 4 to access the OECD data.The Haver database contains almost 20,000 time series on the U.S. economy. Most are either

    monthly or quarterly frequency. To access the Haver database from EViews, see Tutorial 2 then

    useFile > Open > Database to open P:\Apps\EconData\usecon.edb. This database is also in

    L:\2005-06 Semester 1\economics-385\Class Materials\.

    12 It is also in S:\Econ for department faculty use.

  • 8/3/2019 2822 Introduction to EViews 2004

    17/17

    Introduction to EViews Page 17 of

    EXERCISES:

    1) Work through Tutorial 1 and then estimate a regression with us as the dependent variable andthe same independent variables: c soviet(-1) us(-1).

    2) Work through Tutorial 2 and then estimate the same model for the U.S. Data can be found inthe database usecon.edb. Use the prime lending rate, nominal GDP, and the money supply M2

    (look for one that is NSA). Choose only a ten-year period for your work file; any ten yearswill do.

    3) Work through Tutorial 3 and repeat the analyses for another country of your choice. Links to

    other daily exchange rates are at http://www.federalreserve.gov/releases/h10/Hist/. The links toScreen Reader will give the pages like the one used in the tutorial.

    4) In Tutorial 3, the (apparently) better forecasting model was the one using second differences.

    Use this notation: the variable isX, the first difference isD, and the second difference is S.

    Then:

    ( ) (

    21

    211

    1

    1

    2

    +=

    =

    =

    )

    =

    ttt

    tttt

    ttt

    ttt

    XXX

    XXXX

    DDS

    XXD

    So, if you have a forecast ofSfor tomorrow, figure out how you can forecast tomorrowsX.

    http://www.federalreserve.gov/releases/h10/Hist/http://www.federalreserve.gov/releases/h10/Hist/