Econometric Computing with HC and HAC Covariance Matrix Estimators

This introduction to the R package sandwich is a (slightly) modified version of Zeileis (2004), published in the Journal of Statistical Software. Data described by econometric models typically contains autocorrelation and/or heteroskedasticity of unknown form and for inference in such models it is essential to use covariance matrix estimators that can consistently estimate the covariance of the model parameters. Hence, suitable heteroskedasticity-consistent (HC) and heteroskedasticity and autocorrelation consistent (HAC) estimators have been receiving attention in the econometric literature over the last 20 years. To apply these estimators in practice, an implementation is needed that preferably translates the conceptual properties of the underlying theoretical frameworks into computational tools. In this paper, such an implementation in the package sandwich in the R system for statistical computing is described and it is shown how the suggested functions provide reusable components that build on readily existing functionality and how they can be integrated easily into new inferential procedures or applications. The toolbox contained in sandwich is extremely flexible and comprehensive, including specific functions for the most important HC and HAC estimators from the econometric literature. Several real-world data sets are used to illustrate how the functionality can be integrated into applications.

[1]  H. White,et al.  Nonlinear Regression with Dependent Observations , 1984 .

[2]  H. White Asymptotic theory for econometricians , 1985 .

[3]  H. White,et al.  Some heteroskedasticity-consistent covariance matrix estimators with improved finite sample properties☆ , 1985 .

[4]  D. Andrews Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation , 1991 .

[5]  Walter Krämer,et al.  The CUSUM test for OLS residuals , 1992 .

[6]  Donald W. K. Andrews,et al.  An Improved Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimator , 1992 .

[7]  D. Andrews Tests for Parameter Instability and Structural Change with Unknown Change Point , 1993 .

[8]  W. Newey,et al.  Automatic Lag Selection in Covariance Matrix Estimation , 1994 .

[9]  P. Perron,et al.  Computation and Analysis of Multiple Structural-Change Models , 1998 .

[10]  Francisco Cribari-Neto,et al.  R: Yet Another Econometric Programming Environment , 1999 .

[11]  Patrick J. Heagerty,et al.  Weighted empirical adaptive variance estimators for correlated data regression , 1999 .

[12]  J. S. Long,et al.  Using Heteroscedasticity Consistent Standard Errors in the Linear Regression Model , 2000 .

[13]  Achim Zeileis,et al.  Strucchange: An R package for testing for structural change in linear regression models , 2002 .

[14]  Rob J Hyndman,et al.  Using R to Teach Econometrics , 2002 .

[15]  Francisco Cribari-Neto,et al.  Econometric and Statistical Computing Using Ox , 2003 .

[16]  D. Andrews Tests for Parameter Instability and Structural Change with Unknown Change Point , 1993 .

[17]  Francisco Cribari-Neto,et al.  Asymptotic inference under heteroskedasticity of unknown form , 2004, Comput. Stat. Data Anal..

[18]  Yvonne Freeh,et al.  An R and S–PLUS Companion to Applied Regression , 2004 .

[19]  A. Zeileis Econometric Computing with HC and HAC Covariance Matrix Estimators , 2004 .

[20]  Achim Zeileis,et al.  Validating multiple structural change models : A case study , 2005 .

[21]  Achim Zeileis,et al.  Implementing a class of structural change tests: An econometric computing approach , 2006, Comput. Stat. Data Anal..