gretl is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
statistical package, mainly for
econometrics
Econometrics is the application of Statistics, statistical methods to economic data in order to give Empirical evidence, empirical content to economic relationships.M. Hashem Pesaran (1987). "Econometrics," ''The New Palgrave: A Dictionary of ...
. The name is an acronym for
''G''nu ''R''egression, ''E''conometrics and
''T''ime-series ''L''ibrary.
It has both a
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
(GUI) and a
command-line interface
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
. It is written in
C, uses
GTK+
GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprie ...
as
widget toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs.
Most widg ...
for creating its GUI, and calls
gnuplot
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 (Linux, Unix, Microsoft Windows, macOS, FreeDOS, an ...
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
Stata (, , alternatively , occasionally stylized as 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 fie ...
,
Python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pro ...
,
Octave
In music, an octave ( la, octavus: eighth) or perfect octave (sometimes called the diapason) is the interval between one musical pitch and another with double its frequency. The octave relationship is a natural phenomenon that has been refer ...
,
Ox and
Julia
Julia is usually a feminine given name. It is a Latinate feminine form of the name Julio and Julius. (For further details on etymology, see the Wiktionary entry "Julius".) The given name ''Julia'' had been in use throughout Late Antiquity (e.g ...
.
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.
gretl can output models as
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
files.
Besides
English
English usually refers to:
* English language
* English people
English may also refer to:
Peoples, culture, and language
* ''English'', an adjective for something of, from, or related to England
** English national ide ...
, gretl is also available in
Albanian
Albanian may refer to:
*Pertaining to Albania in Southeast Europe; in particular:
**Albanians, an ethnic group native to the Balkans
**Albanian language
**Albanian culture
**Demographics of Albania, includes other ethnic groups within the country ...
,
Basque
Basque may refer to:
* Basques, an ethnic group of Spain and France
* Basque language, their language
Places
* Basque Country (greater region), the homeland of the Basque people with parts in both Spain and France
* Basque Country (autonomous co ...
,
Bulgarian
Bulgarian may refer to:
* Something of, from, or related to the country of Bulgaria
* Bulgarians, a South Slavic ethnic group
* Bulgarian language, a Slavic language
* Bulgarian alphabet
* A citizen of Bulgaria, see Demographics of Bulgaria
* Bul ...
,
Catalan
Catalan may refer to:
Catalonia
From, or related to Catalonia:
* Catalan language, a Romance language
* Catalans, an ethnic group formed by the people from, or with origins in, Northern or southern Catalonia
Places
* 13178 Catalan, asteroid #1 ...
,
Chinese
Chinese can refer to:
* Something related to China
* Chinese people, people of Chinese nationality, citizenship, and/or ethnicity
**''Zhonghua minzu'', the supra-ethnic concept of the Chinese nation
** List of ethnic groups in China, people of ...
,
Czech
Czech may refer to:
* Anything from or related to the Czech Republic, a country in Europe
** Czech language
** Czechs, the people of the area
** Czech culture
** Czech cuisine
* One of three mythical brothers, Lech, Czech, and Rus'
Places
* Czech, ...
,
French,
Galician,
German
German(s) may refer to:
* Germany (of or related to)
** Germania (historical use)
* Germans, citizens of Germany, people of German ancestry, or native speakers of the German language
** For citizens of Germany, see also German nationality law
**Ge ...
,
Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece, a country in Southern Europe:
*Greeks, an ethnic group.
*Greek language, a branch of the Indo-European language family.
**Proto-Greek language, the assumed last common ancestor ...
,
Italian
Italian(s) may refer to:
* Anything of, from, or related to the people of Italy over the centuries
** Italians, an ethnic group or simply a citizen of the Italian Republic or Italian Kingdom
** Italian language, a Romance language
*** Regional Ita ...
,
Polish
Polish may refer to:
* Anything from or related to Poland, a country in Europe
* Polish language
* Poles
Poles,, ; singular masculine: ''Polak'', singular feminine: ''Polka'' or Polish people, are a West Slavic nation and ethnic group, w ...
,
Portuguese
Portuguese may refer to:
* anything of, from, or related to the country and nation of Portugal
** Portuguese cuisine, traditional foods
** Portuguese language, a Romance language
*** Portuguese dialects, variants of the Portuguese language
** Portu ...
(both varieties),
Romanian
Romanian may refer to:
*anything of, from, or related to the country and nation of Romania
**Romanians, an ethnic group
**Romanian language, a Romance language
*** Romanian dialects, variants of the Romanian language
** Romanian cuisine, tradition ...
,
Russian
Russian(s) refers to anything related to Russia, including:
*Russians (, ''russkiye''), an ethnic group of the East Slavic peoples, primarily living in Russia and neighboring countries
*Rossiyane (), Russian language term for all citizens and peo ...
,
Spanish
Spanish might refer to:
* Items from or related to Spain:
**Spaniards are a nation and ethnic group indigenous to Spain
**Spanish language, spoken in Spain and many Latin American countries
**Spanish cuisine
Other places
* Spanish, Ontario, Can ...
,
Turkish and
Ukrainian
Ukrainian may refer to:
* Something of, from, or related to Ukraine
* Something relating to Ukrainians, an East Slavic people from Eastern Europe
* Something relating to demographics of Ukraine in terms of demography and population of Ukraine
* So ...
.
Gretl has been reviewed several times in the ''
Journal of Applied Econometrics
The ''Journal of Applied Econometrics'' is a peer-reviewed academic journal covering econometrics, published by John Wiley & Sons. It focuses on applications rather than theoretical issues. It was established in 1986 and is published seven times p ...
'' 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
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
-based data format.
It can also import
ASCII
ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
,
CSV,
databank,
EViews
EViews is a statistical package for Microsoft Windows, Windows, used mainly for time-series oriented econometrics, econometric analysis. It is developed by Quantitative Micro Software (QMS), now a part of IHS Inc., IHS. Version 1.0 was released ...
,
Excel
ExCeL London (an abbreviation for Exhibition Centre London) is an exhibition centre, international convention centre and former hospital in the Custom House area of Newham, East London. It is situated on a site on the northern quay of the ...
,
Gnumeric
Gnumeric is a spreadsheet program that is part of the GNOME Free Software Desktop Project. Gnumeric version 1.0 was released on 31 December 2001. Gnumeric is distributed as free software under the GNU General Public License; it is intended to r ...
,
GNU Octave
GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a langu ...
,
JMulTi
JMulTi is an open-source interactive software for econometric analysis, specialised in univariate and multivariate time series analysis. It has a Java graphical user interface.
The motivation for its designed was to provide the means by which s ...
,
OpenDocument
The Open Document Format for Office Applications (ODF), also known as OpenDocument, is an open file format for word processing documents, spreadsheets, presentations and graphics and using ZIP-compressed XML files. It was developed wi ...
spreadsheets,
PcGive,
RATS 4,
SAS xport,
SPSS
SPSS Statistics is a statistical software suite developed by IBM for data management, advanced analytics, multivariate analysis, business intelligence, and criminal investigation. Long produced by SPSS Inc., it was acquired by IBM in 2009. C ...
, and
Stata
Stata (, , alternatively , occasionally stylized as 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 fie ...
files. Since version 2020c, the
GeoJSON
GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. It is based on the JSON format.
The features include points (therefore addresses and locations), line strings ( ...
and
Shapefile
The shapefile format is a geospatial vector data format for geographic information system (GIS) software. It is developed and regulated by Esri as a mostly open specification for data interoperability among Esri and other GIS software product ...
formats are also supported, for thematic map creation.
It can export to
Stata
Stata (, , alternatively , occasionally stylized as 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 fie ...
,
GNU Octave
GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a langu ...
,
R,
CSV,
JMulTi
JMulTi is an open-source interactive software for econometric analysis, specialised in univariate and multivariate time series analysis. It has a Java graphical user interface.
The motivation for its designed was to provide the means by which s ...
, and
PcGive file formats.
hansl
Gretl has its own
scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripting ...
, called ''hansl'' (which is a
recursive acronym
A recursive acronym is an acronym that refers to itself, and appears most frequently in computer programming. The term was first used in print in 1979 in Douglas Hofstadter's book '' Gödel, Escher, Bach: An Eternal Golden Braid'', in which Hof ...
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. It can be considered a
domain-specific language
A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
for econometrics. Like other scientifically oriented programming languages, such as
MATLAB
MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation ...
and
Julia
Julia is usually a feminine given name. It is a Latinate feminine form of the name Julio and Julius. (For further details on etymology, see the Wiktionary entry "Julius".) The given name ''Julia'' had been in use throughout Late Antiquity (e.g ...
, matrices are supported natively as a primitive variable type.
A simple example of hansl:
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). 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:
* Dougherty, Christopher ''Introduction to Econometrics'' (Oxford University Press)
* Kufel, Tadeusz ''Ekonometria'' (Wydawnictwo Naukowe PWN); in Polish (Russian version also available)
In addition, a free supplement
to Hill, Griffiths and Lim ''Principles of Econometrics'' (Wiley) is available.
See also
*
Comparison of statistical packages
The following tables compare general and technical information for a number of statistical analysis packages.
General information
Operating system support
ANOVA
Support for various ANOVA methods
Regression
Support for various Regression an ...
*
MATLAB
MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation ...
*
Scilab
Scilab is a free and open-source, cross-platform numerical computational package and a high-level, numerically oriented programming language. It can be used for signal processing, statistical analysis, image enhancement, fluid dynamics simulat ...
References
External links
*
GretlWeb''Gretl User's Guide''
''Gretl Command Reference''
Gretl Conference. Berlin, 2015
{{Statistical software
Cross-platform free software
Cross-platform software
Econometrics software
Free econometrics software
Free multilingual software
Free plotting software
Free software programmed in C
Free statistical software
GNU Project software
Numerical analysis software for Linux
Numerical analysis software for macOS
Numerical analysis software for Windows
Numerical programming languages
Numerical software
Plotting software
Regression and curve fitting software
Science software that uses GTK
Statistical programming languages
Time series software