Prof. Bryan Caplan
bcaplan@gmu.edu
http://www3.gmu.edu/departments/economics/bcaplan
Spring 1999
Introduction to Eviews
- Getting Started
- Installation instructions come with the software; nothing surprising here.
- To practice, go to the class homepage and click on the Eviews "hw1" file, named hw1.bin.
- Choose the option "Save."
- Once you have the file on your hard drive or floppy disk, rename it hw1.wf1.
- Opening An Eviews Worksheet
- Open the Eviews program (you may want to add the Eviews icon to your toolbar for convenience).
- Once Eviews is open, click on File.
- Then go down to Open, and click the option Worksheet.
- Locate your saved file hw1.wf1 and double-click it.
- Your first worksheet is now open, and you are ready to try a few basic commands.
- There are two ways to use Eviews:
- Command-driven
- Menu-driven
- Some Easy Eviews Commands
- The menu-driven features of Eviews build on the underlying language of TSP. You can also access this language directly in the upper command window; as you get more advanced, you make find it convenient to "mix and match" writing commands and using the menu.
- Creating matrices:
- To create a 3x10 matrix of all 0's xdata, type: matrix (3,10) xdata
- To assign non-0 values to one cell (1,1) of this matrix, type: xdata(1,1)=3, etc.
- To assign non-0 values to all cells, create a matrix x, then type: x.fill a,b,c,d,.... For example, if you do matrix (2,2) x, and then type: x.fill 1,2,3,4, this produces the matrix x=
.
- Matrix arithmetic:
- To add together two matrices, x and y, create a third matrix equal to x+y, type: matrix z=x+y
- To multiply two matrices, type: matrix z=x*y
- To invert x, type: matrix z=@inverse(x)
- To calculate the covariance or correlation between two vectors (or between the columns of a matrix), type: matrix z=@cov(x,y) or matrix z=@cor(x,y). (Note that Eviews will only let you calculate these statistics if the number of rows matches the number of observations for that worksheet).
- See your results: Click on the newly-appearing objects in the lower window!
- For more commands, see hand-out.
- Some Easy Eviews Actions (Menu-driven)
- Many functions are easier to perform using the menus rather than commands. Each "Object" in Eviews appears in the lower window. Double-clicking on the objects shows what each object is.
- First, look at the variables inf (Inflation) and un (Unemployment) by double-clicking their icons. You should see a series of 35 variables, running from 1961-1995.
- For each variable, go to View.
- Under the View heading, click on the option "Line Graph."
- Again under the View heading, click on the option "Descriptive Statistics." Select the sub-option "Histogram and Stats."
- To do a simple regression: Click on "Objects" and select "Equation." Type your dependent variable first, followed by the list of independent variables separated by spaces. Use the letter c for the constant.
- A Slightly More Difficult Action in Eviews (Menu-driven)
- Simultaneously select both inf and un. You do this by first clicking one; then, press and hold the button Crtl while you click the second variable. (If you did this correctly, both variables will be shaded now).
- Go to the View heading and choose the option "Open Selected," with the sub-option "One Window."
- Several new choices will now appear before you. Choose the option "Open Group."
- Name your new group, and close it.
- There will now be a new icon in your worksheet. Re-open it.
- Try out the following options under the View heading:
- Multiple Graphs... Bar
- Correlations
- Covariances
- To learn more: Play around some more with Eviews and see what you can learn. With computing, everything falls into place with practice.