EconPapers    
Economics at your fingertips  
 

HARREG: Stata module to estimate time-series regression with HAR standard errors and fixed-b inference

Eben Lazarus and Daniel Lewis

Statistical Software Components from Boston College Department of Economics

Abstract: harreg fits a time-series regression by OLS and reports heteroskedasticity- and autocorrelation-robust (HAR) standard errors based on fixed-b asymptotics, as recommended by Lazarus, Lewis, Stock, and Watson (LLSW, 2018) and Lazarus, Lewis, and Stock (LLS, 2021). The default estimator is the equal-weighted cosine (EWC) with nu = floor(0.41*T^(2/3)), as recommended by LLSW (2018). Alternative long-run variance (LRV) estimators include equal-weighted periodogram (EWP), Newey-West/Bartlett (NW), and quadratic spectral (QS). The default rules for the truncation parameter (nw, qs) and degrees of freedom (ewc, ewp) are designed to optimize the tradeoff between test size (controlling the probability of false rejection) and size-adjusted power, following LLSW (2018). For ewc and ewp, inference uses t(nu) and F(m,nu-m+1) reference distributions, where m is the number of restrictions tested. For nw and qs, harreg simulates the fixed-b null distribution to obtain p-values and critical values.

Language: Stata
Requires: Stata version
Keywords: HAR; long-run variance (search for similar items in EconPapers)
Date: 2026-05-16
Note: This module should be installed from within Stata by typing "ssc install harreg". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/h/harreg.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/h/harreg_p.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/h/harwald.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/h/harreg.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/h/harwald.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/h/har_utils.mata program code (text/plain)
http://fmwww.bc.edu/repec/bocode/l/lharreg.mlib object code (application/x-stata)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459711

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2026-05-23
Handle: RePEc:boc:bocode:s459711