IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v011i10.html
   My bibliography  Save this article

Econometric Computing with HC and HAC Covariance Matrix Estimators

Author

Listed:
  • Zeileis, Achim

Abstract

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.

Suggested Citation

  • Zeileis, Achim, 2004. "Econometric Computing with HC and HAC Covariance Matrix Estimators," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 11(i10).
  • Handle: RePEc:jss:jstsof:v:011:i10
    DOI: http://hdl.handle.net/10.18637/jss.v011.i10
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v011i10/v11i10.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v011i10/v11i10.R.zip
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v011i10/sandwich_1.0-0.tar.gz
    Download Restriction: no

    File URL: https://libkey.io/http://hdl.handle.net/10.18637/jss.v011.i10?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Christian Kleiber & Achim Zeileis, 2005. "Validating multiple structural change models-a case study," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 20(5), pages 685-690.
    2. Zeileis, Achim & Leisch, Friedrich & Hornik, Kurt & Kleiber, Christian, 2002. "strucchange: An R Package for Testing for Structural Change in Linear Regression Models," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 7(i02).
    3. Cribari-Neto, Francisco, 2004. "Asymptotic inference under heteroskedasticity of unknown form," Computational Statistics & Data Analysis, Elsevier, vol. 45(2), pages 215-233, March.
    4. Whitney K. Newey & Kenneth D. West, 1994. "Automatic Lag Selection in Covariance Matrix Estimation," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 61(4), pages 631-653.
    5. T. Lumley & P. Heagerty, 1999. "Weighted empirical adaptive variance estimators for correlated data regression," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 61(2), pages 459-477, April.
    6. Andrews, Donald W K, 1991. "Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation," Econometrica, Econometric Society, vol. 59(3), pages 817-858, May.
    7. Andrews, Donald W K, 1993. "Tests for Parameter Instability and Structural Change with Unknown Change Point," Econometrica, Econometric Society, vol. 61(4), pages 821-856, July.
    8. White, Halbert & Domowitz, Ian, 1984. "Nonlinear Regression with Dependent Observations," Econometrica, Econometric Society, vol. 52(1), pages 143-161, January.
    9. Andrews, Donald W K & Monahan, J Christopher, 1992. "An Improved Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimator," Econometrica, Econometric Society, vol. 60(4), pages 953-966, July.
    10. Ploberger, Werner & Kramer, Walter, 1992. "The CUSUM Test with OLS Residuals," Econometrica, Econometric Society, vol. 60(2), pages 271-285, March.
    11. MacKinnon, James G. & White, Halbert, 1985. "Some heteroskedasticity-consistent covariance matrix estimators with improved finite sample properties," Journal of Econometrics, Elsevier, vol. 29(3), pages 305-325, September.
    12. Francisco Cribari-Neto & Spyros Zarkos, 2003. "Econometric and Statistical Computing Using Ox," Computational Economics, Springer;Society for Computational Economics, vol. 21(3), pages 277-295, June.
    13. Cribari-Neto, Francisco & Zarkos, Spyros G, 1999. "R: Yet Another Econometric Programming Environment," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 14(3), pages 319-329, May-June.
    14. Jushan Bai & Pierre Perron, 2003. "Computation and analysis of multiple structural change models," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 18(1), pages 1-22.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. repec:jss:jstsof:11:i10 is not listed on IDEAS
    2. Zeileis, Achim, 2006. "Implementing a class of structural change tests: An econometric computing approach," Computational Statistics & Data Analysis, Elsevier, vol. 50(11), pages 2987-3008, July.
    3. James G. MacKinnon, 2012. "Thirty Years Of Heteroskedasticity-robust Inference," Working Paper 1268, Economics Department, Queen's University.
    4. Hirukawa, Masayuki, 2023. "Robust Covariance Matrix Estimation in Time Series: A Review," Econometrics and Statistics, Elsevier, vol. 27(C), pages 36-61.
    5. Ding, Peng, 2021. "The Frisch–Waugh–Lovell theorem for standard errors," Statistics & Probability Letters, Elsevier, vol. 168(C).
    6. Hartigan, Luke, 2018. "Alternative HAC covariance matrix estimators with improved finite sample properties," Computational Statistics & Data Analysis, Elsevier, vol. 119(C), pages 55-73.
    7. repec:jss:jstsof:16:i09 is not listed on IDEAS
    8. Zeileis, Achim, 2006. "Object-oriented Computation of Sandwich Estimators," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 16(i09).
    9. Peng Ding, 2020. "The Frisch--Waugh--Lovell Theorem for Standard Errors," Papers 2009.06621, arXiv.org.
    10. Pierre Perron & Yohei Yamamoto, 2022. "Structural change tests under heteroskedasticity: Joint estimation versus two‐steps methods," Journal of Time Series Analysis, Wiley Blackwell, vol. 43(3), pages 389-411, May.
    11. , & Stein, Tobias, 2021. "Equity premium predictability over the business cycle," CEPR Discussion Papers 16357, C.E.P.R. Discussion Papers.
    12. Hui Hong & Zhicun Bian & Chien-Chiang Lee, 2021. "COVID-19 and instability of stock market performance: evidence from the U.S," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 7(1), pages 1-18, December.
    13. Casini, Alessandro & Perron, Pierre, 2021. "Continuous record Laplace-based inference about the break date in structural change models," Journal of Econometrics, Elsevier, vol. 224(1), pages 3-21.
    14. Alaa Abi Morshed & Elena Andreou & Otilia Boldea, 2018. "Structural Break Tests Robust to Regression Misspecification," Econometrics, MDPI, vol. 6(2), pages 1-39, May.
    15. Bajo-Rubio, Oscar & Diaz-Roldan, Carmen & Esteve, Vicente, 2007. "Change of regime and Phillips curve stability: The case of Spain, 1964-2002," Journal of Policy Modeling, Elsevier, vol. 29(3), pages 453-462.
    16. Kostyrka, Andreï & Malakhov, Dmitry, 2021. "Was there ever a shift: Empirical analysis of structural-shift tests for return volatility," Applied Econometrics, Russian Presidential Academy of National Economy and Public Administration (RANEPA), vol. 61, pages 110-139.
    17. Kholodilin Konstantin Arkadievich & Siliverstovs Boriss, 2006. "On the Forecasting Properties of the Alternative Leading Indicators for the German GDP: Recent Evidence," Journal of Economics and Statistics (Jahrbuecher fuer Nationaloekonomie und Statistik), De Gruyter, vol. 226(3), pages 234-259, June.
    18. Fabio Clementi & Marco Gallegati & Mauro Gallegati, 2015. "Growth and Cycles of the Italian Economy Since 1861: The New Evidence," Italian Economic Journal: A Continuation of Rivista Italiana degli Economisti and Giornale degli Economisti, Springer;Società Italiana degli Economisti (Italian Economic Association), vol. 1(1), pages 25-59, March.
    19. Daniel Wilhelm, 2014. "Optimal bandwidth selection for robust generalized method of moments estimation," CeMMAP working papers 15/14, Institute for Fiscal Studies.
    20. Mardi Dungey & Vitali Alexeev & Jing Tian & Alastair R. Hall, 2015. "Econometricians Have Their Moments: GMM at 32," The Economic Record, The Economic Society of Australia, vol. 91, pages 1-24, June.
    21. Prodan, Ruxandra, 2008. "Potential Pitfalls in Determining Multiple Structural Changes With an Application to Purchasing Power Parity," Journal of Business & Economic Statistics, American Statistical Association, vol. 26, pages 50-65, January.
    22. Alastair R. Hall, 2015. "Econometricians Have Their Moments: GMM at 32," The Economic Record, The Economic Society of Australia, vol. 91(S1), pages 1-24, June.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jss:jstsof:v:011:i10. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F. Baum (email available below). General contact details of provider: http://www.jstatsoft.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.