You are on page 1of 10

GETTING STARTED WITH EViews

ECN 376
Professor Lardaro

Getting data from FRED:
- When you locate a variable in FRED, click on Download Data just above the series name (
but first write down the units of measurement, etc. for later)
- Make the box for Data Range the appropriate range for your purposes
- Click the Download Data button. An Excel spreadsheet with your data over the specified
range will emerge. ONLY USE THE DATA VALUES in what follows, NOT THE DATES
- Drag over the data values for the entire range, then COPY the values
*** You can also paste a series of variables into a single spreadsheet and copy the entire
group at once ***
DATA ENTRY IN EViews:
- Make sure you have created a workfile with the correct frequency (ex: Monthly) and date
range as in the following example, then click OK:


- To enter data for a single variable, I will call it X, on the command line (below the File button),
enter the command DATA X (note: you can drag on the bottom of the command line box to
make it higher).



- This will open a spreadsheet in EViews with the range specified and the cursor in the first
date. PASTE your data into this space. Your variable should now have data. Make sure all of
the values were correctly entered. If your FRED data started from say 1970.04, DO NOT paste
it into a space for J anuary of 1970 in EViews. Obviously, there will be missing values at the
end of the variable.

To Enter Data in Descending Order (starting with most recent getting to earliest) from
sites like economy.com/freelunch, follow these steps:

- After you have entered (pasted) the data, click on the X at the top right of that box. You will
see the following:

- Select Yes. This will not delete your variable, it will just not keep it as a Group. Continue
doing this until you have added all of your variables.
CREATING NEW VARIABLES
- DO THIS IN THE COMMAND LINE
- creating new variables starts with GENR
GENR new = expression from existing variables
where new is the name of the new variable.
- The expression can contain the usual math operators: +- * / ^.
- If you use brackets, make sure only to use ( and ), NOT [ and ]. Make sure there is a right
bracket for each left bracket.
- Lags are created with (-n) after the variable name, where n is #of periods to lag. For
example, X(-1) is the one-period lag of X. This will create missing values.
- Use the formula sheets I distributed to guide you. I recommend writing the command on
paper, then translating it into EViews language.

OBTAINING SUMMARY STATISTICS AND CORRELATIONS
Once you have the variables in your workfile, you can obtain summary statistics for any single
variable or for groups of variables.
- To do this, double click on the variables(s) you want to work with. This will bring up a
spreadsheet object with the variable(s) shown. NOTE THE BUTTONS AT THE TOP OF THIS
BOX.

- Click on View. You will have several choices. For a single variable, select Descriptive
Statistics & Tests. This will bring up a side-menu. Select either of the top two choices
(Histogram and Stats or Stats Table).
- For several variables, after you double click on the variables, choose Open Group then click
on the View button, then Descriptive Stats, then Common Sample.

CREATING A GRAPH
- use the PLOT command followed by the names of variables to be plotted. For example:
PLOT X Y
gives a time series plot of X and Y.
- If the two variables in a graph have very different scales, you can create a second axis and
allow the variables to overlap.
DOUBLE CLICK ON THE GRAPH. The following box emerges. Click on the tab Axis/Scale,
highlight 2 Right, click on the Right button (on the far right side), then select Overlap below
the Left and Right box. Click ok. Thats it!


If you want to save a graph as part of your workfile, select Name and give it a name.
To add titles to your graph, click on Add Text at the top of the graph box.

Overall title: Type the title you want into the box Text for label, then select Center and Top.
Also, click on the Font box (bottom left), choose Bold and whatever typeface and font size you
wish.
Axis label(s): Select the Add Text box again, type in the label you want for the axis (ex: $/bbl or
percent or mil $ or 1982-84=100), select Left Rotated for left axis, click on Font, select Bold,
font and font size, then ok.
- To add shaded areas, click on Line/Shade at the top of the graph box, select Shaded Area,
then type in the relevant time period, and click ok.

CONVERTING MONTHLY DATA TO QUARTERLY
On the bottom of the Workfile box, there are two tabs. I recommend changing the first to
Monthly, then creating a Quarterly file by clicking on the New Page tab. To do this:

- First, right click on the left tab and select Rename Workfile Page. Under Name for Page,
enter Monthly, then click Ok. (see image below)
- Next, right click on the New Page tab, select Specify by Frequency/Range. A workfile
creation box like before emerges. Change entries to Quarterly and the data range.
REMEMBER: with quarterly data, the format is year.qtr (ex: 1970.1).

- When you press ok, you will be moved to a second tab called Untitled and a third tab will
have been added (called New Page). Right click the Untitled tab, select Rename Workfile
Page, then enter Quarterly.

- Next, click on Monthly to move to the monthly data.
- Highlight the variables you want to convert to quarterly (for non-adjacent variables, press Ctrl
then Shift. (DO NOT select growth rates redo these in the new workfile)
- When you have the variables you want to convert highlighted, at the top of the EViews page,
click on Edit then Copy. Click on the Quarterly tab at the bottom. Then go to Edit and Paste.
Thats all you have to do!
Now that you have a quarterly database, re-calculate any growth rates (ex: inflation) or other.
There is a very quick way to do this.
- Your command line should still have the commands you used to create the growth rates for
the monthly workfile. Scroll up to each of these, make whatever changes might be necessary
(ex: change 12 to 4 for year-over-year percent changes and annualized growth rates), then
press Enter. Thats it.
- Dont forget to SAVE your workfile.


FORMULAS TO USE (Discussed in Chapter 3)

Real Value of X (where X is in $): Real X =(Nominal X/Price Index)*100
EViews : GENR REALX = (X/PI)*100 where X is nominal X and PI is the name of the
price index used

Real Interest Rate: Nominal Interest Rate Rate of Inflation
EViews : GENR REALINT = INT INFLAT

Growth Rate of X: the percent change in X =(X/X )*100
Two types are used with time series data:
- Year-over-year percent change: [(X
t
/X
t-12
)-1]*100 with monthly data
- Annualized growth rate (i.e., compound annual rate of growth):
[(X
t
/X
t-1
)
12
- 1]*100 with monthly data
Example: the rate of inflation using the CPI_U
EViews : creates lags of X as X(-1) or X(-12)
- Year-over-year percent change: GENR PCXYOY = ((X/X(-12))-1)*100
- Annualized: GENR PCXANN = (((X/X(-1))^12)-1)*100

Moving Average: a multi-period average that moves as the data extends
- 12 month moving average: (X
t
+X
t-1
+ +X
t-11
)/12
EViews : has a moving average function built in: @MOVAV()
GENR MAX = @MOVAV(X,12)


MIGRATING DATA FROM THE INTERNET TO EViews

Because Internet data from sources such as FRED are not HTML tables, they have one
long string of characters the date and the value for each period. Use the following steps:
1. Go to the data series desired in FRED. Starting at the appropriate time period, hold
down the left mouse key and drag to the end of the data. Release the mouse key
2. Copy this data to the Windows clipboard (use CTRL +C, etc.)
3. Paste the data into an Excel spreadsheet
4. While the block of information is still highlighted, move the mouse arrow up to the Excel
heading: DATA and click on this.
5. Next, select the row that states: TEXT TO COLUMNS . This brings up a dialog box.
6. Click on DELIMITED then on NEXT at the bottom of the box.
7. On the next dialog box, uncheck TAB and click on SPACE. Then click on FINISH. Now
the data points are separated from the dates.
8. COPY the variable values
9. In EViews (see the handout), enter the command: DATA X, which opens up a
spreadsheet for data input. Then PASTE the values into the first cell.




EViews COMMANDS


DATA name - opens a variable spreadsheet to paste data into

PLOT X Y - creates a time series plot of X and Y. To customize this, click on the:
ADD TEXT button above the graph to add a title and units for the axes
ADD SHADE button to shade periods of recession or policy change, etc.
Double click on the graph and an options box appears (see handout)
Ex: PLOT @MOVAV(X,12) X - plots a 12 month moving average of X and the current
value of X

GENR new = expression with existing variable(s)
Creates a new variable from existing data
Ex: GENR INFLAT =(((CPI/CPI(-1))^12)-1)*100 annualized CPI inflation
GENR RPOIL =(POIL/CPI)*100 - real price of oil using price of oil (POIL) and CPI
GENR REALINT =INT INFLAT - real interest rate using annualized CPI inflation
GENR TIME =@TREND(70.01) +1 - creates a time trend where J an. 1970 =1, etc.

SMPL 70.01 2001.01 - makes the sample period J an. 1970 to J an. 2001

LS Y C X1 X2 - linear regression (i.e., least squares) with Y as dependent variable and X1
and X2 as explanatory variables
Ex: LS LOG(PRODUCTIV) C TIME regression of natural log of productivity on a time
trend with an intercept (C) included

GROUP EXPORT X1 X2 X3 - creates a group of variables, EXPORT, that consists of X1
X2 and X3. This can also be accomplished by first clicking on each of the variables
desired then double clicking on one of these, which brings up a several variable
spreadsheet. Click on the x box (top right) and you can select the NAME box.

STORE: when a group of variables is created, it can be brought into another EViews data
set. This is usually done to alter the data frequency. For example, store monthly data
and bring it into a quarterly data set. EViews then creates quarterly values from the
monthly values.
- Create a group such as EXPORT (variables to be exported). In the workfile box, click on
the box STORE to store these for use later (they become *.db format).

FETCH: brings a variable or group of variables into a data set. This is a button at the top of
the workfile box. Click on FETCH, then select the variable or group you wish to import.
They will be listed in a dialog box as name.db.

VIEW: when a variable is selected, this is a button at the top of the box to display that
variable. An important choice under VIEW is DESCRIPTIVE STATISTICS. There is a
SAMPLE button at the top of this view box that you can alter the sample period of the
statistics for.

You might also like