Gretl User's Guide

Gretl User's Guide

Gretl User’s Guide Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University Riccardo “Jack” Lucchetti Dipartimento di Economia Università Politecnica delle Marche August, 2021 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). Contents 1 Introduction 1 1.1 Features at a glance.........................................1 1.2 Acknowledgements.........................................1 1.3 Installing the programs.......................................2 I Running the program3 2 Getting started 4 2.1 Let’s run a regression........................................4 2.2 Estimation output..........................................6 2.3 The main window menus......................................7 2.4 Keyboard shortcuts......................................... 10 2.5 The gretl toolbar........................................... 10 3 Modes of working 12 3.1 Command scripts........................................... 12 3.2 Saving script objects......................................... 14 3.3 The gretl console........................................... 14 3.4 The Session concept......................................... 15 4 Data files 18 4.1 Data file formats........................................... 18 4.2 Databases............................................... 18 4.3 Creating a dataset from scratch.................................. 19 4.4 Structuring a dataset......................................... 21 4.5 Panel data specifics......................................... 23 4.6 Missing data values......................................... 27 4.7 Maximum size of data sets..................................... 28 4.8 Data file collections......................................... 28 4.9 Assembling data from multiple sources............................. 30 5 Sub-sampling a dataset 31 5.1 Introduction.............................................. 31 5.2 Setting the sample.......................................... 31 5.3 Restricting the sample........................................ 32 i Contents ii 5.4 Panel data............................................... 33 5.5 Resampling and bootstrapping.................................. 34 6 Graphs and plots 36 6.1 Gnuplot graphs............................................ 36 6.2 Plotting graphs from scripts.................................... 40 6.3 Boxplots................................................ 44 7 Joining data sources 47 7.1 Introduction.............................................. 47 7.2 Basic syntax.............................................. 47 7.3 Filtering................................................. 48 7.4 Matching with keys.......................................... 49 7.5 Aggregation.............................................. 52 7.6 String-valued key variables..................................... 52 7.7 Importing multiple series...................................... 53 7.8 A real-world case........................................... 54 7.9 The representation of dates.................................... 56 7.10 Time-series data........................................... 57 7.11 Special handling of time columns................................. 60 7.12 Panel data............................................... 60 7.13 Memo: join options......................................... 62 8 Realtime data 65 8.1 Introduction.............................................. 65 8.2 Atomic format for realtime data................................. 65 8.3 More on time-related options................................... 67 8.4 Getting a certain data vintage................................... 67 8.5 Getting the n-th release for each observation period..................... 68 8.6 Getting the values at a fixed lag after the observation period................ 69 8.7 Getting the revision history for an observation........................ 70 9 Temporal disaggregation 73 9.1 Introduction.............................................. 73 9.2 Notation and design......................................... 74 9.3 Overview of data handling..................................... 75 9.4 Function signature.......................................... 75 9.5 Handling of deterministic terms.................................. 77 9.6 Some technical details........................................ 77 9.7 The plot option............................................ 79 9.8 Multiple low-frequency series................................... 79 Contents iii 9.9 Examples................................................ 80 10 Special functions in genr 81 10.1 Introduction.............................................. 81 10.2 Cumulative densities and p-values................................ 82 10.3 Retrieving internal variables (dollar accessors)......................... 83 11 Gretl data types 84 11.1 Introduction.............................................. 84 11.2 Series.................................................. 84 11.3 Scalars................................................. 85 11.4 Matrices................................................. 85 11.5 Lists................................................... 85 11.6 Strings................................................. 85 11.7 Bundles................................................. 86 11.8 Arrays.................................................. 90 11.9 The life cycle of gretl objects.................................... 93 12 Discrete variables 96 12.1 Declaring variables as discrete................................... 96 12.2 Commands for discrete variables................................. 97 13 Loop constructs 101 13.1 Introduction.............................................. 101 13.2 Loop control variants........................................ 101 13.3 Progressive mode........................................... 104 13.4 Loop examples............................................ 104 14 User-defined functions 108 14.1 Defining a function.......................................... 108 14.2 Calling a function........................................... 111 14.3 Deleting a function.......................................... 111 14.4 Function programming details................................... 112 14.5 Function packages.......................................... 119 15 Named lists and strings 120 15.1 Named lists.............................................. 120 15.2 Named strings............................................. 125 16 String-valued series 129 16.1 Introduction.............................................. 129 16.2 Creating a string-valued series................................... 129 Contents iv 16.3 Permitted operations........................................ 131 16.4 String-valued series and functions................................ 133 16.5 Other import formats........................................ 134 17 Matrix manipulation 136 17.1 Creating matrices........................................... 136 17.2 Empty matrices............................................ 137 17.3 Selecting submatrices........................................ 138 17.4 Deleting rows or columns...................................... 139 17.5 Matrix operators........................................... 140 17.6 Matrix–scalar operators....................................... 142 17.7 Matrix functions........................................... 142 17.8 Matrix accessors........................................... 148 17.9 Namespace issues.......................................... 149 17.10Creating a data series from a matrix............................... 149 17.11Matrices and lists........................................... 149 17.12Deleting a matrix........................................... 150 17.13Printing a matrix........................................... 151 17.14Example: OLS using matrices.................................... 151 18 Complex matrices 153 18.1 Introduction.............................................. 153 18.2 Creating a complex matrix..................................... 153 18.3 Indexation............................................... 154 18.4 Operators................................................ 155 18.5 Functions................................................ 155 18.6 File input/output........................................... 156 18.7 Backward compatibility....................................... 156 19 Calendar dates 160 19.1 Introduction.............................................. 160 19.2 Calendrical functions........................................ 160 19.3 Working with pre-Gregorian dates................................ 163 19.4 Year numbering............................................ 164 20 Handling mixed-frequency data 165 20.1 Basics.................................................. 165 20.2 The notion of a “MIDAS list”.................................... 167 20.3 High-frequency lag lists....................................... 168 20.4 High-frequency first differences.................................. 170 20.5 MIDAS-related plots......................................... 170 Contents v 20.6 Alternative MIDAS data methods................................. 170 21 Cheat sheet 176 21.1 Dataset handling........................................... 176 21.2 Creating/modifying variables................................... 180 21.3 Neat tricks............................................... 187 II Econometric methods 192 22 Robust

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    476 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us