EViews Tutorial

32
EViews Tutorial

description

EViews Tutorial. EViews Introduction. Eviews will be your partner for this course. Eviews is a computer program. Depending on your method of working your assignments can take 2-20 hours. Prepare yourself to work with Eviews ahead of time. Work smart, not hard. EViews. - PowerPoint PPT Presentation

Transcript of EViews Tutorial

Page 1: EViews Tutorial

EViews Tutorial

Page 2: EViews Tutorial

EViews Introduction

• Eviews will be your partner for this course.

• Eviews is a computer program.

• Depending on your method of working your assignments can take 2-20 hours.

• Prepare yourself to work with Eviews ahead of time. Work smart, not hard.

Page 3: EViews Tutorial

EViews

This is your Command Window

This is your Work Area

This is your desktop

Page 4: EViews Tutorial

Starting a Workfile

Match your workbook construction to your needs.Use unstructured/undated when in doubt.If dated match your dates to those of observations.This is very important: Match your frequency to observations.If you know in advance that you will be out of sample forecasting you may needto include room in your workfile for these forecasts.If you do not need this room then…

Page 5: EViews Tutorial

Starting a Workfile (TheEasy Way)

Drag your Data into your Work Space

Page 6: EViews Tutorial

A Blank Workfile

• Workfiles come with two things

• c which represents a constant term

• resid which represents your residuals, A.K.A. εt

• If you learn one thing from this tutorial, resid = εt

Page 7: EViews Tutorial

Importing Data

• Eviews is capable of parsing data from many formats and sources.

• If your data is given in many forms, you will need to import the individual pieces.

• GUI: File -> Import -> …• Choose the appropriate import technique• If your data has no file extension, or is an unknown

filetype try opening it with Notepad. If it opens and is legible either copy the data out, or save it as an acceptable format.

• Use google to identify file extensions such as .csv

Page 8: EViews Tutorial

Integrity and Safety

• Not all data makes it into Eviews without error. You should visually inspect your data every time.

• Not all data provided to you is correct. People make types. File formats are incorrectly changed.

• Save your workfile after verifying.• Save often. Eviews will crash. Sometimes

as often as 5 times over a 3 hour period.

Page 9: EViews Tutorial

Example of Problematic Data

• What is this? A table?• Can you read it?• Can Eviews?• Yes, but are there

problems?• This icon means there

are strings.• This icon means you

have numeric data.• Be mindful of: Commas,

Strings, Tables

Page 10: EViews Tutorial

Properly Formatted Data

• No indication of strings.

• All numerical data.• Note that Excel will

put commas in. These are okay.

Page 11: EViews Tutorial

Final Data Check & Interacting With Groups

• Doubleclick a group to open it in spreadsheet format.

• You can visually inspect each cell or you can work smart.

• You can hand-edit entries in spreadsheet format. You can also generate new series and hand edit their entries.

• Note: Eviews tracks sources, dates, times. Don’t try to cheat.

Page 12: EViews Tutorial

Final Data Check & Descriptive Statistics

• Let Eviews check the data for you.

• Generate a histogram. You will often include these in your homework.

• Histogram reveals data has no extreme outlying observations, and has sensible values.

• To include this histogram in your homework click in the pale yellow area, and simply push CTRL+C (copy), click ok, then paste it into a word document (CTRL+V.)

• Save! (Both your workfile and your homework document.)

Page 13: EViews Tutorial

Moving Forward

• So far we’ve only created the workfile and verified the data.

• Consider the objectives of your assignment.

• You may not have been provided with all of the data necessary to complete your assignment.

Page 14: EViews Tutorial

Generating Series (genr)

• GUI: Object -> New.• Best used as command line operation.• Creates a new series that performs the mathematical

operation to every entry in the original series.• genr ser_name = expression• ser_name = name of your generated series• expression = the mathematical expression which creates

the series you wish to create• Type in the command, and then simply hit enter• genr temperaturef = ((temperature___c_*1.8)+32)

Page 15: EViews Tutorial

genr continued

• Series will be added to your workfile. (Check it, save.)

• Do this until you have all the series your assignment will require. This will often include squares, or the logs of series:

• genr seriessq = series^2

• genr logseries = log(series)

Page 16: EViews Tutorial

Seasonal Dummy Variables

• An extension of genr

• genr <dummyname> = @seas(#)

• Example:

• genr d1 = @seas(1)

• genr d2 = @seas(2)

• Be careful that you match your seasons to your data. Do not create 4 seasonal dummies on monthly data.

Page 17: EViews Tutorial

Sampling Series (smpl)

• GUI: Quick -> Sample• Command: smpl <begin> <end>• Top Window for editing

observations, IE “1 100” is first 100, can also limit by date

• Bottom window for conditions, IE “station = 444943” would only include observations from station 444943

• Can use inequality symbols and other logical expressions

• Check your data within your sample.

Page 18: EViews Tutorial

Doing Some Actual WorkEquations

• All we’ve done so far is get everything ready to complete the assignment.

• GUI: Object -> New -> Equation

• Equations are stored as both the equation you specify, the sample specified, and also have influence on the rest of your workfile, specifically the last equation to have operated will change c and resid

Page 19: EViews Tutorial

The “c Question”

• Whether or not to include c, the constant term, in your equations was a problem that troubled some students all the way until the final assignment.

• If you are using dummy variables for every season, do not include c. Why?

• Does your data have a constant? Does temperature data? National defense spending?

Page 20: EViews Tutorial

Equations

Command: ls temperature latitude

Estimation Output viewshows there may be some effect ontemperature

Page 21: EViews Tutorial

Estimation Output View

• You will use this view very often in this course. In fact, very often you will be asked to include the values represented in this view, or the actual window itself.

• You could simply click print from Eviews, however that will give you the output on a piece of blank paper.

• E.O. view is able to be copy/pasted into Word documents, simply select all (CTRL+A), copy (CTRL+C), and choose Formatted, then paste (CTRL+V.)

• Don’t make a new table and spend time filling in the entries. Work smart.

Page 22: EViews Tutorial

Viewing Graphs

• View -> Graph -> …• Graphs will also be asked for

in your assignments.• To create and view a vs graph,

click the value acting as the x-axis, then hold ctrl and click the value to act as the y axis. Right click, open as group, and then view the graph (most often a scatterplot.)

• Like the histogram earlier, this can be copied as a metafile, and pasted. (Do so, this helps both the TA and yourself!)

Page 23: EViews Tutorial

Technique: Smoothing

• Command: Smooth

• GUI: Open Series then Proc -> Exponential Smoothing

Page 24: EViews Tutorial

Smoothing: @movav

• Command: @movav(<ser_name>,<interval>)• Must be used with genr. • Generates a moving average on the series

name using the interval.• A 2 point moving average on temperature• Genr tempma2 = @movav(temperature,2)• To generate a 2x2 or 2x4 moving average,

generate your results first (like above) then take another moving average

• Genr tempma24 = @movav(tempma2,4)

Page 25: EViews Tutorial

Technique: Forecasting

• Identify the type of forecasting necessary.• In sample forecasting should limit the sample to

earlier entries.• Out of sample forecasting requires space in the

workfile.• Command: forecast(option) yhat [y_series]• Example (plain): forecast yhat se• You can also sample ahead of a series that has

been exponentially smoothed in some cases by using smpl series(#)

Page 26: EViews Tutorial

Lags and Leads

• Lag operators <Series>(#)• Example: sales(-3), sales with a lag of 3,

sales(3), sales with a lead of +3• This technique will become important for you to

use in later assignments.• genr lag3sales = sales(-3)• smpl sales(5) – will attempt to forecast and

generate the next 5 value of sales given workfile room (Remember making space for out of sample forecasts?)

Page 27: EViews Tutorial

Correlograms

• Best to access these via GUI.• View -> Residual Tests -> Correlogram Q

Statistics• Include a sensible # of lags. 36 for monthly data

is good. 12 for annual data.• You can’t copy/paste correlograms normally.

You must use print screen, then paste into paint (or other image editor) then hand cut your desired image from there.

Page 28: EViews Tutorial

Comparison

• Date: 01/25/08 Time: 15:07

• Sample: 1968M01 1993M12

• Included observations: 312

••• Autocorrelation Partial Correlation AC   PAC  Q-Stat

 Prob•••        .|* |        .|* | 1 0.117 0.117 4.3158 0.038•        *|. |        *|. | 2 -0.149 -0.165 11.365 0.003•        *|. |        *|. | 3 -0.106 -0.069 14.943 0.002•        .|. |        .|. | 4 -0.014 -0.017 15.007 0.005•        .|* |        .|* | 5 0.142 0.125 21.449 0.001•        .|. |        .|. | 6 0.041 -0.004 21.979 0.001•        .|* |        .|* | 7 0.134 0.175 27.708 0.000•

Page 29: EViews Tutorial

ARMA Terms

• AR and MA terms may be included in equations just like any other series.

• Example:• ls sales gdp AR(1) AR(2) MA(1) MA(2)• While seemingly complex, ARMA terms

are easy to work with in Eviews.• AR(2) would be both AR(1) and AR(2)• ARMA(2,2) would be both AR(1) and

AR(2), and also MA(1) and MA(2)

Page 30: EViews Tutorial

Common Errors

• Near Singular Matrix – Most commonly occurs because you used a constant and a full compliment of dummy variables.

• Errors that force you to crash – Most commonly occur because Eviews was asked to perform a demanding operation and ran out of memory.

• Save!

Page 31: EViews Tutorial

Using Eviews Help

• Whenever you’re confused, try using help.

• Even if you don’t know the command, entering the process you’re looking for may be found in help, for example least squares

Page 32: EViews Tutorial

Good Ideas

• While doing your homework keep a log of any commands or operations you perform alongside your homework. In fact, before each figure or result it doesn’t hurt to list the steps you made. This is a good habit to form for three reasons. First the TA knows that you understand what you’re doing. Second you can help your fellow students. Third, when your homework is returned you have a study guide for quizzes and tests. You will be tested on Eviews material.

• If you’re not going to write your explanations in the lab make sure you have all of the figures and information needed for the homework.

• Start early. You will make mistakes. Sometimes twice.• Save often.