Gretl Manual
Total Page:16
File Type:pdf, Size:1020Kb
Gretl Manual Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University August, 2005 Gretl Manual: Gnu Regression, Econometrics and Time-series Library by Allin Cottrell Copyright © 2001–2005 Allin Cottrell 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). iii Table of Contents 1. Introduction........................................................................................................................................... 1 Features at a glance ......................................................................................................................... 1 Acknowledgements .......................................................................................................................... 1 Installing the programs................................................................................................................... 2 2. Getting started ...................................................................................................................................... 4 Let’s run a regression ...................................................................................................................... 4 Estimation output............................................................................................................................. 6 The main window menus................................................................................................................ 7 The gretl toolbar............................................................................................................................. 11 3. Modes of working .............................................................................................................................. 12 Command scripts ........................................................................................................................... 12 Saving script objects...................................................................................................................... 13 The gretl console ............................................................................................................................ 14 The Session concept ...................................................................................................................... 14 4. Data files ............................................................................................................................................... 18 Native format .................................................................................................................................. 18 Other data file formats.................................................................................................................. 18 Binary databases............................................................................................................................. 18 Creating a data file from scratch ................................................................................................ 19 Missing data values........................................................................................................................ 21 Data file collections........................................................................................................................ 22 5. Special functions in genr.................................................................................................................. 24 Introduction..................................................................................................................................... 24 Time-series filters........................................................................................................................... 24 Resampling and bootstrapping ................................................................................................... 25 Handling missing values ............................................................................................................... 25 Retrieving internal variables ........................................................................................................ 25 6. Sub-sampling a dataset ..................................................................................................................... 27 Introduction..................................................................................................................................... 27 Setting the sample.......................................................................................................................... 27 Restricting the sample................................................................................................................... 27 Random sampling........................................................................................................................... 29 The Sample menu items................................................................................................................ 29 7. Panel data ............................................................................................................................................. 30 Panel structure................................................................................................................................ 30 Dummy variables............................................................................................................................ 30 Lags and differences with panel data......................................................................................... 31 Pooled estimation........................................................................................................................... 31 Illustration: the Penn World Table.............................................................................................. 32 8. Graphs and plots ................................................................................................................................ 33 Gnuplot graphs ............................................................................................................................... 33 Boxplots............................................................................................................................................ 34 9. Nonlinear least squares .................................................................................................................... 36 Introduction and examples .......................................................................................................... 36 Initializing the parameters ........................................................................................................... 36 NLS dialog window ......................................................................................................................... 36 Analytical and numerical derivatives......................................................................................... 37 Controlling termination ................................................................................................................ 37 Details on the code......................................................................................................................... 38 Numerical accuracy........................................................................................................................ 38 iv 10. Loop constructs................................................................................................................................ 40 Introduction..................................................................................................................................... 40 Loop control variants .................................................................................................................... 40 Progressive mode ........................................................................................................................... 42 Loop examples ................................................................................................................................ 42 11. User-defined functions ................................................................................................................... 46 Introduction..................................................................................................................................... 46 Defining a function ........................................................................................................................ 46 Calling a function ........................................................................................................................... 46 Scope of variables........................................................................................................................... 47 Return values................................................................................................................................... 47 Error checking ................................................................................................................................. 48 12. Cointegration and Vector Error Correction Models................................................................ 49 The Johansen