Professional Documents
Culture Documents
1. Introduction/Objectives
Click on the window, and make sure a blinking insertion cursor appears in the first line.
Type “wfcreate(wf=unstruct) u 1000” and hit enter (denoted ¶), to create a new workfile with 1000
observations.
(In general, commands have three components: Command, Option, and Argument. For example, in the line
you just typed, wfcreate is a command, (wf=unstruct) is an option, and “u 1000” is an argument. For more
information, please read the help file.)
Type “series var_1=1” ¶, to create a new constant.
Type “series var_2=nrnd” ¶, to generate a variable drawn from standard normal distribution.
Type “var_2.line” ¶, to create a graph object.
Type “freeze(fig1) var_2.line” ¶, to freeze the graph object.
Type “cd G://”¶, to change the directory.
Type “wfsave temp”¶, to save the change in the workfile.
Type “close temp”¶, to close the workfile.
Type “open temp”¶, to open the saved workfile.
Type “exit”¶, to exit from the EViews.
3. Writing a simple program
d. Running a regression
Type “equation eq1.ls log(m1) c log(gdp) rs log(pr)”¶, to specify a model.
Type “group gp1 log(m1) c log(gdp) rs log(pr)”¶, to group the variables.
Type “freeze(g2) gp1.line”, to plot the variables over the time.
Run the program. Is the estimation good? Is there a possibility of spurious regression? How can you test it?
b. Unit-root test
Type “freeze(u1) gdp.uroot(adf,trend)”¶, to test the variable against unit-root process. (By default, constant
term is included.)
See command reference “uroot” for more options.
c. Scatter Plots
Type “group gp2 gdp m1”¶, to group two variables.
Type “gp2.scat”¶, to get a scatter plot of three series.
Type “gp2.scat linefit”¶, to get a fitted (regression) line for those plotted variables.
See “Optional Graph Components - Auxiliary Spec” for more detail of “linefit”
Sample code:
'John Smith
‘Last modified: 4/5/2008
cd G:/
wfcreate(wf=intro) q 1952:1 1996:4
read Intro_Eviews.xls 5
…
freeze(a1) gdp.stats
freeze(g1) gdp.line
g1.addtext(t) "Fig1: Real GDP (1950:1 = 100) 1952:1-1996:4"
…