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

Testing for Normality

Your book discusses the Jarque-Bera test for normality which is computed using the skewness and kurtosis of the least squares residuals. To compute the Jarque-Bera statistic, you’ll first need to obtain the summary statistics from your data series.

From gretl script

1 open "@gretldirdatapoehip. gdt"

2 summary

You could also use the point and click method to get the summary statistics. This is accom­plished from the output window of your regression. Simply highlight the hip series and then choose Data>Summary statistics>selected variables from the pull-down menu. This yields the re­sults in Table C.1.

One thing to note, gretl reports excess kurtosis rather than kurtosis. The excess kurtosis is measured relative to that of the normal distribution which has kurtosis of three...

Read More

Specification Tests

There are three specification tests you will find useful with instrumental variables estimation. By default, Gretl computes each of these whenever you estimate a model using two-stage least squares. Below I’ll walk you through doing it manually and we’ll compare the manual results to the automatically generated ones.

10.3.1 Hausman Test

The first test is to determine whether the independent variable(s) in your model is (are) in fact uncorrelated with the model’s errors. If so, then least squares is more efficient than the IV estimator. If not, least squares is inconsistent and you should use the less efficient, but consistent, instrumental variable estimator. The null and alternative hypotheses are Ho : Cov(xi, ei) = 0 against Ha : Cov(xi, ei) = 0...

Read More


Hill et al. (2011) provides a subset of National Longitudinal Survey which is conducted by the U. S. Department of Labor. The database includes observations on women, who in 1968, were between the ages of 14 and 24. It then follows them through time, recording various aspects of their lives annually until 1973 and bi-annually afterwards. Our sample consists of 716 women observed in 5 years (1982, 1983, 1985, 1987 and 1988). The panel is balanced and there are 3580 total observations.

Two model considered is found in equation (15.2) below.

ln(wage)it = ви + в2 educit + в3 experit + в4 experft + въ tenureit

+вб tenure2) + e7southit + e8unionit + e9blackit + eit (15.4)

The main command used to estimate models with panel data in gretl is panel. syntax is:


Arg u m ents: depvar in...

Read More


Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

If a section in the ...

Read More

Series Plots

The first thing to do when working with time-series is to take a look at the data graphically. A time-series plot will reveal potential problems with your data and suggest ways to proceed statistically. In gretl time-series plots are simple to generate since there is a built-in function

that performs this task. Open the data file usa. gdt and create the first differences using the diff command. The first differences of your time-series are added to the data set and each of the differenced series is prefixed with ‘d_e. g., Agdpt = gdpt — gdpt-l ^ d_gdp.

1 open "@gretldirdatapoeusa. gdt"

2 diff b inf f gdp

3 setinfo b – d "3-year Bond rate" – n "3-year Bond rate"

4 setinfo d_b – d "Change in the 3-year Bond rate" – n "D. BOND"

5 setinfo inf – d "annual inflation rate" – n "inflation rat...

Read More

Multinomial Logit

Starting with version 1.8.1, Gretl includes a routine to estimate multinomial logit (MNL) using maximum likelihood. In versions before 1.8.1 the alternatives were either (1) use gretl’s maximum likelihood module to estimate your own or (2) use another piece of software! In this section we’ll estimate the multinomial logit model using the native gretl function and I’ll relegate the other methods to a separate (optional) section 16.3.1. The other methods serve as good examples of how to use gretl’s scripting language and how to use it in conjunction with R.

In this model the dependent variable is categorical and is coded in the following way...

Read More