EC10004

Lecture 9 An Introduction to EViews Econometric Software

There are a number of specialist econometric/ statistical software packages available at the moment, many of them specialising in different aspects of econometrics and statistics. One of the best to start with is EViews, as it is reasonably ‘user friendly’ but still powerful enough to carry out many advanced techniques. Eviews can be found by going to start, then choosing departments and then Economics, finally opt for Eviews 5.The programme begins in the variable description screen, from where you can create variables, carry out some common tests and move to the estimation options. Click on the variable name to check the data.

Inputting Data into Eviews

To open a file in Eviews format in Eviews, go to file and click on open then select an Eviews file. If the file is in a format other than the Eviews format, go to file and click on open then select new. Once you have the file loaded into Eviews, it is easier to then save it as an Eviews file. After opening the file, the first screen details the variable names, by clicking on any of these names the data can be checked and assessed. By clicking on an individual variable then selecting ‘view’, it is possible to assess some basic statistics on the data series, this can be done with all the data series listed. For instance if after selecting ‘view’, the ‘descriptive statistics’ and then ‘histogram and stats’ is chosen, a set of basic statistics such as mean and variance as well as a histogram of the data is produced.

Plotting and Charting of data

(Use the data for demo 1 as examples)

To plot the data, you need to click on a specific variable, then click on ‘view’ and select the ‘graph’ option. Finally chose the type of chart that best describes the data, for instance in most cases a line graph is sufficient.This will plot the data against time.

To plot more than one data series on a graph, click on ‘quick’ from the top toolbar and then select the ‘graph’ option. Click on the ‘line’ option and in the box enter the names of the data series you wish to plot, with a space between each series. Again these are plotted against time.

To produce a scatterplot of the data, you need to click on ‘quick’ on the top toolbar, then select ‘graph’. Then select the ‘scatter’ option, this gives a further set of choices, try ‘scatter with regression’.

This will produce a scatterplot of X against Y and as with Excel can be used to give an initial feel for the data and whether the data are related.

By again clicking on ‘view’ it is possible to produce ‘one-way tabulations’, which displays cell counts in various forms, such as count and % overall.

Generating variables

To generate variables, you simply need to select the ‘genr’ box which is on the toolbar above the variable names, then type the new variable name followed by what it is made up of. (alternatively click on ‘quick’ and then select ‘generate series’.

e.g. lx=log(x)

ex=exp(x)

x3=x^3 (x cubed)

Correlation Coefficients

By going to ‘Quick’ again and selecting ‘Group series’, it is possible to generate some simple group statistics on correlation and covariance, including the correlation coefficient, as well as other statistics which we can ignore for the time being.

The correlation option produces correlation coefficients for X and Y (it also produces the autocorrelation function which you will come across next year).

Running a Regression

When running a regression in E-views, you need to click on the ‘Quick’ button on the top of the screen, then select the ‘estimate equation …’ option, in the box type the dependent variable first, with a space between each variable.

e.g. Y c X. (c is the constant)

You need to add in a specific constant with Eviews, other software will do this automatically. You then need to ensure the correct dates are entered before pressing ‘OK’. This is an Ordinary Least Squares (OLS) regression, as described in last weeks lecture (other options are available from the method box). Although there are other types of regression technique, we will always use the OLS approach for this year. All the techniques are essentially fitting a line to a scatterplot as efficiently as possible.

Demo 9.1. Using data for Investment and Government Expenditure for Australia, assess the relationship between these two variables to indirectly determine if there is evidence of crowding out. The data file can be located here and is an Eviews file (You need to save it and then open it in Eviews).

1)Create logarithms of the variables by typing:

-lcg=log(cg)

-lci=log(ci)

2)Plot the variables with and without logs

3)Produce a scatter plot of both variables to determine if there is any relationship between them

4)Also produce two histograms, are the data normally distributed?

5)Run a regression by clicking on the ‘Quick’ button. Type in: lci k lcg and press the ‘OK’ button.

6)Assess the results, are the coefficients as expected? Are the variables significant, with reference to the t-statistic?

Demo 9.2. Using data for UK(ukp) and Canadian price (cnp) indexes from 1980 to 2002 (ignore the other data for now), assess the relationship between the two variables. The data file is here.

1)Create the logs of the variables etc.

2)Plot the variables as before

3)Generate the summary statistics and correlation coefficients

4)Run a regression with UK prices as the dependent variable and Canadian prices as the explanatory variable

5)Run a second regression of UK prices against Canadian prices including a single lag, is there any evidence of causality?

The exercises in class 9 can be found here