Sunteți pe pagina 1din 6

Statistics and Decision Making (45-731) Fall 2010

Tutorial

EVIEWS TUTORIAL
(Approx completion time: ~ 35 minutes)

This tutorial is organized in three main sections. These sections cover basic topics such as creating workfiles and generating variables, copying Eviews output into Word, importing data from Excel to Eviews and editing data. Let us start with some basic formatting Begin by launching Eviews. First, well standardize some options. -Click on Options / Window and Font Options -Under Warn on Close, we wish to have a check mark only for programs-text. Make sure there is a check mark for this option and remove check marks for the other options. -Under Allow Only One Untitled, we want check marks for all except seriesmatrices-coefficients. -Click OK Next -Click on Options / Workfile Storage Defaults -Choose Double Precision -Under Backup Files, we wish to have a check mark. Remove check marks for other options -Click OK 1. CREATING A WORKFILE & GENERATING VARIABLES Now, we will create a workfile. -Click on File / New/ Workfile -We will create an undated workfile, so click the down arrow under Date Specification and choose Integer Date -Enter 1 for the start observation and 1000 for the end observation then click Ok. Note that the workfile window is the most important of the various windows that you can open in Eviews. To perform any analysis using Eviews, you need to have a workfile open. To generate a sample from a normal distribution: -Type genr z=nrnd in the white area near the top of the screen

Statistics and Decision Making (45-731) Fall 2010

Tutorial

Note that variable name z has appeared in your work file. To look at the data you generated, double click on z in the workfile window -Click View / Descriptive Statistics / Histogram and Stats -Click on the x in the upper right corner of the histogram to close it. To generate a sample from the uniform distribution: -Type genr x=rnd in the white area near the top of the screen -Look at the data as you did for the normal distribution (i.e. spreadsheet and histogram), then close as before. Now generate a new variable. -Type genr y=x+z/10 To look at relationship between x and y, -Hold down the ctrl key and click x and y (in that order) so that they are both highlighted in blue. -Right-click the mouse and choose Open / As group -Click View / Graph / Scatter -Click View / Descriptive Statistics / Common Sample To summarize so far, we have illustrated the creation of an undated work file, the generation of random numbers from the normal and uniform distributions, generating new variables, viewing the data in a spreadsheet, viewing descriptive statistics, and viewing the scatter diagram.

2. COPYING EVIEWS OUTPUT TO WORD Next, to illustrate labeling graphs and copying from Eviews to Word, -View the scatter diagram of x and y as above -In the scatter diagram window, click freeze -In the new scatter diagram window, click Add Text -Select Center and Top -Enter a title for the diagram: Scatter plot of y versus x and click OK -Click Edit / Copy at the top of the workfile window, and click OK on the resulting window -Open a Word file and click Edit / Paste (in Word)

Statistics and Decision Making (45-731) Fall 2010

Tutorial

-This completes illustration of copying a graph to Word, so return to Eviews Note that if you wish to save a graph as part of the workfile, you must give it a name. -Click name and enter: Graph_x_y -Click OK. Now close the scatter plot. You will see that the graph name is now in the workfile. Double-clicking on the name will re-open the graph. Now, we will illustrate copying summary statistics. -Hold down ctrl and click on x, y, and z -Right-click and open as group -Choose View / Descriptive Statistics / Common Sample -Click the box in the upper-right of the spreadsheet to expand to full screen -Click the arrow at the upper-right of the window and click the arrow at the lower left of the window. -Mark the right-most four columns by clicking the upper of the two Zs, and, while holding down the left mouse button, drag the pointer across the Y, X, and blank column headings -Release the left mouse button -With the pointer on the blue area, right-click and choose copy -Choose formatted -Then go to your Word file and click paste. This concludes illustration of copying from Eviews to Word. We will now explain how to use the genr command to perform standard algebraic computations. For example, -Generate a new variable, y, that is a product of x and z by typing genr y=x*z (note that this replaces previous y with new values) -Do a scatter plot of x and y as above to see the relationship of x and new y Delete the work file without saving -Click upper right-hand-corner X of the work file and click no when prompted about saving the work file 3. IMPORTING AND EDITING DATA To import data from Excel, -Open Excel

Statistics and Decision Making (45-731) Fall 2010

Tutorial

-Create two columns of data by entering the cholesterol reduction achieved by Drugs X and Y for a sample of 16 individuals: Drug X: 29, 32, 31, 32, 32, 29, 31, 30 Drug Y: 26, 27, 28, 27, 30, 26, 33, 36 -Use column headings drug_X and drug_Y for these two variables (note: Eviews does not permit spaces in variable names, hence the underscore _ in the above variable names) -Select these two columns and click copy -Next, create a new undated workfile with 8 observations (proceed as described in creating the workfile above) -Click Quick / Empty Group -In the spreadsheet that opens, click the up arrow on the right-hand-side -Click the upper-left cell of the spreadsheet (just to the right of obs), right-click, choose paste -Click the upper-right X of the spreadsheet to close the spreadsheet We will now save this file. I suggest that you create a folder on your computer for saving work files for this course -Click on the top of your work file to make sure it is highlighted in blue -Save the workfile using file name: Cholesterol (i.e. click File / Save As and enter file name Cholesterol) -Delete the workfile from the active Eviews window (click the upper-right X of the workfile) The preceding steps illustrate copying data from an Excel spreadsheet when the Excel spreadsheet contains names for the variables. We next illustrate copying data when the Excel spreadsheet does not contain variables names -Return to your Excel spreadsheet and delete the row containing the variable names -Next mark and copy the two columns of data -Create an Eviews work file with 8 observations -Click Quick / Empty Group

Statistics and Decision Making (45-731) Fall 2010

Tutorial

-Click the upper-left cell of the spreadsheet (adjacent to the [1 under] first obs cell), right-click, and choose paste Note that Eviews automatically names the series ser01 and ser02. If you wish to rename the series, you may do so. -Click the up arrow on the right-hand side of the spreadsheet -Click ser01 (in the cell adjacent to obs) -Type drug_x, hit enter, and choose yes -Then type drug_y, click enter, and choose yes -Click the upper-right X in the spreadsheet to close it You can also rename a variable in the work file at any time by clicking on the variable to mark it. Then right click and choose rename. The preceding demonstrates copying of data when there are no variable names in the Excel file. Delete this workfile without saving it. To enter data in Eviews directly, -Create a new undated workfile with 8 observations -Click Quick / Empty Group A spreadsheet opens. You may type your data directly into this spreadsheet just as in Excel. After typing your data, you can enter variable names by clicking on the up arrow on the right-hand side of the spreadsheet and then typing in the names of the variables (You may wish to do this for practice just to be sure you know how). Close the spreadsheet and delete this workfile. As a final demonstration, we will illustrate editing data in a workfile. Load the work file Cholesterol that you previously saved as follows: -Click File and then click the name of the file near the bottom of the menu that opens Suppose that we discover a typing error in a data entry for Drug X. To correct that entry, proceed as follows. -To bring up a spreadsheet with the data for Drug X, Click drug_X, right-click, choose open -Click edit +/- at the top of the spreadsheet (Note that Eviews will not allow you to change entries in your spreadsheet unless you click edit +/-) To correct an entry, simply click on the appropriate cell and type in the new number. When corrections are completed, simply close the spreadsheet and re-save the workfile.

Statistics and Decision Making (45-731) Fall 2010

Tutorial

Note: Extensive information is available in the Eviews help file. The following is an example. You may want to go through the steps in the example for practice. You can bring up Eviews help by clicking: Help/Eviews Help Topics A browser window will open with the Eviews help options displayed. Suppose you wish to find out what distributions are available. In the browser window, click Search and enter statistical distribution functions in the search line, click Go, and click statistical distribution functions when it appears in the display window below Go. You will then see a presentation of the statistical distributions available in Eviews

Thats it for now. Well provide future installments for additional topics as needed.

S-ar putea să vă placă și