Gretl

Last updated
gretl
Developer(s) the gretl team
Initial release31 January 2000;23 years ago (2000-01-31)
Stable release
2023b [1]   OOjs UI icon edit-ltr-progressive.svg / 21 July 2023;6 months ago (21 July 2023)
Preview release
Through git
Repository
Written in C
Operating system Cross-platform
Available in Multilingual (11)
Type Statistical software
License GNU GPLv3
Website gretl.sourceforge.net

gretl is an open-source statistical package, mainly for econometrics. The name is an acronym for Gnu Regression, Econometrics and Time-series Library.

Contents

It has both a graphical user interface (GUI) 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 (see below); it can also be used together with TRAMO/SEATS, R, Stata, Python, Octave, Ox and Julia.

It includes natively all the basic statistical techniques employed in contemporary Econometrics and Time-Series Analysis. Additional estimators and tests are available via user-contributed function packages, which are written in hansl. [2] 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 (both varieties), Romanian, Russian, Spanish, Turkish and Ukrainian.

Gretl has been reviewed several times in the Journal of Applied Econometrics [3] [4] [5] and, more recently, in the Australian Economic Review . [6]

A review also appeared in the Journal of Statistical Software [7] 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. Since version 2020c, the GeoJSON and Shapefile formats are also supported, for thematic map creation.

It can export to Stata, GNU Octave, R, CSV, JMulTi, and PcGive file formats.

hansl

Gretl has its own scripting language, called hansl (which is a recursive acronym for Hansl's A Neat Scripting Language).

Hansl is a Turing-complete, interpreted programming language, featuring loops, conditionals, user-defined functions and complex data structures. [8] It can be considered a domain-specific language for econometrics. [9] Like other scientifically oriented programming languages, such as MATLAB and Julia, matrices are supported natively as a primitive variable type.

A simple example of hansl:

matrix A = {1, 2 ; 3, 4} matrix B = [[Invertible matrix|inv]](A) matrix C = A*B  print A B C  loop i=-3..3     [[printf]] "[[Phi]](%d) = %7.3f\n", i, [[Cumulative distribution function|cdf]](N, i) endloop

Running the above code produces

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

Random Number Generation

Random Number Generation (RNG) in gretl has been examined and tested in Yalta & Schreiber (2012). [10] 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 [11] to Hill, Griffiths and Lim Principles of Econometrics (Wiley) is available.

See also

Related Research Articles

<span class="mw-page-title-main">Kolmogorov–Smirnov test</span> Non-parametric statistical test between two distributions

In statistics, the Kolmogorov–Smirnov test is a nonparametric test of the equality of continuous, one-dimensional probability distributions that can be used to test whether a sample came from a given reference probability distribution, or to test whether two samples came from the same distribution. Intuitively, the test provides a method to qualitatively answer the question "How likely is it that we would see a collection of samples like this if they were drawn from that probability distribution?" or, in the second case, "How likely is it that we would see two sets of samples like this if they were drawn from the same probability distribution?". It is named after Andrey Kolmogorov and Nikolai Smirnov.

gnuplot Command-line and GUI plotting program

gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems . Originally released in 1986, its listed authors are Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo "and many others." Despite its name, this software is not part of the GNU Project.

The Mersenne Twister is a general-purpose pseudorandom number generator (PRNG) developed in 1997 by Makoto Matsumoto and Takuji Nishimura. Its name derives from the fact that its period length is chosen to be a Mersenne prime.

<span class="mw-page-title-main">GNU Octave</span> Numerical analysis programming language

GNU Octave is a scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with MATLAB. It may also be used as a batch-oriented language. As part of the GNU Project, it is free software under the terms of the GNU General Public License.

<span class="mw-page-title-main">Stata</span> Statistical software package

Stata is a general-purpose statistical software package developed by StataCorp for data manipulation, visualization, statistics, and automated reporting. It is used by researchers in many fields, including biomedicine, economics, epidemiology, and sociology.

In econometrics, the seemingly unrelated regressions (SUR) or seemingly unrelated regression equations (SURE) model, proposed by Arnold Zellner in (1962), is a generalization of a linear regression model that consists of several regression equations, each having its own dependent variable and potentially different sets of exogenous explanatory variables. Each equation is a valid linear regression on its own and can be estimated separately, which is why the system is called seemingly unrelated, although some authors suggest that the term seemingly related would be more appropriate, since the error terms are assumed to be correlated across the equations.

<span class="mw-page-title-main">EViews</span>

EViews is a statistical package for Windows, used mainly for time-series oriented econometric analysis. It is developed by Quantitative Micro Software (QMS), now a part of IHS. Version 1.0 was released in March 1994, and replaced MicroTSP. The TSP software and programming language had been originally developed by Robert Hall in 1965. The current version of EViews is 13, released in August 2022.

RATS, an abbreviation of Regression Analysis of Time Series, is a statistical package for time series analysis and econometrics. RATS is developed and sold by Estima, Inc., located in Evanston, IL.

<span class="mw-page-title-main">R Commander</span>

R Commander (Rcmdr) is a GUI for the R programming language, licensed under the GNU General Public License, and developed and maintained by John Fox in the sociology department at McMaster University. Rcmdr looks and works similarly to SPSS GUI by providing a menu of analytic and graphical methods. It also displays the underlying R code that runs each analysis.

The following tables compare general and technical information for a number of statistical analysis packages.

The Heckman correction is a statistical technique to correct bias from non-randomly selected samples or otherwise incidentally truncated dependent variables, a pervasive issue in quantitative social sciences when using observational data. Conceptually, this is achieved by explicitly modelling the individual sampling probability of each observation together with the conditional expectation of the dependent variable. The resulting likelihood function is mathematically similar to the tobit model for censored dependent variables, a connection first drawn by James Heckman in 1974. Heckman also developed a two-step control function approach to estimate this model, which avoids the computational burden of having to estimate both equations jointly, albeit at the cost of inefficiency. Heckman received the Nobel Memorial Prize in Economic Sciences in 2000 for his work in this field.

In statistics, the Breusch–Godfrey test is used to assess the validity of some of the modelling assumptions inherent in applying regression-like models to observed data series. In particular, it tests for the presence of serial correlation that has not been included in a proposed model structure and which, if present, would mean that incorrect conclusions would be drawn from other tests or that sub-optimal estimates of model parameters would be obtained.

A Newey–West estimator is used in statistics and econometrics to provide an estimate of the covariance matrix of the parameters of a regression-type model where the standard assumptions of regression analysis do not apply. It was devised by Whitney K. Newey and Kenneth D. West in 1987, although there are a number of later variants. The estimator is used to try to overcome autocorrelation, and heteroskedasticity in the error terms in the models, often for regressions applied to time series data. The abbreviation "HAC," sometimes used for the estimator, stands for "heteroskedasticity and autocorrelation consistent." There are a number of HAC estimators described in, and HAC estimator does not refer uniquely to Newey-West. One version of Newey-West Bartlett requires the user to specify the bandwidth and usage of the Bartlett Kernel from Kernel density estimation

<span class="mw-page-title-main">Org-mode</span> Open source mode for GNU Emacs

Org Mode is a mode for document editing, formatting, and organizing within the free software text editor GNU Emacs and its derivatives, designed for notes, planning, and authoring. The name is used to encompass plain text files that include simple marks to indicate levels of a hierarchy, and an editor with functions that can read the markup and manipulate hierarchy elements.

SHAZAM is a comprehensive econometrics and statistics package for estimating, testing, simulating and forecasting many types of econometrics and statistical models. SHAZAM was originally created in 1977 by Kenneth White.

Free statistical software is a practical alternative to commercial packages. Many of the free to use programs aim to be similar in function to commercial packages, in that they are general statistical packages that perform a variety of statistical analyses. Many other free to use programs were designed specifically for particular functions, like factor analysis, power analysis in sample size calculations, classification and regression trees, or analysis of missing data.

<span class="mw-page-title-main">LIMDEP</span>

LIMDEP is an econometric and statistical software package with a variety of estimation tools. In addition to the core econometric tools for analysis of cross sections and time series, LIMDEP supports methods for panel data analysis, frontier and efficiency estimation and discrete choice modeling. The package also provides a programming language to allow the user to specify, estimate and analyze models that are not contained in the built in menus of model forms.

<span class="mw-page-title-main">Stan (software)</span> Probabilistic programming language for Bayesian inference

Stan is a probabilistic programming language for statistical inference written in C++. The Stan language is used to specify a (Bayesian) statistical model with an imperative program calculating the log probability density function.

References

  1. Allin F. Cottrell (21 July 2023). "gretl 2023b released" . Retrieved 1 August 2023.
  2. "gretl function packages".
  3. Baiocchi, Giovanni; Distaso, Walter (2003). "GRETL: Econometric software for the GNU generation". Journal of Applied Econometrics. 18: 105–110. CiteSeerX   10.1.1.466.7942 . doi:10.1002/jae.704.
  4. "GRETL: 1.6.0 and its numerical accuracy". Archived from the original on 2012-12-16.{{cite journal}}: Cite journal requires |journal= (help)
  5. Mixon Jr, J. Wilson; Smith, Ryan J. (2006). "Teaching undergraduate econometrics with GRETL". Journal of Applied Econometrics. 21 (7): 1103–1107. doi:10.1002/jae.927.
  6. Tarassow, Artur (2019). "Practical Empirical Research Using gretl and hansl". Australian Economic Review. 52 (2): 255–271. doi:10.1111/1467-8462.12324. S2CID   195431406.
  7. Rosenblad, Andreas (2008). "gretl 1.7.3". Journal of Statistical Software. 25 (1): 1–14. doi: 10.18637/jss.v025.s01 .
  8. "A Hansl Primer" (PDF).
  9. Cottrell, Allin (2017). "Hansl". Hansl: a DSL for econometrics. pp. 1–10. doi:10.1145/3039895.3039896. ISBN   9781450348454. S2CID   15784497.
  10. Yalta, A. Talha; Schreiber, Sven (2012). "Random Number Generation in gretl". Journal of Statistical Software. 50 (Code Snippet 1). doi: 10.18637/jss.v050.c01 . ISSN   1548-7660.
  11. "Lee Adkins' book".