Example: dental hygienist

Using gretl for Principles of Econometrics, 4th …

Using gretl for Principles of econometrics , 4th Edition Version Lee C. Adkins Professor of Economics Oklahoma State University April 7, 2014. 1. Visit 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 or any later version published by the Free Software Foundation (see Appendix F 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.

Using gretl for Principles of Econometrics, 4th Edition Version 1.0411 Lee C. Adkins Professor of Economics Oklahoma State University April 7, 2014

Tags:

  Using, Principles, Econometrics, Using gretl for principles of econometrics, Gretl

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Using gretl for Principles of Econometrics, 4th …

1 Using gretl for Principles of econometrics , 4th Edition Version Lee C. Adkins Professor of Economics Oklahoma State University April 7, 2014. 1. Visit 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 or any later version published by the Free Software Foundation (see Appendix F 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.

2 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 If you are unfamiliar with gretl and are interested in Using it in class, Mixon Jr.

3 And Smith (2006) and Adkins (2011a) 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.

4 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.

5 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.

6 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.

7 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.

8 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. What is gretl ? .. 1. Installing gretl .. 2. gretl Basics .. 3. Common Conventions .. 5. Importing Data .. 6. Using the gretl Language .. 8. Console .. 8. Scripts .. 10. Sessions .. 12. Generating New Variables .. 13. GNUPLOT .. 14. 2 Simple Linear Regression 19. Simple Linear Regression Model .. 19. Retrieve the Data .. 19. v Graph the Data .. 22. Estimate the Food Expenditure Relationship .. 23. Elasticity .. 25.

9 Prediction .. 26. Estimating Variance .. 26. Repeated Sampling .. 27. Estimating Nonlinear Relationships .. 31. Regression with an Indicator Variable .. 33. Monte Carlo Simulation .. 34. Script .. 37. 3 Interval Estimation and Hypothesis Testing 45. Confidence Intervals .. 45. Repeated Sampling .. 48. Monte Carlo Experiment .. 50. Hypothesis Tests .. 51. Script for t-values and p-values .. 55. Linear Combination of Parameters .. 57. Script .. 59. 4 Prediction, Goodness-of-Fit, and Modeling Issues 62. Prediction in the Food Expenditure Model .. 62. Coefficient of Determination .. 64. Choosing a Functional Form .. 67. vi Linear-Log Specification .. 68. Residual Plots .. 70. Testing for Normality .. 72. Reporting Results .. 75. Polynomial Models .. 77. Wheat Yield .. 77. Growth Model .. 79. Wage Equation .. 80. Generalized R2 .. 82. Predictions in the Log-linear Model.

10 82. Prediction Interval .. 83. Log-Log Model .. 85. Script .. 86. 5 Multiple Regression Model 90. Linear Regression .. 91. Big Andy's Burger Barn .. 92. Variances and Covariances of Least Squares .. 93. Confidence Intervals .. 94. t-Tests, Critical Values, and p-values .. 96. Polynomials .. 99. Marginal Effects .. 100. Optimal Advertising: Nonlinear Combinations of Parameters .. 101. Interactions .. 103. vii Basic Interactions of Continuous Variables .. 103. Log-Linear Model .. 105. Goodness-of-Fit .. 105. Script .. 108. 6 Further Inference in the Multiple Regression Model 110. F -test .. 110. Regression Significance .. 115. Relationship Between t- and F -tests .. 118. Optimal Level of Advertising .. 119. Nonsample Information .. 121. Model Specification .. 123. Model Selection: Introduction to gretl Functions .. 124. Adjusted R2 .. 126. Information Criteria.


Related search queries