Gretl Manual

Gnu Regression, Econometrics and Time-series Library

Allin Cottrell

Department of Economics
Wake Forest University
April, 2005

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation (see http://www.gnu.org/licenses/fdl.html).


Table of Contents
1. Introduction
Features at a glance
Acknowledgements
Installing the programs
Linux
MS Windows
Updating
2. Getting started
Let's run a regression
Estimation output
The main window menus
The gretl toolbar
3. Modes of working
Command scripts
Saving script objects
The gretl console
The Session concept
Introduction
The model table
The graph page
Saving and re-opening sessions
4. Data files
Native format
Other data file formats
Binary databases
Online access to databases
RATS 4 databases
Creating a data file from scratch
Common points on imported data
Appending imported data
Using the built-in spreadsheet
Selecting from a database
Creating a gretl data file independently
Further note
Missing data values
Data file collections
5. Special functions in genr
Introduction
Time-series filters
The Hodrick–Prescott filter
The Baxter and King filter
Resampling and bootstrapping
Handling missing values
Retrieving internal variables
6. Sub-sampling a dataset
Introduction
Setting the sample
Restricting the sample
Random sampling
The Sample menu items
7. Panel data
Panel structure
Dummy variables
Lags and differences with panel data
Pooled estimation
Illustration: the Penn World Table
8. Graphs and plots
Gnuplot graphs
Boxplots
9. Nonlinear least squares
Introduction and examples
Initializing the parameters
NLS dialog window
Analytical and numerical derivatives
Controlling termination
Details on the code
Numerical accuracy
10. Loop constructs
Introduction
Loop control variants
Count loop
While loop
Index loop
For each loop
For loop
Progressive mode
Loop examples
Monte Carlo example
Iterated least squares
Indexed loop examples
11. User-defined functions
Introduction
Defining a function
Calling a function
Scope of variables
Return values
Error checking
12. Options, arguments and path-searching
gretl
gretlcli
Path searching
MS Windows
13. Command Reference
Introduction
gretl commands
add
addobs
addto
adf
append
ar
arch
arma
boxplot
break
chow
coeffsum
coint
coint2
corc
corr
corrgm
criteria
critical
cusum
data
delete
diff
else
end
endif
endloop
eqnprint
equation
estimate
fcast
fcasterr
fit
freq
function
garch
genr
gnuplot
graph
hausman
hccm
help
hilu
hsk
hurst
if
import
include
info
label
kpss
labels
lad
lags
ldiff
leverage
lmtest
logistic
logit
logs
loop
mahal
meantest
modeltab
mpols
multiply
nls
noecho
nulldata
ols
omit
omitfrom
open
outfile
panel
pca
pergm
poisson
plot
pooled
print
printf
probit
pvalue
pwe
quit
rename
reset
restrict
rhodiff
rmplot
run
runs
scatters
seed
set
setobs
setmiss
shell
sim
smpl
spearman
square
store
summary
system
tabprint
testuhat
tobit
tsls
var
varlist
vartest
vif
wls
Estimators and tests: summary
14. Troubleshooting gretl
Bug reports
Auxiliary programs
15. The command line interface
Gretl at the console
Changes from Ramanathan's ESL
A. Data file details
Basic native format
Traditional ESL format
Binary database details
B. Technical notes
C. Numerical accuracy
D. Advanced econometric analysis with free software
E. Listing of URLs
Bibliography
List of Tables
4-1. Typical locations for file collections
9-1. Nonlinear regression: the NIST tests
12-1. Default path settings
13-1. Examples of use of genr command
13-2. Estimators
13-3. Tests for models
13-4. Long- and short-form options
List of Figures
2-1. Practice data files window
2-2. Main window, with a practice data file open
2-3. Model specification dialog
2-4. Model output window
3-1. Script window, editing a command file
3-2. Icon view: one model and one graph have been added to the default icons
3-3. Example of model table
8-1. gretl's gnuplot controller
9-1. NLS dialog box
List of Examples
7-1. Use of the Penn World Table
9-1. Consumption function from Greene
9-2. Nonlinear function from Russell Davidson
10-1. Simple Monte Carlo loop
10-2. Nonlinear consumption function
10-3. ARMA 1, 1
10-4. Panel statistics
10-5. String substitution