Tutorials › Regression Analysis (Undergraduate) › HC0 and HC1 Standard Errors

Unequal Variance and Robust Uncertainty · Tutorial 529 of 991

HC0 and HC1 Standard Errors

Learn how HC1 rescales the HC0 covariance estimate, how that changes standard errors, and what the adjustment does—and does not—correct.

Advanced 9 min read

What You'll Learn

  • Define HC0 and HC1 covariance estimates for an ordinary least-squares regression.
  • Convert a degrees-of-freedom adjustment to its effect on standard errors.
  • Calculate HC0 and HC1 standard errors from a small hypothetical regression.
  • Count the fitted parameters used in the HC1 adjustment.
  • Explain why HC1 is a finite-sample scaling adjustment, not a complete small-sample correction.

Why Compare HC0 and HC1?

When regression errors have unequal variances, the usual least-squares standard-error formula can be unreliable. Heteroskedasticity-robust covariance estimates address this by using the observed residuals to estimate uncertainty without assuming that every observation has the same error variance. HC0 is the basic version of this estimate. HC1 multiplies HC0 by a degrees-of-freedom factor.

The adjustment is simple, but it is important to apply it at the right stage: HC1 multiplies the covariance estimate, while the reported standard errors are square roots of its diagonal entries. Thus the standard errors are multiplied by the square root of the HC1 factor, not by the factor itself.

Model and Definitions

Suppose there are \(n\) observations and \(k\) fitted regression coefficients, including the intercept if the model has one. Write the linear regression model as \(y_i=x_i^\top\beta+u_i\), where \(y_i\) is the response, \(x_i\) is the vector of \(k\) predictors (including a column for the intercept when appropriate), \(\beta\) is the coefficient vector, and \(u_i\) is the error. Let \(\hat{\beta}\) be the ordinary least-squares estimate and \(e_i=y_i-x_i^\top\hat{\beta}\) be the residual for observation \(i\). Let \(X\) be the \(n\)-by-\(k\) design matrix, whose rows are \(x_i^\top\).

The standard heteroskedasticity-robust covariance calculation assumes a correctly specified conditional mean, \(E(u_i\mid X)=0\), a full-rank design matrix, independent observations, and suitable finite moments. The error variances may differ across observations. The resulting covariance estimates are used as large-sample estimates; neither HC0 nor HC1 guarantees exact small-sample inference.

Definition: The HC0 covariance estimate is $$ \widehat{\mathrm{Var}}_{\mathrm{HC0}}(\hat{\beta}) =(X^\top X)^{-1} \left(\sum_{i=1}^{n}x_i x_i^\top e_i^2\right) (X^\top X)^{-1}. $$ The HC1 covariance estimate is $$ \widehat{\mathrm{Var}}_{\mathrm{HC1}}(\hat{\beta}) =\frac{n}{n-k}\widehat{\mathrm{Var}}_{\mathrm{HC0}}(\hat{\beta}), $$ where \(n-k\) is the residual degrees of freedom. For either estimate, the robust standard error of coefficient \(j\) is the square root of the \(j\)th diagonal entry of the estimated covariance matrix.

The formula requires \(n>k\), so that the residual degrees of freedom are positive. The factor \(n/(n-k)\) is greater than 1, and therefore HC1 standard errors are at least as large as the corresponding HC0 standard errors. This does not mean that every individual HC1 variance estimate is a better estimate in every sample; it describes the effect of the specified rescaling.

How the Adjustment Changes a Standard Error

Multiplying a covariance matrix by a positive number multiplies each diagonal variance by that number. Taking square roots then gives the standard-error relationship:

$$ SE_{\mathrm{HC1}}(\hat{\beta}_j) =\sqrt{\frac{n}{n-k}}\, SE_{\mathrm{HC0}}(\hat{\beta}_j). $$

The covariance matrix also contains covariances between coefficient estimates. HC1 multiplies those off-diagonal entries by \(n/(n-k)\) as well. The adjustment is one common multiplier for the whole matrix, not a separate correction for each coefficient.

Worked Example: Rescaling a Reported HC0 Matrix

Suppose a hypothetical regression has \(n=30\) observations and \(k=3\) fitted coefficients: an intercept and two slopes. Its HC0 covariance estimate, in the coefficient order shown, is

$$ \widehat{\mathrm{Var}}_{\mathrm{HC0}}(\hat{\beta}) = \begin{pmatrix} 0.2500 & -0.0200 & 0.0100\\ -0.0200 & 0.0400 & 0.0060\\ 0.0100 & 0.0060 & 0.0100 \end{pmatrix}. $$

There are \(n-k=30-3=27\) residual degrees of freedom, so the HC1 multiplier is

$$ \frac{n}{n-k}=\frac{30}{27}=1.1111. $$

The HC0 standard errors are the square roots of the diagonal entries: \(\sqrt{0.2500}=0.5000\), \(\sqrt{0.0400}=0.2000\), and \(\sqrt{0.0100}=0.1000\). For HC1, multiply each by \(\sqrt{30/27}=1.0541\). The resulting HC1 standard errors are \(0.5270\), \(0.2108\), and \(0.1054\), respectively. For example, the first HC1 variance is \(1.1111(0.2500)=0.2778\), whose square root is approximately \(0.5270\). The same factor applies to every matrix entry, including the covariances.

A Small Regression Calculated from Data

The next example calculates both versions from hypothetical observations. It uses a simple regression with an intercept and one slope, so \(k=2\). The observations are chosen to make the least-squares fit and the robust calculation transparent.

Worked Example: HC0 and HC1 for Five Observations

Suppose a hypothetical model predicts a response \(y\) from \(x\), with an intercept. The data are:

\(x_i\)\(y_i\)Residual \(e_i\)
0111
111-2
2160
3212
421-1

The fitted line is \(\hat{y}=10+3x\). The residuals in the table are observed \(y_i\) minus fitted \(\hat{y}_i\). They sum to zero, and their products with the centered predictor values also sum to zero:

$$ 1-2+0+2-1=0,\qquad (-2)(1)+(-1)(-2)+(0)(0)+(1)(2)+(2)(-1)=0. $$

These are the least-squares residual conditions for an intercept and slope. The predictor mean is \(\bar{x}=2\), and \(S_{xx}=\sum_i(x_i-\bar{x})^2=4+1+0+1+4=10\). For the slope, the coefficient multiplying residual \(e_i\) in the least-squares slope estimate is \((x_i-\bar{x})/S_{xx}\). Consequently, the HC0 slope variance is

$$ \widehat{\mathrm{Var}}_{\mathrm{HC0}}(\hat{\beta}_1) =\sum_{i=1}^{5}\left(\frac{x_i-\bar{x}}{S_{xx}}\right)^2e_i^2 =\frac{4(1)+1(4)+0(0)+1(4)+4(1)}{10^2} =\frac{16}{100}=0.1600. $$

Thus the HC0 standard error of the slope is \(\sqrt{0.1600}=0.4000\), in response units per unit of \(x\). Here \(n=5\), \(k=2\), and \(n-k=3\), so

$$ \widehat{\mathrm{Var}}_{\mathrm{HC1}}(\hat{\beta}_1) =\frac{5}{3}(0.1600)=0.2667,\qquad SE_{\mathrm{HC1}}(\hat{\beta}_1) =\sqrt{0.2667}=0.5164. $$

The HC1 slope standard error is larger because the variance was multiplied by \(5/3\), and the standard error by \(\sqrt{5/3}\). This calculation gives uncertainty estimates for the slope; it does not by itself determine whether a slope is statistically significant.

Why HC1 Is a Degrees-of-Freedom Adjustment

The multiplier has a familiar motivation. In a homoskedastic regression, the conventional estimate of the common error variance uses the residual sum of squares divided by \(n-k\), rather than divided by \(n\). HC0, by contrast, uses the observed squared residuals in its “meat” term without an overall degrees-of-freedom multiplier. HC1 scales the entire HC0 covariance estimate by \(n/(n-k)\), borrowing the same kind of degrees-of-freedom scaling.

This motivation explains why HC1 is often described as a finite-sample adjustment to HC0. It is not a proof that HC1 is unbiased under heteroskedasticity. Residuals depend on the fitted regression, so their squared values do not simply equal the corresponding error variances observation by observation. Multiplying every contribution by the same number cannot account for every feature of that dependence.

Justification: If \(k\) stays fixed while the sample size \(n\) grows, then $$ \frac{n}{n-k}=\frac{1}{1-k/n}\longrightarrow 1 \quad\text{as }n\longrightarrow\infty. $$ Therefore HC1 and HC0 become close as a proportion of their scale in large samples with a fixed number of fitted coefficients. For a finite sample, HC1 is larger by the factor \(n/(n-k)\) for variances and by \(\sqrt{n/(n-k)}\) for standard errors.

Worked Example: Counting Parameters and Interpreting the Size of the Adjustment

Suppose a hypothetical regression has 20 observations, an intercept, and three slopes. The fitted-parameter count is \(k=4\), not 3, because the intercept is estimated too. The residual degrees of freedom are \(20-4=16\), and the HC1 multiplier is

$$ \frac{20}{16}=1.25. $$

If the HC0 standard error for a coefficient is \(0.1500\) outcome units per predictor unit, its HC1 standard error is

$$ 0.1500\sqrt{1.25} =0.1500(1.1180) =0.1677. $$

So HC1 increases this standard error by about \(0.0177\) in its stated units. It does not multiply the standard error by 1.25: that number multiplies the variance, while its square root multiplies the standard error.

What the Comparison Does—and Does Not—Tell You

For a given regression, comparing HC0 and HC1 isolates the effect of this global scaling choice. When \(k/n\) is small, the multiplier is close to 1, so the two standard-error sets will be similar. When \(k\) is a substantial fraction of \(n\), the multiplier can be larger. For example, \(n=100\) and \(k=4\) give \(100/96=1.0417\) for the covariance and \(\sqrt{100/96}=1.0206\) for standard errors.

HC1 does not change the fitted coefficients, residuals, or estimated mean relationship. It changes the estimated covariance of the coefficient estimates, and therefore the associated robust standard errors. It also does not fix a misspecified conditional mean, dependent observations, or other problems outside its assumptions. Robust uncertainty estimates address the variance calculation; they are not a remedy for every regression problem.

Other robust covariance estimators make different adjustments to how residual information contributes to the estimate. In particular, a single HC1 multiplier does not give an observation-specific correction for leverage. The choice among robust estimators should therefore be reported clearly rather than treated as a hidden software detail.

Common Mistakes

  • Multiplying a standard error by \(n/(n-k)\). That factor multiplies the covariance matrix and variances. Multiply a standard error by \(\sqrt{n/(n-k)}\).
  • Forgetting the intercept when counting \(k\). Count every estimated regression coefficient. With an intercept and three slopes, \(k=4\).
  • Calling HC1 an exact correction. HC1 is a degrees-of-freedom scaling of HC0, not a guarantee of unbiased covariance estimates or exact small-sample inference.
  • Thinking HC1 changes the fitted line. HC1 changes estimated uncertainty, not the least-squares coefficient estimates.
Key takeaway: HC1 is HC0 multiplied by \(n/(n-k)\) at the covariance-matrix level. Its standard errors are HC0 standard errors multiplied by \(\sqrt{n/(n-k)}\). The adjustment is a useful finite-sample scaling convention, but it is not a complete correction for all finite-sample effects.

Check Your Understanding

Answer each question using the distinction between covariance estimates and standard errors.

  1. A regression has 40 observations and 5 fitted coefficients, including the intercept. What is the HC1 covariance multiplier?
  2. If an HC0 standard error is \(0.3000\), what calculation gives the corresponding HC1 standard error when \(n=40\) and \(k=5\)?
  3. Why does a model with an intercept and four slopes have \(k=5\), rather than \(k=4\)?
  4. Does applying HC1 change the least-squares coefficient estimates? Explain.
  5. Why is HC1 described as a finite-sample adjustment rather than an exact correction for heteroskedasticity?