Using Gretl for Principles of Econometrics, 4Th Edition Version 1.0411

Total Page:16

File Type:pdf, Size:1020Kb

Using Gretl for Principles of Econometrics, 4Th Edition Version 1.0411 Using gretl for Principles of Econometrics, 4th Edition Version 1.0411 Lee C. Adkins Professor of Economics Oklahoma State University April 7, 2014 1Visit http://www.LearnEconometrics.com/gretl.html for the latest version of this book. Also, check the errata (page 459) for changes since the last update. License Using gretl for Principles of Econometrics, 4th edition. Copyright c 2011 Lee C. Adkins. 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 AppendixF for details). i Preface The previous edition of this manual was about using the software package called gretl to do various econometric tasks required in a typical two course undergraduate or masters level econo- metrics sequence. This version tries to do the same, but several enhancements have been made that will interest those teaching more advanced courses. I have come to appreciate the power and usefulness of gretl's powerful scripting language, now called hansl. Hansl is powerful enough to do some serious computing, but simple enough for novices to learn. In this version of the book, you will find more information about writing functions and using loops to obtain basic results. The programs have been generalized in many instances so that they could be adapted for other uses if desired. As I learn more about hansl specifically and programming in general, I will no doubt revise some of the code contained here. Stay tuned for further developments. As with the last edition, the book is written specifically to be used with a particular textbook, Principles of Econometrics, 4th edition (POE4 ) by Hill, Griffiths, and Lim. It could be used with many other introductory texts. The data for all of the examples used herein are available as a package from my website at http://www.learneconometrics.com/gretl.html. If you are unfamiliar with gretl and are interested in using it in class, Mixon Jr. and Smith(2006) and Adkins(2011 a) have written a brief review of gretl and how it can be used in an undergraduate course that you may persuade you to give it a try. The chapters are arranged in the order that they appear in Principles of Econometrics. Each chapter contains a brief description of the basic models to be estimated and then gives you the specific instructions or gretl code to reproduce (nearly) all of the examples in the book. Where appropriate, I've added a bit of pedagogical material that complements what you'll find in the text. I've tried to keep this to a minimum since this is not supposed to serve as a substitute for your text book. The best part about this manual is that it, like gretl, is free. It is being distributed in Adobe's pdf format and I will make corrections to the text as I find errors. Gretl's ability to process user written functions greatly expands the usefulness of the appli- cation. In several of the chapters functions are used to estimate models, select models, and to compute various statistics. The scripting language, continues to evolve in useful ways, becoming more transparent in use and more functional. Though not explored in this book, the ability to ii give function writers access to the basic GUI and to package things into bundles is s very exciting development. Functions can be shared and imported easily through gretl, especially if you are connected to the internet. If gretl doesn't do what you want it to now, stay tuned. It soon may. If recent activity is any indication, I am confident that the the gretl team will continue to improve this already very useful application. I hope that this manual is similarly useful to those using Principles of Econometrics. There are some significant changes in the 4th edition of POE and that means there are some changes in this book from the previous edition. As in the previous edition of this e-book, I have attempted to provide gretl instructions for each and every example in the book. My solutions are not necessarily the most elegant. In some cases elegance gives way to simplicity of programming, especially with respect to the types of students who are likely to be using this book. I have made an effort to generalize some of the script so that it will be easier to adapt to new needs. I've also made liberal uses of loops and functions. These are powerful tools and a thorough understanding of them can take your gretl and econometric skills to the next level. Feel free to send suggestions. Another change in this version of the book is that I've made some effort to generalize some of the scripts. Although that should make it easier to generalize them to a new use, it does mean that they have become a little more complicated. A heavy reliance on user written functions is evident. I invite users to take the time to work through these in order to advance your programming and econometric skills. To make things easier to find in the book, I have added an index. In the pdf, you can click on the page number listed in the index and be taken to the relevant spot in the text. Also, the figure numbers, equation numbers, and citations are also `hot' and can be used in this fashion as well. Since some may prefer to print the manual out rather than work from the .pdf, I opted to make the `hot' links black in color, which disguises their functionality. Finally, I want to say that my conversion to gretl was not immediate. In fact I still use other software as occasions require, though more infrequently. That said, I have become a true believer in the power of gretl. It is now my go to software. I trust it. It is simple to use and to program. In my opinion it combines the best of Gauss and Eviews. It is both a high level programming language and a useful front-end for doing standard econometrics. The ease with which one can move back and forth from both uses makes it truly unique. As a former Gauss user, I find gretl up to the tasks that I choose. I heartily recommend that you take some time to work with it and to learn it. You can't help but come to appreciate its power. Its worth is derived from what it does, not its price. I want to thank the gretl team of Allin Cottrell and Riccardo Lucchetti for putting so much effort into gretl. I don't know how they find the time to make this such a worthwhile project. It is a terrific tool for teaching and doing econometrics. It has many capabilities beyond the ones I discuss in this book and other functions are added regularly. Also, Jack has kindly provided me with suggestions and programs that have made this much better than it would have been otherwise. iii Any remaining errors are mine alone. I also want to thank my good friend and colleague Carter Hill for suggesting I write this and Oklahoma State University and our College of Business for continuing to pay me while I work on it. Copyright c 2007, 2008, 2009, 2011 Lee C. Adkins. iv Contents 1 Introduction 1 1.1 What is Gretl?....................................1 1.1.1 Installing Gretl .................................2 1.1.2 Gretl Basics...................................3 1.1.3 Common Conventions..............................5 1.2 Importing Data.....................................6 1.3 Using the gretl Language...............................8 1.3.1 Console......................................8 1.3.2 Scripts....................................... 10 1.3.3 Sessions...................................... 12 1.3.4 Generating New Variables............................ 13 1.4 GNUPLOT....................................... 14 2 Simple Linear Regression 19 2.1 Simple Linear Regression Model........................... 19 2.2 Retrieve the Data................................... 19 v 2.3 Graph the Data.................................... 22 2.4 Estimate the Food Expenditure Relationship.................... 23 2.4.1 Elasticity..................................... 25 2.4.2 Prediction..................................... 26 2.4.3 Estimating Variance............................... 26 2.5 Repeated Sampling.................................. 27 2.6 Estimating Nonlinear Relationships......................... 31 2.7 Regression with an Indicator Variable........................ 33 2.8 Monte Carlo Simulation................................ 34 2.9 Script.......................................... 37 3 Interval Estimation and Hypothesis Testing 45 3.1 Confidence Intervals.................................. 45 3.2 Repeated Sampling.................................. 48 3.3 Monte Carlo Experiment............................... 50 3.4 Hypothesis Tests.................................... 51 3.5 Script for t-values and p-values............................ 55 3.6 Linear Combination of Parameters.......................... 57 3.7 Script.......................................... 59 4 Prediction, Goodness-of-Fit, and Modeling Issues 62 4.1 Prediction in the Food Expenditure Model..................... 62 4.2 Coefficient of Determination............................. 64 4.3 Choosing a Functional Form............................. 67 vi 4.3.1 Linear-Log Specification............................. 68 4.3.2 Residual Plots.................................. 70 4.3.3 Testing for Normality.............................. 72 4.4 Reporting Results................................... 75 4.5 Polynomial Models................................... 77 4.5.1 Wheat Yield................................... 77 4.5.2 Growth Model.................................. 79 4.5.3 Wage Equation.................................. 80 4.5.4 Generalized R2 .................................
Recommended publications
  • Python – an Introduction
    Python { AN IntroduCtion . default parameters . self documenting code Example for extensions: Gnuplot Hans Fangohr, [email protected], CED Seminar 05/02/2004 ² The wc program in Python ² Summary Overview ² Outlook ² Why Python ² Literature: How to get started ² Interactive Python (IPython) ² M. Lutz & D. Ascher: Learning Python Installing extra modules ² ² ISBN: 1565924649 (1999) (new edition 2004, ISBN: Lists ² 0596002815). We point to this book (1999) where For-loops appropriate: Chapter 1 in LP ² ! if-then ² modules and name spaces Alex Martelli: Python in a Nutshell ² ² while ISBN: 0596001886 ² string handling ² ¯le-input, output Deitel & Deitel et al: Python { How to Program ² ² functions ISBN: 0130923613 ² Numerical computation ² some other features Other resources: ² . long numbers www.python.org provides extensive . exceptions ² documentation, tools and download. dictionaries Python { an introduction 1 Python { an introduction 2 Why Python? How to get started: The interpreter and how to run code Chapter 1, p3 in LP Chapter 1, p12 in LP ! Two options: ! All sorts of reasons ;-) interactive session ² ² . Object-oriented scripting language . start Python interpreter (python.exe, python, . power of high-level language double click on icon, . ) . portable, powerful, free . prompt appears (>>>) . mixable (glue together with C/C++, Fortran, . can enter commands (as on MATLAB prompt) . ) . easy to use (save time developing code) execute program ² . easy to learn . Either start interpreter and pass program name . (in-built complex numbers) as argument: python.exe myfirstprogram.py Today: . ² Or make python-program executable . easy to learn (Unix/Linux): . some interesting features of the language ./myfirstprogram.py . use as tool for small sysadmin/data . Note: python-programs tend to end with .py, processing/collecting tasks but this is not necessary.
    [Show full text]
  • Introduction to GNU Octave
    Introduction to GNU Octave Hubert Selhofer, revised by Marcel Oliver updated to current Octave version by Thomas L. Scofield 2008/08/16 line 1 1 0.8 0.6 0.4 0.2 0 -0.2 -0.4 8 6 4 2 -8 -6 0 -4 -2 -2 0 -4 2 4 -6 6 8 -8 Contents 1 Basics 2 1.1 What is Octave? ........................... 2 1.2 Help! . 2 1.3 Input conventions . 3 1.4 Variables and standard operations . 3 2 Vector and matrix operations 4 2.1 Vectors . 4 2.2 Matrices . 4 1 2.3 Basic matrix arithmetic . 5 2.4 Element-wise operations . 5 2.5 Indexing and slicing . 6 2.6 Solving linear systems of equations . 7 2.7 Inverses, decompositions, eigenvalues . 7 2.8 Testing for zero elements . 8 3 Control structures 8 3.1 Functions . 8 3.2 Global variables . 9 3.3 Loops . 9 3.4 Branching . 9 3.5 Functions of functions . 10 3.6 Efficiency considerations . 10 3.7 Input and output . 11 4 Graphics 11 4.1 2D graphics . 11 4.2 3D graphics: . 12 4.3 Commands for 2D and 3D graphics . 13 5 Exercises 13 5.1 Linear algebra . 13 5.2 Timing . 14 5.3 Stability functions of BDF-integrators . 14 5.4 3D plot . 15 5.5 Hilbert matrix . 15 5.6 Least square fit of a straight line . 16 5.7 Trapezoidal rule . 16 1 Basics 1.1 What is Octave? Octave is an interactive programming language specifically suited for vectoriz- able numerical calculations.
    [Show full text]
  • Gretl User's Guide
    Gretl User’s Guide Gnu Regression, Econometrics and Time-series Allin Cottrell Department of Economics Wake Forest university Riccardo “Jack” Lucchetti Dipartimento di Economia Università Politecnica delle Marche December, 2008 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 program 4 2 Getting started 5 2.1 Let’s run a regression ........................................ 5 2.2 Estimation output .......................................... 7 2.3 The main window menus ...................................... 8 2.4 Keyboard shortcuts ......................................... 11 2.5 The gretl toolbar ........................................... 11 3 Modes of working 13 3.1 Command scripts ........................................... 13 3.2 Saving script objects ......................................... 15 3.3 The gretl console ........................................... 15 3.4 The Session concept ......................................... 16 4 Data files 19 4.1 Native format ............................................. 19 4.2 Other data file formats ....................................... 19 4.3 Binary databases ..........................................
    [Show full text]
  • Automated Likelihood Based Inference for Stochastic Volatility Models H
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Institutional Knowledge at Singapore Management University Singapore Management University Institutional Knowledge at Singapore Management University Research Collection School Of Economics School of Economics 11-2009 Automated Likelihood Based Inference for Stochastic Volatility Models H. Skaug Jun YU Singapore Management University, [email protected] Follow this and additional works at: https://ink.library.smu.edu.sg/soe_research Part of the Econometrics Commons Citation Skaug, H. and YU, Jun. Automated Likelihood Based Inference for Stochastic Volatility Models. (2009). 1-28. Research Collection School Of Economics. Available at: https://ink.library.smu.edu.sg/soe_research/1151 This Working Paper is brought to you for free and open access by the School of Economics at Institutional Knowledge at Singapore Management University. It has been accepted for inclusion in Research Collection School Of Economics by an authorized administrator of Institutional Knowledge at Singapore Management University. For more information, please email [email protected]. Automated Likelihood Based Inference for Stochastic Volatility Models Hans J. SKAUG , Jun YU November 2009 Paper No. 15-2009 ANY OPINIONS EXPRESSED ARE THOSE OF THE AUTHOR(S) AND NOT NECESSARILY THOSE OF THE SCHOOL OF ECONOMICS, SMU Automated Likelihood Based Inference for Stochastic Volatility Models¤ Hans J. Skaug,y Jun Yuz October 7, 2008 Abstract: In this paper the Laplace approximation is used to perform classical and Bayesian analyses of univariate and multivariate stochastic volatility (SV) models. We show that imple- mentation of the Laplace approximation is greatly simpli¯ed by the use of a numerical technique known as automatic di®erentiation (AD).
    [Show full text]
  • A Quick Guide to Gnuplot
    A Quick Guide to Gnuplot Andrea Mignone Physics Department, University of Torino AA 2020-2021 What is Gnuplot ? • Gnuplot is a free, command-driven, interactive, function and data plotting program, providing a relatively simple environment to make simple 2D plots (e.g. f(x) or f(x,y)); • It is available for all platforms, including Linux, Mac and Windows (http://www.gnuplot.info) • To start gnuplot from the terminal, simply type > gnuplot • To produce a simple plot, e.g. f(x) = sin(x) and f(x) = cos(x)^2 gnuplot> plot sin(x) gnuplot> replot (cos(x))**2 # Add another plot • By default, gnuplot assumes that the independent, or "dummy", variable for the plot command is "x” (or “t” in parametric mode). Mathematical Functions • In general, any mathematical expression accepted by C, FORTRAN, Pascal, or BASIC may be plotted. The precedence of operators is determined by the specifications of the C programming language. • Gnuplot supports the same operators of the C programming language, except that most operators accept integer, real, and complex arguments. • Exponentiation is done through the ** operator (as in FORTRAN) Using set/unset • The set/unset commands can be used to controls many features, including axis range and type, title, fonts, etc… • Here are some examples: Command Description set xrange[0:2*pi] Limit the x-axis range from 0 to 2*pi, set ylabel “f(x)” Sets the label on the y-axis (same as “set xlabel”) set title “My Plot” Sets the plot title set log y Set logarithmic scale on the y-axis (same as “set log x”) unset log y Disable log scale on the y-axis set key bottom left Position the legend in the bottom left part of the plot set xlabel font ",18" Change font size for the x-axis label (same as “set ylabel”) set tic font ",18" Change the major (labelled) tics font size on all axes.
    [Show full text]
  • Python Data Plotting and Visualisation Extravaganza 1 Introduction
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by The Python Papers Anthology The Python Papers Monograph, Vol. 1 (2009) 1 Available online at http://ojs.pythonpapers.org/index.php/tppm Python Data Plotting and Visualisation Extravaganza Guy K. Kloss Computer Science Institute of Information & Mathematical Sciences Massey University at Albany, Auckland, New Zealand [email protected] This paper tries to dive into certain aspects of graphical visualisation of data. Specically it focuses on the plotting of (multi-dimensional) data us- ing 2D and 3D tools, which can update plots at run-time of an application producing or acquiring new or updated data during its run time. Other visual- isation tools for example for graph visualisation, post computation rendering and interactive visual data exploration are intentionally left out. Keywords: Linear regression; vector eld; ane transformation; NumPy. 1 Introduction Many applications produce data. Data by itself is often not too helpful. To generate knowledge out of data, a user usually has to digest the information contained within the data. Many people have the tendency to extract patterns from information much more easily when the data is visualised. So data that can be visualised in some way can be much more accessible for the purpose of understanding. This paper focuses on the aspect of data plotting for these purposes. Data stored in some more or less structured form can be analysed in multiple ways. One aspect of this is post-analysis, which can often be organised in an interactive exploration fashion. One may for example import the data into a spreadsheet or otherwise suitable software tool which allows to present the data in various ways.
    [Show full text]
  • Sage Tutorial (Pdf)
    Sage Tutorial Release 9.4 The Sage Development Team Aug 24, 2021 CONTENTS 1 Introduction 3 1.1 Installation................................................4 1.2 Ways to Use Sage.............................................4 1.3 Longterm Goals for Sage.........................................5 2 A Guided Tour 7 2.1 Assignment, Equality, and Arithmetic..................................7 2.2 Getting Help...............................................9 2.3 Functions, Indentation, and Counting.................................. 10 2.4 Basic Algebra and Calculus....................................... 14 2.5 Plotting.................................................. 20 2.6 Some Common Issues with Functions.................................. 23 2.7 Basic Rings................................................ 26 2.8 Linear Algebra.............................................. 28 2.9 Polynomials............................................... 32 2.10 Parents, Conversion and Coercion.................................... 36 2.11 Finite Groups, Abelian Groups...................................... 42 2.12 Number Theory............................................. 43 2.13 Some More Advanced Mathematics................................... 46 3 The Interactive Shell 55 3.1 Your Sage Session............................................ 55 3.2 Logging Input and Output........................................ 57 3.3 Paste Ignores Prompts.......................................... 58 3.4 Timing Commands............................................ 58 3.5 Other IPython
    [Show full text]
  • Julia: a Fresh Approach to Numerical Computing∗
    SIAM REVIEW c 2017 Society for Industrial and Applied Mathematics Vol. 59, No. 1, pp. 65–98 Julia: A Fresh Approach to Numerical Computing∗ Jeff Bezansony Alan Edelmanz Stefan Karpinskix Viral B. Shahy Abstract. Bridging cultures that have often been distant, Julia combines expertise from the diverse fields of computer science and computational science to create a new approach to numerical computing. Julia is designed to be easy and fast and questions notions generally held to be \laws of nature" by practitioners of numerical computing: 1. High-level dynamic programs have to be slow. 2. One must prototype in one language and then rewrite in another language for speed or deployment. 3. There are parts of a system appropriate for the programmer, and other parts that are best left untouched as they have been built by the experts. We introduce the Julia programming language and its design|a dance between special- ization and abstraction. Specialization allows for custom treatment. Multiple dispatch, a technique from computer science, picks the right algorithm for the right circumstance. Abstraction, which is what good computation is really about, recognizes what remains the same after differences are stripped away. Abstractions in mathematics are captured as code through another technique from computer science, generic programming. Julia shows that one can achieve machine performance without sacrificing human con- venience. Key words. Julia, numerical, scientific computing, parallel AMS subject classifications. 68N15, 65Y05, 97P40 DOI. 10.1137/141000671 Contents 1 Scientific Computing Languages: The Julia Innovation 66 1.1 Julia Architecture and Language Design Philosophy . 67 ∗Received by the editors December 18, 2014; accepted for publication (in revised form) December 16, 2015; published electronically February 7, 2017.
    [Show full text]
  • Gnuplot Documentation and Sources
    gnuplot 5.0 An Interactive Plotting Program Thomas Williams & Colin Kelley Version 5.0 organized by: Ethan A Merritt and many others Major contributors (alphabetic order): Christoph Bersch, Hans-Bernhard Br¨oker, John Campbell, Robert Cunningham, David Denholm, Gershon Elber, Roger Fearick, Carsten Grammes, Lucas Hart, Lars Hecking, P´eterJuh´asz, Thomas Koenig, David Kotz, Ed Kubaitis, Russell Lang, Timoth´eeLecomte, Alexander Lehmann, J´er^omeLodewyck, Alexander Mai, Bastian M¨arkisch, Ethan A Merritt, Petr Mikul´ık, Carsten Steger, Shigeharu Takeno, Tom Tkacik, Jos Van der Woude, James R. Van Zandt, Alex Woo, Johannes Zellner Copyright c 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley Copyright c 2004 - 2017 various authors Mailing list for comments: [email protected] Mailing list for bug reports: [email protected] Web access (preferred): http://sourceforge.net/projects/gnuplot This manual was originally prepared by Dick Crawford. Version 5.0.7 (August 2017) 2 gnuplot 5.0 CONTENTS Contents I Gnuplot 17 Copyright 17 Introduction 17 Seeking-assistance 18 New features in version 5 19 New commands............................................... 20 Changes in version 5 20 Deprecated syntax 21 Demos and Online Examples 21 Batch/Interactive Operation 21 Canvas size 22 Command-line-editing 22 Comments 23 Coordinates 23 Datastrings 24 Enhanced text mode 24 Environment 25 Expressions 26 Functions.................................................. 27 Elliptic integrals..........................................
    [Show full text]
  • Programming for Computations – Python
    15 Svein Linge · Hans Petter Langtangen Programming for Computations – Python Editorial Board T. J.Barth M.Griebel D.E.Keyes R.M.Nieminen D.Roose T.Schlick Texts in Computational 15 Science and Engineering Editors Timothy J. Barth Michael Griebel David E. Keyes Risto M. Nieminen Dirk Roose Tamar Schlick More information about this series at http://www.springer.com/series/5151 Svein Linge Hans Petter Langtangen Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python Svein Linge Hans Petter Langtangen Department of Process, Energy and Simula Research Laboratory Environmental Technology Lysaker, Norway University College of Southeast Norway Porsgrunn, Norway On leave from: Department of Informatics University of Oslo Oslo, Norway ISSN 1611-0994 Texts in Computational Science and Engineering ISBN 978-3-319-32427-2 ISBN 978-3-319-32428-9 (eBook) DOI 10.1007/978-3-319-32428-9 Springer Heidelberg Dordrecht London New York Library of Congress Control Number: 2016945368 Mathematic Subject Classification (2010): 26-01, 34A05, 34A30, 34A34, 39-01, 40-01, 65D15, 65D25, 65D30, 68-01, 68N01, 68N19, 68N30, 70-01, 92D25, 97-04, 97U50 © The Editor(s) (if applicable) and the Author(s) 2016 This book is published open access. Open Access This book is distributed under the terms of the Creative Commons Attribution-Non- Commercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, duplication, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, a link is provided to the Creative Commons license and any changes made are indicated.
    [Show full text]
  • Snap.Py SNAP for Python
    An Introduction to Snap.py SNAP for Python Author: Rok Sosic Created: Sep 26, 2013 Content Introduction to Snap.py Tutorial Plotting Q&A What is SNAP? Stanford Network Analysis Project (SNAP) General purpose, high performance system for analysis and manipulation of large networks Scales to massive networks with hundreds of millions of nodes, and billions of edges Manipulates large networks, calculates structural properties, generates graphs, and supports attributes on nodes and edges Software is C++ based Web site at http://snap.stanford.edu What is Snap.py? Snap.py: SNAP for Python Provides SNAP functionality in Python C++ Good - fast program execution Downside - complex language, needs compilation Python Downside – slow program execution Good – simple language, interactive use Snap.py Good – fast program execution Good – simple language, interactive use Web site at http://snap.stanford.edu/snap/snap.py.html Snap.py Documentation Check out Snap.py at: http://snap.stanford.edu/snap/snap.py.html Packages for Mac OS X, Windows, Linux Quick Introduction and Tutorial SNAP documentation (snap.stanford.edu) User Reference Manual Top level graph classes TUNGraph, TNGraph, TNEANet Namespace TSnap Developer resources Developer Reference Manual GitHub repository SNAP C++ Programming Guide Snap.py Installation Download the Snap.py package for your platform: http://snap.stanford.edu/snap/snap.py.html Packages for Mac OS X, Windows, Linux (CentOS) 64-bit only – OS, Python Mac OS X, 10.7.5 or later Windows, install
    [Show full text]
  • Learning Econometrics with GAUSS
    Learning Econometrics with GAUSS by Ching-Fan Chung Institute of Economics, Academia Sinica ♠ · ♥ · ♦ · ♣ ii Contents 1 Introduction 1 1.1 Getting Started with GAUSS . 2 1.1.1 Executing DOS Commands in GAUSS . 3 1.1.2 Some GAUSS Keystrokes . 3 1.1.3 A Note on Computer Memory . 4 1.2 The GAUSS Editor . 4 1.3 GAUSS Statements . 5 1.3.1 Some Syntax Rules . 6 1.3.2 Two Types of Errors . 6 2 Data Input and Output 9 2.1 ASCII Files . 9 2.1.1 ASCII Data Files . 10 2.1.2 ASCII Output Files . 11 2.1.3 Other Commands Related to ASCII Output Files . 12 2.1.4 An Example . 13 2.2 Matrix Files . 15 3 Basic Algebraic Operations 17 3.1 Arithmetic Operators . 17 3.2 Element-by-Element Operations . 17 3.3 Other Arithmetic Operators . 18 3.4 Priority of the Arithmetic Operators . 19 3.5 Matrix Concatenation and Indexing Matrices . 20 4 GAUSS Commands 23 4.1 Special Matrices . 23 4.2 Simple Statistical Commands . 23 4.3 Simple Mathematical Commands . 24 4.4 Matrix Manipulation . 24 4.5 Basic Control Commands . 25 4.6 Some Examples . 26 4.7 Character Matrices and Strings . 34 4.7.1 Character Matrices . 34 4.7.2 Strings . 35 4.7.3 The Data Type . 36 4.7.4 Three Useful GAUSS Commands . 36 5 GAUSS Program for Linear Regression 41 5.1 A Brief Review . 41 5.1.1 The Ordinary Least Squares Estimation . 41 5.1.2 Analysis of Variance .
    [Show full text]