0% found this document useful (0 votes)
2K views8 pages

Gretl in Research

This document discusses the open source statistical software package Gretl. It describes Gretl's main features, which include supporting a wide range of statistical and econometric methods for cross-sectional, time series, and panel data. Gretl can import and export various data formats and integrates well with R for additional statistical methods. The document also covers Gretl's graphical user interface and command line interface, noting that Gretl can be used either through its menus and dialog boxes or by entering commands directly into the Gretl console.

Uploaded by

Prathap Veera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views8 pages

Gretl in Research

This document discusses the open source statistical software package Gretl. It describes Gretl's main features, which include supporting a wide range of statistical and econometric methods for cross-sectional, time series, and panel data. Gretl can import and export various data formats and integrates well with R for additional statistical methods. The document also covers Gretl's graphical user interface and command line interface, noting that Gretl can be used either through its menus and dialog boxes or by entering commands directly into the Gretl console.

Uploaded by

Prathap Veera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Journal of Information, Control and Management Systems, Vol. 10, (2012), No.

2 165

INTRODUCTION TO STATISTICAL MODELING IN


GRETL AND ITS APPLICATION IN ECONOMETRICS
Luk FALT, Lucia PANKOV

University of ilina, Faculty of Management Science and Informatics,


Slovak Republic
e-mail: [email protected] , [email protected]

Abstract

Today, quantitative models based on statistics are widely used and popular,
econometrics not excluding. In this field statistical models are used to quantify
economic problems, hence econometrics is considered as a strategic tool for
problem solving, decision-making or information management. Usually, the
quantification of these models is performed using computer. Therefore it is no
surprise that software selection is important in econometrics analysis. An open
source software Gretl seems to be a good choice. This paper deal with main
features of gretl, discussing its advantages too. Finally authors present the use
of this software in teaching of Econometrics subject at the Faculty of
Management Science and Informatics.
Keywords: gretl, statistical models, econometrics, teaching, gretl console,

1 INTRODUCTION TO GRETL
Gretl is an acronym for Gnu Regression, Econometrics and Time-series Library.
It is an open-source statistical software package with the main focus being on statistical
methods for econometric analyses. This software package, mainly for doing
econometrics, is easy to use and reasonably powerful.
Its origin is the Econometrics Software Library (ESL) package written by Ramu
Ramanathan, Professor Emeritus at the Economics Department, University of
California, San Diego, who later made it open source and handed it over to Professor
Allin Cottrell at the Department of Economics, Wake Forest University. After
releasing a few development versions the first stable version, gretl 1.0, was released to
the public on November 15, 2002. It is in continuous development, with the latest
version being 1.7.4, released on March 21, 2008.
Even though originally developed on Linux, gretl is now available also on
Microsoft Windows and Mac OS X. It is written in the C programming language and
available for free according to the GNU General Public License
166 Statistical Modeling in gretl and its Use in Teaching Econometrics

(http://www.gnu.org/licenses/gpl.html) it can be downloaded from


http://gretl.sourceforge.net and installed on a personal computer. This means that
unlike software sold by commercial vendors (SAS, Eviews) you can redistribute and/or
modify gretl under the terms of the GNU General Public License (GPL) as published
by the Free Software Foundation. Like many other open-source software projects, gretl
is hosted on SourceForge and the source code can be found at
http://gretl.cvs.sourceforge.net/gretl/gretl/. It means that you can obtain the source code
and compile it on whatever platform you'd like.
Gretl's motto is by econometricians, for econometricians.
The paper is divided into 5 sections: section 2 describes the main features of gretl,
section 3 talks about graphical and command line interface. In part 4 the teaching
process using gretl is discussed. Finally, section 5 concludes the paper.

2 MAIN FEATURES OF GRETL


Gretl supports a wide range of statistical methods, with a focus on methods used
in econometrics, especially regression methods. For cross-sectional data one can
estimate several linear models, besides OLS also weighted least squares, two-stage
least squares and least absolute deviation regression as well as many nonlinear models,
such as logit, probit, tobit, heckit, Poisson, logistic and non-linear least squares. One
can also specify and estimate maximum likelihood, generalized method of moments
(GMM) and simultaneous equations models, with the latter including seemingly
unrelated regressions (SUR), ordinary or weighted least squares, two- or three-stage
least squares and full or limited information maximum likelihood estimators. For panel
data one can estimate, e.g., models with fixed or random effects and dynamic panel
models.
Likewise, for time series data a wide range of analysis methods are available,
including filtering with simple and exponential moving average, the Hodrick-Prescott
filter and Baxter-King band pass filter, ADF, ADF-GLS and KPSS unit root tests as
well as Engle-Granger and Johansen cointegration tests, estimation using the
Cochrane-Orcutt, Hildreth-Lu and Prais- Winsten estimators, and modeling with
ARIMA, ARCH/GARCH, VAR and VECM. Besides these built-in methods, gretl is
also integrated with the two external time series software packages X-12-ARIMA and
TRAMO/SEATS and provides GUI frontends for these, accessible from inside gretl.
Especially designed for mathematicians, all outputs and results of these models
can be saved in the file format of LaTeX (such as tables or as equations). In addition to
that, Gretl uses a to generate graphs.
Besides the above mentioned features, gretl also provides access to standard
statistical methods such as descriptive statistics, cross tabulation and correlation
measures as well as plotting of histograms, time series plots, scatter plots, boxplots and
3D plots using separate Gnu program called gnuplot. The layout of the graphs can be
changed to the user's taste with an advanced GUI for plot controls.
Journal of Information, Control and Management Systems, Vol. 10, (2012), No.2 167

Gretl uses its own XML-based file format, but can import data from several other
file formats, including comma-separated values (CSV), ASCII, Open Document
Format (ODF) for spreadsheets, Microsoft Excel, Gnumeric, GNU Octave, EViews,
Stata and JMulTi. It can also export data to CSV, R, GNU Octave, JMulTi and PcGive
data formats.
Included in this software there is a large database which can be used as examples
and moreover additional data can be downloaded directly from the Gretl web site.

2.1 Interaction with R


Gretl is designed as a very user-friendly econometrics package. While it is also
reasonably sophisticated, it can't be considered as a general-purpose statistical software
as it lacks some of the specialized statistical methods that a working econometrician
might desire. However this is not such a big problem due its perfect integration with R.
Gretl offers an interface to the comprehensive free-software statistical package, GNU
R. R is a language and environment for statistical computing and graphics. Gretl has
had for a long time the ability to save the current data set in a format suitable for
analysis using R, or to launch an R session with the current gretl data set automatically
loaded into R's workspace. As of version 1.7.5, however, gretl's interaction with R has
become much more sophisticated: it is now possible to embed R scripts within gretl
scripts and have the two programs exchange data and results in a relatively transparent
way. So if one has installed R and wants to use a statistical method that is not yet
available in gretl but is available in R, one can click on the menu entry Tools > Start
GNU R. This will export the currently active gretl data set to R format and open R with
this data set loaded, ready for further analyses in R (see Figure 1).

3 MAIN FEATURES OF GRETL

3.1 Graphical User Interface


There are several different ways to work in gretl. Until you learn to use gretl's
rather simple and intuitive language syntax, the easiest way to use the program is
through its built in graphical user interface (GUI). Basically, you use your computer's
mouse to open dialog boxes. Fill in the desired options and execute the commands by
clicking on the OK button. Those of you who grew up using MS Windows or the
Macintosh will find this way of working quite easy. Gretl is using your input from the
dialogs, delivered by mouse clicks and a few keystrokes, to generate computer code
that is executed in the background.
The reason for creating GUI was to close the subject of econometrics to the
large audience as GUI is more friendly way for majority of computers users.
168 Statistical Modeling in gretl and its Use in Teaching Econometrics

Figure 1 R started from inside gretl, with the currently active gretl
data set loaded into R
Across the top of the window you find the menu bar. From here you import
and manipulate data, analyze data, and manage output. At the bottom of the window is
the gretl toolbar. This contains a number of useful utilities that can be launched from
within gretl. Among other things, you can get to the gretl web site from here, open the
pdf version of the manual, or open the MS Windows calculator (very handy!). In figure
2 below is the main window in gretl.

3.2 Command Line Interface and Gretl Console


Gretl offers a command line interface as well and those of you who use Linux
or are old DOS warriors may want to use it this way. The command line version is
launched by executing gretlcli in a console window. In this mode you type in valid
gretl commands either singly from the console. Once you learn the commands, this is
surely the easiest way to work.
The second choice instead of clicking the menus and buttons, you can use gretl
by entering commands in the gretl console. The console is accessible from the button at
the bottom of the main window.
Journal of Information, Control and Management Systems, Vol. 10, (2012), No.2 169

Figure 2 Main GUI window of gretl

If you want to execute a series of commands, you do this using scripts. Script
is a text file that contains commands. It is common to use a script file, instead of mouse
clicks as in the previous section. There are various advantages of using script file, but
the most important is that it enables you to reproduce the result from the original data
set. One of the great things about gretl is that it accumulates commands executed
singly from the console into a command log that can be run in its entirety at another
time. So, if you have completed an analysis that involves many sequential steps, the
script can be open and run in one step to get the desired result. The scripting language
includes matrix operations, loop constructs, boolean operators, user-defined functions,
and other features one should expect, besides commands for gretl's built-in statistical
methods.

4 GRETL IN TEACHING PROCESS


Moreover, gretl is a wonderful program for teaching and doing econometrics.
Nowadays the role of students in the learning process is emphasized more than before.
In the case of Econometrics (which will play an outstanding role in Economics and
Business degrees), our experience has shown that doing Econometrics is a suitable way
of learning Econometrics and also that Gretl is a powerful teaching tool, providing our
students a wide variety of competences and skills.
From the teachers perspective the use of Gretl offers several advantages, since
this open source software provides an easy intuitive interface, allowing different ways
of working from interactive point-and-click to batch processing. This flexibility is one
170 Statistical Modeling in gretl and its Use in Teaching Econometrics

of the most outstanding characteristics of Gretl offering teachers a good opportunity to


re-think contents, methods and evaluation procedures.
We have partially implemented gretl into a teaching process of Prognostics -
the subject dealing with time series and advanced econometrics. The experience we
have carried out was great. The implementation of practical sessions with Gretl has
been a successful experience for students and teachers. Before students were used to
use numerical processors such as Excel to make their time series analysis and
predictions. However it took a long time to make an analysis and quantification of the
model as students had to do all the stuff manually. The focus was on calculation and
formula writing. With implementation of gretl the teaching process has changed.
Today students can rely on gretl in making calculations and quantification of models
and most of the time they try to compare models and analyze the data, analyzing
statistical hypothesis and forecasting properties of models, testing different
quantification methods, making great outputs and so on. The focus is on analysis and
that is what is important. As stated, they have large amount of models to choose from
in. Regarding Time Series, Gretl facilities include ARIMA and VARMA, VEC,
GARCH, unit-root and cointegration tests.
Point-and-click environment is also very popular among some students.
Especially managers who have a little experience with programming and writing
commands appreciate this type of working. For these students, this a huge advantage
compared to R which is strictly command oriented. On the other hand, students who
are familiarized with writing commands can switch to gretl console and write their own
commands and hence get the most from this program.
In all the described cases, we must stress another additional advantage related
to Gretl educational process - gretl comes with many sample data files. Gretl include
the access to datasets associated with economic background (mainly US
macroeconomic time series) as those of Ramanathan, Greene, Stock and Watson,
Greene or Gujarati. Moreover, from the gretl web site, you have access to more sample
data sets.

5 CONCLUSION
Econometrics should be considered as a strategic tool whose teaching-learning
method should be designed paying special attention to competences as problem
solving, decision-making or information management. And since the election of
suitable software is a key point in the teaching learning process, econometrics not
excluding, we have experienced the potential of Gretl leading to satisfactory results for
both teachers and learners.
Though gretl can't be considered as a general-purpose statistical software (its
main functions are time series analysis, regression analysis and various econometric
tests), it is very useful mainly for econometricians and statisticians. In addition to that
the interaction with R with makes it a very powerful tool.
Journal of Information, Control and Management Systems, Vol. 10, (2012), No.2 171

Gretl is easy-to-use statistical software that offers most of the features


necessary for performing econometrics and time series analyses. Its user-friendliness
and the fact that it is available as open source makes it an ideal software for teaching
and learning econometrics and time series analysis. Since the students can freely
download and install the software at their home computers, they need not rely on the
teaching institutions computer labs, which should save money for the latter. To most of
these students gretl provides all of the analytical firepower they will require as they
proceed into their careers.
Although many of gretl's users will probably mainly use the program through
its GUI, it should be noted that it also has an advanced scripting language, which is
very useful when one is doing research and wants to write their own functions. This
can be used by running script files with commands.
Professional econometricians and economists will also find gretl useful. The
facts that it is open source and programmed in the widely used C programming
language make it easy for other statisticians and econometricians with programming
skills to join in the development of the program, adding more features and making it
even better. The future of gretl thus looks good. It can be recommended to both
students and professionals.

REFERENCES
[1] Adkins, L. C. (2010). Using gretl for Principles of Econometrics, 3rd Edition,
available online at [www.learneconometrics.com/gretl/ebook.pdf]
[2] Adkins , L. C. (2006). Undergraduate Econometrics using GRETL,
Available online at
[http://www.learneconometrics.com/class/4213/gretl/ebook.pdf]
[3] Lukik, M., Slosiar, V. (2010). Zklady prce s ekonometrickm programom
GRETL, available online at
[http://www.fhi.sk/files/katedry/kove/veda-vyskum/prace/2010/Lukacik-
Slosiar2010.pdf]
[4] Prez, R., Lpez, A. J. (2009). Teaching and Learning Econometrics with Gretl
Summarizing Some Experiences, Chapter 12 in Econometrics with gretl.
Proceedings of the gretl Conference 2009, pp 191-201
[5] The gretl Team, Winston-Salem, NC (2008). Gretl 1.7.3., Journal of Statistical
Software, March 2008, Volume 25
[6] The homepage of gretl project [http://gretl.sourceforge.net]
[7] The Wikipedia webpage [http://en.wikipedia.org/wiki/Gretl]
172 Statistical Modeling in gretl and its Use in Teaching Econometrics

You might also like