Gretl


gretl is an open-source statistical package, mainly for econometrics. The name is an acronym for Gnu Regression, Econometrics and Time-series Library.
It has both a graphical user interface and a command-line interface. It is written in C, uses GTK+ as widget toolkit for creating its GUI, and calls gnuplot for generating graphs. The native scripting language of gretl is known as hansl ; it can also be used together with TRAMO/SEATS, R, Stata, Python, Octave, Ox and Julia.
gretl can output models as LaTeX files.
Besides English, gretl is also available in Albanian, Basque, Bulgarian, Catalan, Chinese, Czech, French, Galician, German, Greek, Italian, Polish, Portuguese, Romanian, Russian, Spanish, Turkish and Ukrainian.
Gretl has been reviewed several times in the Journal of Applied Econometrics and, more recently, in the Australian Economic Review.
A review also appeared in the Journal of Statistical Software in 2008. Since then, the journal has featured several articles in which gretl is used to implement various statistical techniques.

Supported data formats

gretl offers its own fully documented, XML-based data format.
It can also import ASCII, CSV, databank, EViews, Excel, Gnumeric, GNU Octave, JMulTi, OpenDocument spreadsheets, PcGive, RATS 4, SAS xport, SPSS, and Stata files. It can export to Stata, GNU Octave, R, CSV, JMulTi, and PcGive file formats.

hansl

Gretl has its own scripting language, called hansl.
Hansl is a Turing-complete, interpreted programming language, featuring loops, conditionals, user-defined functions and complex data structures. It can be considered a domain-specific language for econometrics. Like other scientifically oriented programming languages, such as MATLAB and Julia, matrices are supported natively as a primitive variable type. The gretl add-ons known as function packages are written in hansl.
Here's a simple example of hansl
Running the above code produces

A
1 2
3 4
B
-2 1
1.5 -0.5
C
1.0000 0.0000
8.8818e-16 1.0000
Phi = 0.001
Phi = 0.023
Phi = 0.159
Phi = 0.500
Phi = 0.841
Phi = 0.977
Phi = 0.999

Random Number Generation

Random Number Generation in gretl has been examined and tested in Yalta & Schreiber . The authors conclude "Our results show that the RNG related procedures in gretl are implemented soundly and perform well in the three crush test suites of the TestU01".

Gretl as a teaching tool

Due to its libre nature and the breadth of econometric techniques it contains, gretl is widely used for teaching econometrics, from the undergraduate level onwards. Datasets in gretl format are available for several popular textbooks.
The following is a list of textbooks that use gretl as their software of choice:
In addition, a free supplement to Hill, Griffiths and Lim Principles of Econometrics is available.