Using gret l for Principles of Econometrics, 4th Edition
Linear Regression
The parameters of the model are estimated using least squares which can be done using the pulldown menus and dialog boxes (GUI) or by using gretl’s handy scripting language (affectionately called hansl). Both of these will be demonstrated below. The GUI makes it easy to estimate this model using least squares. There are actually two ways to open the dialog box. The first is to use the pull-down menu. Select Model>Ordinary Least Squares from the main gretl window as shown below in Figure 5.1. This brings up the dialog box shown in Figure 5.2. As in chapter 2
Figure 5.1: Using the pull-down menu to open the ordinary least squares dialog box. |
Figure 5.2: The specify model dialog box for ordinary least squares (OLS) |
you need to put the dependent variable (sales) and the independent variables (const, price, and advert) in the appropriate boxes. Click OK and the model is estimated. The results appear in Table 5.1 below.
There is a shortcut to get to the specify model dialog box. On the toolbar located at the bottom of the main gretl window is a button labeled /3. Clicking on this button as shown in Figure 5.3 will open the OLS specify model dialog box in Figure 5.2.