EViews >

Introduction to EViews 4.0 Syntax

'1. Create a new workfile named myworkfile (as myworkfile.wfl):

new workfile myworkfile a 1973 1996
'Note that myworkfile is annual date, hence 'a' starting in 1973 and ending in 1996.

'2. Import (read) data into workfile

(Note that it can also read data from Excel file mydata in the A directory. The default options are - the data are organized by observation, the upper left data cell is B2):
read a:\mydata.xls p e

'Note that this reads the data into eviews and specifies the names of the series p (for price) and e (for exchange rate). Alternatively you could write

'read a:\mydata.xls 2
'which says that we have 2 series.

'3. Graphical analysis of the data:

'Suppose you wanted to print a line graph of the p variable, then the command is …
graph line_p.line p

'Similarly, the command below gives a line graph of e …

graph line_e.line e

'Show the pie graph …

pie p e

'EViews allows you to create a group which is a new matrix putting p and e together …

group mygroup e p

'or …

group newgroup e p p(-1) e(-1)

'where p(-1) and e(-1) are the lagged one period of the variables respectively.

'then you can plot a graph of this new group …

graph scat_mygroup.scat mygroup

'4. Descriptive statistics of the data such as mean, median, standard deviations etc.:

'Histogram of p …
show p.hist

'Histogram of e …

show e.hist

'Descriptive statistics of p and e in group …

mygroup.stats(i)

mygroup.cor

'5. Data transformations:

'log transformation of the two variables …
genr lnp=log(p)

genr lne=log(e)

'6. Simple Regression - OLS (Ordinary Least Squares):

equation myregression1.ls lnp c lne

'7. Redefining the sample:

smpl 1973 1985
equation myregression2.ls p c e

equation myregression3.ls p c p(-1 to -3) e(-1)