Heteroscedasticity-consistent standard errors

From HandWiki

The topic of heteroskedasticity-consistent (HC) standard errors arises in statistics and econometrics in the context of linear regression and time series analysis. These are also known as heteroskedasticity-robust standard errors (or simply robust standard errors), Eicker–Huber–White standard errors (also Huber–White standard errors or White standard errors),[1] to recognize the contributions of Friedhelm Eicker,[2] Peter J. Huber,[3] and Halbert White.[4] In regression and time-series modelling, basic forms of models make use of the assumption that the errors or disturbances ui have the same variance across all observation points. When this is not the case, the errors are said to be heteroskedastic, or to have heteroskedasticity, and this behaviour will be reflected in the residuals [math]\displaystyle{ \widehat{u}_i }[/math] estimated from a fitted model. Heteroskedasticity-consistent standard errors are used to allow the fitting of a model that does contain heteroskedastic residuals. The first such approach was proposed by Huber (1967), and further improved procedures have been produced since for cross-sectional data, time-series data and GARCH estimation.

Heteroskedasticity-consistent standard errors that differ from classical standard errors may indicate model misspecification. Substituting heteroskedasticity-consistent standard errors does not resolve this misspecification, which may lead to bias in the coefficients. In most situations, the problem should be found and fixed.[5] Other types of standard error adjustments, such as clustered standard errors, may be considered as extensions to HC standard errors.


Heteroskedasticity-consistent standard errors are introduced by Friedhelm Eicker,[6][7] and popularized in econometrics by Halbert White.


Consider the linear regression model

[math]\displaystyle{ Y = X \beta + U, \, }[/math]

where X is the vector of explanatory variables and β is a k × 1 column vector of parameters to be estimated.

The ordinary least squares (OLS) estimator is

[math]\displaystyle{ \widehat \beta_\text{OLS} = (\mathbb{X}' \mathbb{X})^{-1} \mathbb{X}' \mathbb{Y}. \, }[/math]

where [math]\displaystyle{ \mathbb{X} }[/math] denotes the matrix of stacked [math]\displaystyle{ X_i' }[/math] values observed in the data.

If the sample errors have equal variance σ2 and are uncorrelated, then the least-squares estimate of β is BLUE (best linear unbiased estimator), and its variance is estimated with

[math]\displaystyle{ v_\text{OLS}\left[\widehat\beta_\text{OLS}\right] = s^2 (\mathbb{X}'\mathbb{X})^{-1}, \quad s^2 = \frac{\sum_i \widehat u_i^2}{n-k} }[/math]

where [math]\displaystyle{ \widehat u_i = Y_i - X_i \widehat \beta_\text{OLS} }[/math] are the regression residuals.

When the error terms do not have constant variance (i.e., the assumption of [math]\displaystyle{ \operatorname E[uu'] = \sigma^2 I_n }[/math] is untrue), the OLS estimator loses its desirable properties. The formula for variance now cannot be simplified:

[math]\displaystyle{ V\left[\widehat\beta_\text{OLS}\right] = V[ (\mathbb{X}'\mathbb{X})^{-1} \mathbb{X}'\mathbb{Y}] = (\mathbb{X}'\mathbb{X})^{-1} \mathbb{X}' \Sigma \mathbb{X} (\mathbb{X}'\mathbb{X})^{-1} }[/math]

where [math]\displaystyle{ \Sigma = V[u]. }[/math]

While the OLS point estimator remains unbiased, it is not "best" in the sense of having minimum mean square error, and the OLS variance estimator [math]\displaystyle{ v_\text{OLS} \left[ \widehat\beta_\text{OLS} \right] }[/math] does not provide a consistent estimate of the variance of the OLS estimates.

For any non-linear model (for instance logit and probit models), however, heteroskedasticity has more severe consequences: the maximum likelihood estimates of the parameters will be biased (in an unknown direction), as well as inconsistent (unless the likelihood function is modified to correctly take into account the precise form of heteroskedasticity).[8][9] As pointed out by Greene, “simply computing a robust covariance matrix for an otherwise inconsistent estimator does not give it redemption.”[10]


If the regression errors [math]\displaystyle{ u_i }[/math] are independent, but have distinct variances σi2, then [math]\displaystyle{ \Sigma = \operatorname{diag}(\sigma_1^2, \ldots, \sigma_n^2) }[/math] which can be estimated with [math]\displaystyle{ \widehat\sigma_i^2 = \widehat u_i^2 }[/math]. This provides White's (1980) estimator, often referred to as HCE (heteroskedasticity-consistent estimator):

[math]\displaystyle{ \begin{align} v_\text{HCE} \left[ \widehat\beta_\text{OLS} \right] &= \frac{1}{n} \left(\frac{1}{n} \sum_i X_i X_i' \right)^{-1} \left(\frac{1}{n} \sum_i X_i X_i' \widehat{u}_i^2 \right) \left(\frac{1}{n} \sum_i X_i X_i' \right)^{-1} \\ &= ( \mathbb{X}' \mathbb{X} )^{-1} ( \mathbb{X}' \operatorname{diag}(\widehat u_1^2, \ldots, \widehat u_n^2) \mathbb{X} ) ( \mathbb{X}' \mathbb{X})^{-1}, \end{align} }[/math]

where as above [math]\displaystyle{ \mathbb{X} }[/math] denotes the matrix of stacked [math]\displaystyle{ X_i' }[/math] values from the data. The estimator can be derived in terms of the generalized method of moments (GMM).

Also often discussed in the literature (including White's paper) is the covariance matrix [math]\displaystyle{ \widehat\Omega_n }[/math] of the [math]\displaystyle{ \sqrt{n} }[/math]-consistent limiting distribution:

[math]\displaystyle{ \sqrt{n}(\widehat\beta_n - \beta) \, \xrightarrow{d} \, N(0,\Omega), }[/math]


[math]\displaystyle{ \Omega = \operatorname E[X X']^{-1} \operatorname{Var}[X u]\operatorname E[X X']^{-1}, }[/math]


[math]\displaystyle{ \begin{align} \widehat\Omega_n &= \left(\frac{1}{n} \sum_i X_i X_i' \right)^{-1} \left(\frac{1}{n} \sum_i X_i X_i' \widehat u_i^2 \right) \left(\frac{1}{n} \sum_i X_i X_i' \right)^{-1} \\ &= n ( \mathbb{X}' \mathbb{X} )^{-1} ( \mathbb{X}' \operatorname{diag}(\widehat u_1^2, \ldots, \widehat u_n^2) \mathbb{X} ) ( \mathbb{X}' \mathbb{X})^{-1} \end{align} }[/math]


[math]\displaystyle{ \widehat\Omega_n = n \cdot v_\text{HCE}[\widehat\beta_\text{OLS}] }[/math]


[math]\displaystyle{ \widehat\operatorname{Var}[X u] = \frac{1}{n} \sum_i X_i X_i' \widehat u_i^2 = \frac{1}{n} \mathbb{X}' \operatorname{diag}(\widehat u_1^2, \ldots, \widehat u_n^2) \mathbb{X}. }[/math]

Precisely which covariance matrix is of concern is a matter of context.

Alternative estimators have been proposed in MacKinnon & White (1985) that correct for unequal variances of regression residuals due to different leverage.[11] Unlike the asymptotic White's estimator, their estimators are unbiased when the data are homoscedastic.

See also


  • EViews: EViews version 8 offers three different methods for robust least squares: M-estimation (Huber, 1973), S-estimation (Rousseeuw and Yohai, 1984), and MM-estimation (Yohai 1987).[12]
  • MATLAB: See the hac function in the Econometrics toolbox.[13]
  • Python: The Statsmodel package offers various robust standard error estimates, see statsmodels.regression.linear_model.RegressionResults for further descriptions
  • R: the vcovHC() command from the sandwich package.[14][15]
  • RATS: robusterrors option is available in many of the regression and optimization commands (linreg, nlls, etc.).
  • Stata: robust option applicable in many pseudo-likelihood based procedures.[16]
  • Gretl: the option --robust to several estimation commands (such as ols) in the context of a cross-sectional dataset produces robust standard errors.[17]


  1. Kleiber, C.; Zeileis, A. (2006). "Applied Econometrics with R". UseR-2006 conference. http://www.r-project.org/useR-2006/Slides/Kleiber+Zeileis.pdf. 
  2. Eicker, Friedhelm (1967). "Limit Theorems for Regression with Unequal and Dependent Errors". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability. 5. pp. 59–82. http://projecteuclid.org/euclid.bsmsp/1200512981. 
  3. Huber, Peter J. (1967). "The behavior of maximum likelihood estimates under nonstandard conditions". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability. 5. pp. 221–233. http://projecteuclid.org/euclid.bsmsp/1200512988. 
  4. White, Halbert (1980). "A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity". Econometrica 48 (4): 817–838. doi:10.2307/1912934. 
  5. King, Gary; Roberts, Margaret E. (2015). "How Robust Standard Errors Expose Methodological Problems They Do Not Fix, and What to Do About It" (in en). Political Analysis 23 (2): 159–179. doi:10.1093/pan/mpu015. ISSN 1047-1987. https://www.cambridge.org/core/product/identifier/S1047198700011670/type/journal_article. 
  6. Eicker, F. (1963). "Asymptotic Normality and Consistency of the Least Squares Estimators for Families of Linear Regressions". The Annals of Mathematical Statistics 34 (2): 447–456. doi:10.1214/aoms/1177704156. https://projecteuclid.org/euclid.aoms/1177704156. 
  7. Eicker, Friedhelm (January 1967). "Limit theorems for regressions with unequal and dependent errors". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics 5 (1): 59–83. https://projecteuclid.org/euclid.bsmsp/1200512981. 
  8. Giles, Dave (May 8, 2013). "Robust Standard Errors for Nonlinear Models". Econometrics Beat. http://davegiles.blogspot.com/2013/05/robust-standard-errors-for-nonlinear.html. 
  9. Guggisberg, Michael (2019). "Misspecified Discrete Choice Models and Huber-White Standard Errors". Journal of Econometric Methods 8 (1). doi:10.1515/jem-2016-0002. 
  10. Greene, William H. (2012). Econometric Analysis (Seventh ed.). Boston: Pearson Education. pp. 692–693. ISBN 978-0-273-75356-8. 
  11. MacKinnon, James G.; White, Halbert (1985). "Some Heteroskedastic-Consistent Covariance Matrix Estimators with Improved Finite Sample Properties". Journal of Econometrics 29 (3): 305–325. doi:10.1016/0304-4076(85)90158-7. 
  12. "EViews 8 Robust Regression". http://www.eviews.com/EViews8/ev8ecrobust_n.html. 
  13. "Heteroskedasticity and autocorrelation consistent covariance estimators". Econometrics Toolbox. https://www.mathworks.com/help/econ/hac.html. 
  14. sandwich: Robust Covariance Matrix Estimators
  15. Kleiber, Christian; Zeileis, Achim (2008). Applied Econometrics with R. New York: Springer. pp. 106–110. ISBN 978-0-387-77316-2. https://books.google.com/books?id=86rWI7WzFScC&pg=PA106. 
  16. See online help for _robust option and regress command.
  17. "Robust covariance matrix estimation". Gretl User's Guide, chapter 19. http://gretl.sourceforge.net/gretl-help/gretl-guide.pdf. 

Further reading