














































































Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!















































































In the Introduction:
Purpose of this guide:
Econometrics is defined by A. H. Studenmund^1 to be "the quantitative measurement and analysis of actual economic and business phenomena." This definition highlights the importance of learning econometrics by working through examples. This guide demonstrates how to use EViews to complete the econometric analysis illustrated in the text. EViews output can be copied and pasted into word processing files to facilitate the research report writing process.
Each chapter in this guide corresponds to a chapter in Using Econometrics: A PracticalGuide (UE) , by A. H. Studenmund. All of the econometric processes examined in a chapter are reproduced in the corresponding chapter of this guide, using EViews whenever a data set is provided.^2 This guide is a do-it-yourself manual and students should be able to reproduce the econometric analysis described in UE , without further assistance from the instructor. Best results are achieved when the text chapter is read first and then the operations are performed as you read the guide. Most procedures described in this guide are explained in a step-by-step manner so that even the novice user should be able to follow. The reader is advised to consult the owner's manual or the help function in EViews in cases where: a deeper understanding of EViews' functions is desired, a description of how EViews performs the calculations is desired, or references to the source of the econometric theory applied by EViews is sought.
∗ (^) I would like to thank A. H. Studenmund for his helpful comments and a special thanks to Pat Johnson for her superb editorial assistance and for making sure that the instructions in this guide are clear and easy to follow. Your feedback is very valuable - send your comments about this site and this guide to mailto:[email protected]. 1 A. H. Studenmund, Using Econometrics, A PracticalGuide (fourth edition), Addison Wesley, 2000, p. 3. (^2) For a variety of reasons, data sets for some of the examples presented in the text are not available.
EViews help:
For additional information, open the EViews program and select Help/EViews Help Topics… and a list of help categories is revealed (see the graphic below). Each help category contains a list of subtopics that are revealed by double clicking the book icon in front of the category. Other topics and subtopics can be viewed by scrolling down and clicking the subject of interest. If you know the specific subject matter, you can view the Contents listed in alphabetical order or use Find to locate the topic of interest. EViews uses standard Windows Help , the on-line manual is fully searchable and hypertext linked. The Help system contains updates to the documentation that were made after the manuals went to press. In addition to the information provided in the manuals and the help system, go to http://www.eviews.com on the World Wide Web and review the Frequently Asked Questions (FAQ) section, where you can find answers to common questions about installing, using, and getting the most out of EViews.
To create an object: select Objects/New Object from the main menu or workfile menu, click on the type of object that you want to create, provide a name and then click on OK. For some object types, another dialog box will open, prompting you to describe your object in more detail. For most objects, however, the object window will open immediately. A workfile must be open before an object can be created. The process of creating a workfile and objects will be explained later in this guide.
Mathematical expressions in EViews:
EViews contains an extensive library of built-in operators and functions that allow you to perform complicated mathematical operations with your data using just a few keystrokes. In addition to supporting standard mathematical and statistical operations, EViews provides a number of specialized functions for automatically handling the leads, lags, and differences that are commonly found in time series data. All of the operators described below may be used in expressions involving series and scalar values. When applied to a series expression, the operation is performed for each observation in the current sample.
EViews follows the usual order in evaluating expressions from left to right, with operator precedence order (from highest precedence to lowest):
For a list and description of all of the operators and special functions available in EViews, click on: Help/Function Referenc e.
The table below explains the function of each mathematical operator used by EViews.
Expression Operator Description
Areas in EViews main window:
Chapter 1: An Overview of Regression Analysis
In this chapter:
Section 1.4 describes how a weight guesser can use regression analysis to make better guesses about a person's weight ( Y ) based only on a person's height ( X ). The data for this example are printed in UE^1 , Table 1.1, p. 20, and available in the EViews workfile named htwt1.wf. However, since some data sets may not be in EViews file format, the process of creating an EViews workfile and entering data into the new workfile will reviewed here. The process of creating an EViews workfile and importing data into the new workfile from an Excel file will be reviewed in Chapter 2.
Creating an EViews workfile:
To create a new workfile for the weight ( Y ) versus height ( X ) data set printed in columns (2) and (3) of ( UE , Table 1.1, p. 20):
Step 1. Select File/New/Workfile on the EViews main menu bar. Step 2. Set the Workfile frequency: to Undated or irregular. Step 3. Since there are 20 observations in the data set, set the Start observation to 1 and End observation to 20 (refer to areas highlighted in yellow in the figure on the right).^2 Step 4. Once you have selected the appropriate frequency and entered the information for the workfile range, click OK. EViews will create an untitled workfile, and will display the workfile window in the main work area of the EViews screen. The workfile window displays two pairs of numbers highlighted in yellow: one for the Range: of data contained in the workfile, and the second for the current workfile Sample:. Both the workfile range and sample can be (^1) Using Econometrics, A Practical Guide (fourth edition), by A. H. Studenmund will be referred to as ( UE ) when referenced in this handbook. (^2) For monthly, quarterly, or annual time series data, with observations ranging from the beginning of 1980 to the end of 1996, select from the following options: for monthly data, set the Workfile frequency: to (^) monthly , and specify the Start date, 1980:01, and the End date, 1996:12. For quarterly data, set the Workfile frequency: to quarterly , and specify the Start date, 1980:1, and the End date, 1996:4. For annual data, set the Workfile frequency: to annual , and specify the Start date, 1980, and the End date, 1996. See Help/Contents/EViews Basics/Workfile Basics for more information about creating and using workfiles in EViews.
changed after the workfile has been created. Note that all new workfiles will contain two objects boxed in red: the coefficient vector named (^) c and the residual series named (^) resid. (see the figure below). Step 5. To save your workfile, select Save on the workfile menu bar or File/Save or File/Save As on the main menu bar and enter htwt1.wf1 in the File name: window, select the destination drive in the Save in: window and click OK. It is advisable to save the workfile after it is created and frequently thereafter.
Entering data into an EViews workfile:
Complete the section entitled Creating an EViews workfile before attempting this procedure. To enter the data for height (inches above 5') and weight from columns (2) and (3) of Table 1.1, ( UE , p. 20) into the newly created workfile, follow the steps below.
Step 1. To create a new series for the weight ( Y ) variable, select Objects/New Object/Series from the main menu or the workfile menu, enter Y in the Name for Object: window and click OK. All of the observations in the series will be assigned the missing value code 'NA'. 3 Step 2. To enter data into the newly created series, double click the series in the workfile window and click edit+/- on the series window menu bar. The numbers from the table can be entered to replace the NA's in the spreadsheet, pressing Enter after each entry. After the numbers have been entered, click edit+/- on the series window menu bar to save the changes and exit the edit function. The series window can be closed by clicking the button in the upper right corner of the series window. Step 3. Repeat the process for the height ( X ) variable. Step 4. To save changes to your workfile, click Save on the workfile menu bar.
Most data are available in spreadsheet file or ASCII text file format, which can be imported directly into the workfile. The procedure for importing the weight and height data from an ASCII text file will be explained in Chapter 2. The edit procedure described above is mostly used to adjust data series after they are imported. In cases where expressions can be used to assign values for the series, click on Quick/Generate Series or click on Genr on the workfile window menu bar and enter the expression defining the series. For more information on how to generate a series using expressions, see Help/Contents/EViews Basics/Working with Series.
(^3) A series can also be created by clicking on Quick/Generate Series on the main menu bar or by clicking on Genr on the workfile window menu bar and enter the expression Y = NA or any other mathematical expression.
Step 6. Click OK to get the graph in Figure 1b.
Note that the graph no longer gives a distorted view of the relationship between Y and X. The equation represented in Figures 1a & 1b has the following formula (see UE Equation 1.21, p. 21): Estimated weight (Y) = 103.40 + 6.38 * Height in inches above five feet (X)
Generating new variables in EViews:
Follow the steps below to generate the data in columns (4) through (7) of (^) UE , Table 1.1, p. 20:
Step 1. Open the EViews workfile named htwt1.wf. Step 2. To generate a new variable named predicted , with the data printed in column (4) of UE , Table 1.1, click Genr on the workfile menu and enter the formula ( predicted=103.4+6.38*X ) in the Enter Equation: window. Click (^) OK and a new variable named (^) predicted appears in the workfile window with the values in column (4) of Table 1.1. Step 3. To generate a new variable named residual , with the data printed in column (5) of Table 1.1, click Genr on the workfile menu and enter the formula ( residual=Y-predicted ) in the Enter Equation: window. Click OK and a new variable named residual will appear in the workfile window with the values in column (5) of Table 1.1. Step 4. To generate a new variable named gainorloss , with the data printed in column (6) of Table 1.1, click Genr on the workfile menu and enter the formula gainorloss=.5(residual>=-10 and residual<=10)-.6(residual<-10 or residual>10) in the Enter Equation: window.^6 Click OK and a new variable named gainorloss will appear in the workfile window with the values in column (6) of Table 1.1. Step 5. Create a group with x, y, predicted, residual, and gainorloss in order. Click View/Spreadsheet to view the data in Table 1.1. Step 6. Type =@sum(gainorloss) in the command window, press Enter , view the net amount gained on the status line in the lower left of the screen (i.e., ).
(^6) The conditional value typed within a set of parenthesis is equal to one when the condition is true and zero if the condition is false. Thus, the condition (residual>=-10 and residual<=10) is equal to one if the residual falls within the range -10 to +10 and zero if it is outside of this range. The condition (residual<-10 or residual>10) is equal to one if the residual is less than -10 or greater than +10 and zero if it falls within the range -10 to +10.
0
50
100
150
200
250
0 5 10 15 20 X
Y
Figure 1b
Exercises:
a. b. c. d. The data for this exercise are available in an EViews file named help1.wf1. However, it is a good idea to take this opportunity to make sure that you understand how to create a workfile and enter data. If you want to skip these steps, open the EViews workfile named help1.wf1 and skip steps 1 through 6 below.
Follow these steps to create a new workfile for the help-wanted advertising index ( hwi ) and unemployment rate ( ur ) data set printed in the table accompanying exercise 13.
Step 1. Select File/New/Workfile on the EViews main menu bar. Set the workfile frequency to Quarterly. Enter 1962:1 for the Start date: and 1967:4 for the End date: (see footnote 2). Click OK to open a new untitled workfile. Step 2. To save your workfile, select^ Save on the workfile menu bar or^ File/Save or^ File/Save As on the main menu bar and enter help1.wf1 in the File name: window, select the destination drive in the Save in: window, and click OK. Step 3. To create a new series for the help-wanted advertising index ( hwi ) variable, select Objects/New Object/Series from the main menu or the workfile menu, enter hwi in the Name for Object: window and click (^) OK. All of the observations in the series will be assigned the missing value code 'NA'. Step 4. To enter data into the newly created series, double click the series in the workfile window and click edit+/- on the series window menu bar. The numbers from the table can be entered to replace the NA's in the spreadsheet, pressing Enter after each entry. After the numbers have been entered, click (^) edit+/- on the series window menu bar to save the changes and exit the edit function. The series window can be closed by clicking the button in the upper right corner of the series window. Step 5. Repeat the process for the unemployment rate ( ur ) variable. Step 6. To save changes to your workfile, click Save on the workfile menu bar.
The process of running a regression is explained, in detail, in Chapter 2, but a short description of the process is presented here. Follow these steps to run the regression between hwi and ur :
Step 1. Open the EViews workfile named Help1.wf. Step 2. Select^ Objects/New Object/Equation and click^ OK (or^ Quick/Estimate Equation from the main menu). Step 3. Enter the dependent variable ( hwi ), the constant ( c ) and the independent variable ( ur ) in the Equation Specification: window that appears, using spaces between each term. It is important to enter the dependent variable first ( hwi in this case). Step 4. Select the estimation method {LS - Least Squares (NLS and ARMA)}. EViews uses this as the default setting because it is selected most of the time. Step 5. The workfile sample range is automatically entered but it can be changed if another sample range is desired. Step 6. Click OK when finished to reveal the regression output generated by EViews.
Step 5. Select the estimation Method {LS - Least Squares (NLS and ARMA)}. This is the default that will be used most of the time. Step 6. The workfile sample range is automatically entered but it can be changed if another sample range is desired. Click OK to view the EViews Least Squares regression output table. Step 7. To save changes to your workfile, click Save on the workfile menu bar.
Contents of the EViews equation window:
Most of the important statistical information relating to a regression is reported in the EViews equation window (see the figure below). General information concerning the regression is printed in the top few lines, the coefficient statistics are reported in table format (middle five columns), and summary statistics are printed in table format (bottom four columns) of the equation window.
General Information Printed in the Top Portion of the Equation Output: The first five or six lines identify (see arrow in figure on right): Line 1. Name of the dependent variable. Line 2. Regression method used. Line 3. Date & time the regression was executed. Line 4. Sample range used in the regression. Line 5. Number of observations included in your regression. Line 6. Number of excluded observations. Line 6 is not reported in this case because no observations are excluded (i.e., no variable, included in the regression, has missing observations or is lagged with data not available for the pre-sample period).
Coefficient Results: Key information regarding the estimated regression coefficients is reported in a table displayed in the middle of the regression output (see area highlighted in yellow). The first column identifies each variable ( C for the constant and (^) X for height) and the second column reports the estimated coefficient values (i.e., βˆ^ o & βˆ^1 ). Note that the estimated coefficients are the same as those printed in ( UE , Equation 1.21, pp. 20 & 21). The data printed in columns (3) - (6) are the standard error of the coefficient, the t-statistic and the probability respectively. We will not discuss these now, but they will be very important when Hypothesis Testing is discussed in Chapter 5. Summary Statistics: Key summary statistics are reported in four columns below the equation output (see area outlined in red ). Each will be defined and the page reference to where it is discussed in UE is identified in parenthesis.
Multivariate Regression (2.2.3):
Multivariate regression is executed the same as simple regression in EViews and the output is identical. In this section we create a workfile, import data from a spreadsheet and estimate a multivariate regression model using the Beef example ( UE , p. 45).
Creating a workfile for the demand for beef example ( UE , Table 2.2, p. 45):
Note that Table 2.2 reports annual data for the price and quantity of beef and disposable personal income for the period 1960 through 1987. To create an EViews workfile:
Step 1. Select File/New/Workfile on the main menu. Step 2. Set the Workfile frequency: to Annual. Step 3. Enter the Start date: ( 1960 ) and End date: ( 1987 ). Step 4. Click OK.
Importing data from a spreadsheet file named Beef2.xls :
Once the workfile has been created, it is a simple matter to import data from another file. However, you must first know the location of the data in the spreadsheet file.
To view the location of the data in the spreadsheet file:
Step 1. Open the Excel program and then open the Excel spreadsheet file named Beef2.xls , located on the Addison Wesley Longman web site. You can get there by clicking this http://occ.awlonline.com/bookbind/pubbooks/studenmund_awl/ URL. Click on the^ Student Resources/Data Sets/Data Sets-Excel. You must be connected to the internet for this link to work. Step 2. Note that the first data series starts in cell A2 and that the data are in three contiguous columns (see the figure below).
Step 3. Click OK to get the regression results shown in the table on the right. Check the coefficients in column 2 of the EViews, Least Squares output table (highlighted in yellow) with the results reported in UE , Equation 2.10, p. 44.
Describing the Overall Fit of the Estimated Model ( UE 2.4):
R 2 , the coefficient of determination and R 2 , the adjusted R 2 , are located right under the coefficients column of the table printed in the middle of the EViews regression output (outlined in red). In this case, R^2 = 0.66 andR 2 = 0.63.
Exercises:
Chapter 3: Learning To Use Regression Analysis
In this chapter:
The Woody's Restaurants data will be used to show how EViews can be used to do the items listed above. The steps required to display the 'spreadsheet view', descriptive statistics, and simple correlation coefficients between all pairs of variables in a group are as follows:
Displaying the spreadsheet view of a group of variables ( UE , Table 3.1):
Step 1. Open the EViews workfile named Woody3.wf1 by clicking File/Open/Workfile on the main menu and double click on the file named Woody3.wf. Step 2. To Create an EViews group for the Woody's Restaurants example, hold down the Ctrl button, click on Y, N, P & I , select Show from the workfile toolbar, and click OK. Step 3. When you click OK , EViews displays the spreadsheet view of the data for the variables included in the group (i.e., Y, N, P & I in this case). EViews allows you to change the view with the click of a button. If you are in another view, you can display the spreadsheet view by clicking View/Spreadsheet on the group window menu bar. Step 4. Click Name on the group menu bar and enter GROUP01 in the Name to identify object: window. 1
Displaying the descriptive statistics for a group of variables ( UE , Table 3.1):
Step 1. Open the group object created in Display the spreadsheet view of a group of variables by double clicking the icon in the workfile window. Step 2. Click View/Descriptive Stats/Individual Samples on the group window menu bar to view descriptive statistics for GROUP 01.^2
(^1) You must name a group object if you want to keep its results. Unnamed objects are labeled “UNTITLED” and the results are lost when the object window or the workfile is closed. To name a group, click Name on the group menu bar and enter the name in the Name to identify object: window. Once named, a 'group object' is saved with the workfile and can be viewed by double clicking its icon (i.e., ) in the workfile window. (^2) The group view drop-down menu is divided into four blocks: · The views in the first block provide various ways of looking at the actual data in the group. · The views in the second block display various basics statistics. · The views in the third block are for specialized statistics for time series data. · The fourth block contains the label view, which provides information regarding the group object.
Running a simple regression for Woody's Restaurants example ( UE 3.2):
To regress the number of customers served ( Y ) on the Constant ( C ), the number of direct market competitors within a two-mile radius of the Woody's location ( N ), the number of people living within a three-mile radius of the Woody's location ( P ), and the average household income of people living within a three-mile radius of the Woody's location ( I ):
Step 1. Open the EViews workfile named Woody3.wf1. Step 2. To estimate UE , Equation 3.6, p. 74, select Objects/New Object/Equation on the workfile menu bar. 5 You can name the equation object now by deleting Untitled in the Name for Object: window and typing a name for the equation you are about to estimate, or you can skip this step and name the equation later (if you find that it is worth saving). Click OK to reveal the Equation Specification: window. Step 3. Enter Y C N P I in the Equation Specification: window. Step 4. Do not change the default settings for Method: and Sample:. Step 5. Click^ OK to get the computer output printed in the top box of^ UE , Table 3.2, p. 76. Step 6. To name the equation for later use, select Name on the equation window menu bar, enter EQ01 in the Name to identify object: window, and click OK.^6
Documenting the results:
All of the data necessary to write the results printed in ( UE , Equation 3.7, p. 77) are printed in the EViews regression output. EViews provides a variety of views for regression results. For example, if you are documenting the results in a word processing file, you can facilitate the process by clicking View/Representations on the equation window menu bar to get the following:
LS Y C N P I
Y = C(1) + C(2)N + C(3)P + C(4)*I
Y = 102192.4277 - 9074.674399N + 0.3546683674P + 1.287923391*I
You can copy the last line and paste it into your word processing file to get the first line of UE , Equation 3.7.
(^5) Alternately, select (^) Quick/Estimate Equation from the main menu. If this method is used, you must name the equation to save it. Click Name on the equation menu bar and enter the desired name in the Name for object: window and click 6 OK. Restrictions on naming an object include, the name cannot exceed 16 characters and it cannot be a reserved name. The following names are reserved and should not be used for series: ABS, ACOS, AR, ASIN, C, CON, CNORM, COEF, COS, D, DLOG, DNORM, ELSE, ENDIF, EXP, LOG, LOGIT, LPT1, LPT2, MA, NA, NRND, PDL, RESID, RND, SAR, SIN, SMA, SQR, and THEN.
Select View/Estimation Output on the group window menu bar to restore the estimation output view for (^) EQ.
Displaying the actual, fitted, residual, and a plot of the residuals for a regression (see UE , Table 3.2, p. 76):
Step 1. Open the EViews workfile named^ Woody3.wf1 and open the equation named^ EQ01 by double clicking the equation icon in the workfile window. Step 2a. Click View/Actual,Fitted,Residual/Actual,Fitted,Residual Table on the equation window menu bar (see figure below left). Click OK to reveal the figure below right.
Step 2b. Alternately, to display a graph of the actual, fitted, and residuals for a regression, click View/Actual,Fitted,Residual/Actual,Fitted,Residual Graph (see figure below left). Click OK to reveal the figure below right. Other views available in the equation window will be explained in future chapters of this guide.