Aer
Aer
Aer
Christian Kleiber
Universitt Basel a
Achim Zeileis
Universitt Innsbruck a
Abstract Applied Econometrics with R (Kleiber and Zeileis 2008, Springer-Verlag, ISBN 9780-387-77316-2, pp. vii+222) is the rst book on applied econometrics using the R system for statistical computing and graphics (R Development Core Team 2010). It presents hands-on examples for a wide range of econometric models, from classical linear regression models for cross-section, time series or panel data and the common non-linear models of microeconometrics, such as logit, probit, tobit models as well as regression models for count data, to recent semiparametric extensions. In addition, it provides a chapter on programming, including simulations, optimization and an introduction to R tools enabling reproducible econometric research. The methods are presented by illustrating, among other things, the tting of wage equations, growth regressions, dynamic regressions and time series models as well as various models of microeconometrics. The book is accompanied by the R package AER (Kleiber and Zeileis 2010) which contains some new R functionality, some 100 data sets taken from a wide variety of sources, the full source code for all examples used in the book, as well as further worked examples, e.g., from popular textbooks. This vignette provides an overview of the package contents and contains a list of errata for the book.
1. Package overview
1.1. R code from the book
The full R code from the book is provided in the demos for the package AER. The source scripts can be found in the demo directory of the package and executed interactively by calling demo(), as in R> demo("Ch-Intro", package = "AER") One demo per chapter is provided:
Ch-Intro (Chapter 1: Introduction), Ch-Basics (Chapter 2: Basics), Ch-LinearRegression (Chapter 3: Linear Regression),
This list of demos is also shown by demo(package = "AER"). The same scripts are contained in the tests directory of the package so that they are automatically checked and compared with the desired output provided in .Rout.save les. To make the code fully reproducible and to avoid some lengthy computations in the daily checks, a few selected code chunks are commented out in the scripts. Also, for technical reasons, some graphics code chunks are repeated, once commented out and once without comments.
2. Errata
The following errors have been found in the book so far. Please report any further errors you nd to us.
p. 59, 4653: There are now very minor dierences in the plots pertaining to Example 2 (Determinants of wages) in Chapter 1.1 and Chapter 2.8 (Exploratory Data Analysis with R) due to a missing observation. Specically, the version of the CPS1985 data used for the book contained only 533 observations, the original observation 1 had been omitted inadvertently. p. 6365, 130, 143: The function linear.hypothesis() from the car package has been renamed to linearHypothesis() starting from car 2.0-0. The old interface is currently still supported but results in a warning. p. 8586: Due to a bug in the summary() method for plm objects, the degrees of freedom reported for the F statistics were interchanged and thus the p values were not correct. Therefore, the p values printed in the book at the end of summary(gr_fe) and summary(gr_re) are not correct, they should both be < 2.22e-16. Using plm 1.1-1 or higher, the code produces the correct output. p. 92: Exercise 6 cannot be solved using PSID1982 since that data set only contains a cross-section while Hausman-Taylor requires panel data. A panel version has been available in the plm package under the name Wages; we have now added PSID7682 to AER for completeness (and consistent naming conventions). Use PSID7682 for the exercise.
p. 149: The standard error (and hence the corresponding z test) of admin|manage in the output of coeftest(bank_polr) is wrong, it should be 1.4744. This was caused by an inconsistency between polr() and its vcov() method which has now been improved in the MASS package ( 7.3-6). p. 169: The comment regarding the output from the Johansen test is in error. The null hypothesis of no cointegration is not rejected at the 10% level. Nonetheless, the table corresponding to Case 2 in Juselius (2006, p. 420) reveals that the trace statistic is signicant at the 15% level, thus the Johansen test weakly conrms the initial two-step approach. p. 179: For consistency, the GARCH code should be preceded by data("MarkPound"). p. 192: The likelihood for the generalized production function was in error (code and computations were correct though).
L=
i=1
1 i
1 + Yi Yi
=
i=1
log (i /).
Henningsen A (2008). Demand Analysis with the Almost Ideal Demand System in R: Package micEcon, Unpublished. URL http://CRAN.R-project. org/package=micEcon. Note: Currently, all links on manual pages corresponding to data sets taken from the Journal of Business & Economic Statistics (JBES) archive are broken (data sets MarkPound, and RecreationDemand). The reason is the redesign of the American Statistical Association (ASA) website, rendering the old ASA data archive nonfunctional. The ASA journals manager currently appears to supply data on a case-by-case basis. The problem awaits a more permanent solution.
References
Baltagi BH (2002). Econometrics. 3rd edition. Springer-Verlag, New York. URL http:// www.springeronline.com/sgw/cda/frontpage/0,10735,4-165-2-107420-0,00.html.
Cameron AC, Trivedi PK (1998). Regression Analysis of Count Data. Cambridge University Press, Cambridge. Davidson R, MacKinnon JG (2004). Econometric Theory and Methods. Oxford University Press, Oxford. Franses PH (1998). Time Series Models for Business and Economic Forecasting. Cambridge University Press, Cambridge. URL http://www.few.eur.nl/few/people/franses/ research/book2.htm. Greene WH (2003). Econometric Analysis. 5th edition. Prentice Hall, Upper Saddle River, NJ. URL http://pages.stern.nyu.edu/~wgreene/Text/econometricanalysis.htm. Juselius K (2006). The Cointegrated VAR Model. Oxford University Press, Oxford. Kleiber C, Zeileis A (2008). Applied Econometrics with R. Springer-Verlag, New York. ISBN 978-0-387-77316-2. Kleiber C, Zeileis A (2010). AER: Applied Econometrics with R. R package version 1.1-7, URL http://CRAN.R-project.org/package=AER. R Development Core Team (2010). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http: //www.R-project.org/. Stock JH, Watson MW (2007). Introduction to Econometrics. 2nd edition. Addison-Wesley, Reading, MA. Verbeek M (2004). A Guide to Modern Econometrics. 2nd edition. John Wiley & Sons, Hoboken, NJ. Winkelmann R, Boes S (2009). Analysis of Microdata. 2nd edition. Springer-Verlag, Berlin and Heidelberg.
Aliation:
Christian Kleiber Wirtschaftswissenschaftliches Zentrum (WWZ) Universitt Basel a Peter Merian-Weg 6 4002 Basel, Switzerland E-mail: [email protected] URL: http://wwz.unibas.ch/kleiber/ Achim Zeileis Department of Statistics Universitt Innsbruck a Universittsstr. 15 a 6020 Innsbruck, Austria