Category Using gret l for Principles of Econometrics, 4th Edition

Serial Correlation

The multiple linear regression model of equation (5.1) assumes that the observations are not correlated with one another. While this is certainly believable if one has drawn a random sample, it’s less likely if one has drawn observations sequentially in time. Time series observations, which are drawn at regular intervals, usually embody a structure where time is an important component. If you are unable to completely model this structure in the regression function itself, then the remainder spills over into the unobserved component of the statistical model (its error) and this causes the errors be correlated with one another.

One way to think about it is that the errors will be serially correlated when omitted effects last more than one time period...

Read More

Scripts

Gretl commands can be collected and put into a file that can be executed at once and saved to be used again. This is accomplished by opening a new command script from the file menu. The command File>Script files>New script from the pull-down menu opens the command script editor shown in Figure 1.11. Type the commands you want to execute in the box using one line for each command. Notice that in the first line of the script, "I:Program Filesgretldatapoefood. gdt", the complete file and path name are enclosed in double quotes,

image011

Figure 1.9: Finding help on the arch command using the Command Reference

" ". This is necessary because the Program Files directory in the pathname includes a space...

Read More

Generalized R2

A generalized version of the goodness-of-fit statistic R2 can be obtained by taking the squared correlation between the actual values of the dependent variable and those predicted by the regres­sion. The following script reproduces the results from section 4.4.4 of your textbook.

1 open "@gretldirdatapoecps4_small. gdt"

2 logs wage

3 ols l_wage const educ

4 series y = exp($yhat)

5 scalar corr1 = corr(y, wage)

6 scalar Rsquare = corr1"2

7 print corrl Rsquare

This yields an estimated correlation of 0.4312 and a squared correlation of 0.1859.

Read More

Regional indicators

In this example a set of regional indicator variables is added to the model. There are four mutually exclusive regions to consider. A reference group must be chosen, in this case for the northeast. The model becomes:

wage = ві + e2educ + ^ south + S2midwest + 53west + e

where black and female are indicator variables. Taking the expected value of ln(wage) reveals each of the cases considered in the regression

ві + e2educ Northeast

Подпись: E [wage]Подпись: (7.2)ві + ^і + e2educ South ві + $2 + e2educ Midwest ві + $з + e2educ West

Once again, the omitted case (Northeast) becomes the reference group.

The regional dummy variables are added to the wage model for black females and is estimated by least squares. The regional indicator variables are tested jointly for significance using the omit statement.

1 ols wag...

Read More

Exponential Smoothing

Another popular model used for predicting the future value of a variable based on its history is exponential smoothing. Like forecasting with an AR model, forecasting using exponential smoothing does not use information from any other variable.

The basic idea is that the forecast for next period is a weighted average of the forecast for the current period and the actual realized value in the current period.

Ут +1 = аут + (1 – а)ут (9.16)

The exponential smoothing method is a versatile forecasting tool, but one needs a value for the smoothing parameter a and a value for yT to generate the forecast yT_ 1 ...

Read More