Lesson 4.10: Heteroskedasticity: Detection and Correction
This lesson provides a rigorous examination of heteroskedasticity, the violation of the classical assumption of constant error variance. We will derive the precise mathematical consequences of this violation for the OLS estimator's variance, detail the theoretical basis for its detection via the White test, and derive the heteroskedasticity-consistent covariance matrix estimator as the appropriate remedy.
Part 1: Formal Definition and Consequences
1.1 The Homoskedasticity Assumption in Matrix Form
One of the critical Gauss-Markov assumptions (Assumption 4) is that the variance-covariance matrix of the error vector , conditional on the design matrix , is a spherical error covariance matrix. This property is known as **Homoskedasticity**.
Assumption: Homoskedasticity
The error terms are homoskedastic if the conditional variance of each error term is a constant, , and the conditional covariance between any two distinct error terms is zero.
In matrix notation, this is expressed as:
where is the identity matrix.
1.2 The Violation: Heteroskedasticity
Heteroskedasticity (often called "hetero") means the homoskedasticity assumption is violated. While we maintain the assumption of no autocorrelation (), the variance of the error terms is no longer constant.
Condition: Heteroskedasticity
The error terms are heteroskedastic if the conditional variance of the error term is not constant, but instead depends on (and therefore on the values of ).
In this case, the variance-covariance matrix of the error vector is a non-scalar diagonal matrix, denoted :
1.3 Mathematical Consequences for the OLS Estimator
Derivation: The True Variance of β̂_OLS
Let us derive the variance of the OLS estimator, , without assuming homoskedasticity.
Step 1: Express the estimation error.
Step 2: Use the definition of the variance-covariance matrix.
Step 3: Substitute the estimation error.
Using the transpose rule , the second term becomes (since is symmetric).
Step 4: Apply the expectation operator. Since is treated as fixed, we can move the expectation inside to the only random component, .
Step 5: Insert the general error covariance matrix .
True Variance of OLS
This is the **true, general formula** for the variance of the OLS estimator.
The Failure Point: The standard OLS software formula is derived by incorrectly assuming homoskedasticity, i.e., by substituting into the true formula:
When heteroskedasticity is present (), the standard OLS variance formula is incorrect, biased, and inconsistent. Consequently, all standard errors, t-statistics, and F-statistics are invalid.
Part 2: Detection of Heteroskedasticity
The White (1980) test provides a general method for detecting heteroskedasticity. The intuition is to test whether the variance of the errors is systematically related to the regressors.
Theoretical Basis: Since we cannot observe the true errors , we use the squared OLS residuals, , as a consistent proxy for the true error variances, . We then test if these proxies can be predicted by the original regressors.
Hypotheses:
- Homoskedasticity (The error variance is constant and unrelated to ).
- Heteroskedasticity (The error variance is a function of ).
Procedure:
- Run the primary regression and obtain the residuals .
- Construct the squared residuals, .
- Run an auxiliary regression of the squared residuals on a set of regressors that includes the original regressors, their squares, and their cross-products.
- Obtain the from this auxiliary regression.
The test statistic is a form of a Lagrange Multiplier (LM) test.
The White Test Statistic (LM Version)
Under the null hypothesis of homoskedasticity, the following statistic is asymptotically distributed as a Chi-squared random variable:
where is the number of regressors in the auxiliary regression (excluding the constant).
Decision Rule: If exceeds the critical value from the distribution for a chosen significance level , we reject and conclude that heteroskedasticity is present.
Part 3: Correction: Heteroskedasticity-Consistent Standard Errors (HCSE)
Given that OLS coefficient estimates remain unbiased and consistent under heteroskedasticity, the most common remedy is not to change the estimator, but to correct the formula for its variance.
We begin with the true variance formula derived in Part 1:
The challenge is that is unknown. White (1980) proposed a consistent estimator for this matrix.
The White/Eicker/Huber HCSE Estimator
The key insight is to replace the unknown diagonal elements of , , with their consistent sample counterparts, the squared OLS residuals, .
We form the estimator , often denoted .
Substituting this into the true variance formula gives the **Heteroskedasticity-Consistent Covariance Matrix Estimator (HCSE)**, also known as the "sandwich estimator":
Practical Implementations (HC0, HC1, HC2, HC3)
The basic White estimator (often called HC0) can be biased in small samples. Various small-sample corrections have been developed:
- HC1 (Default in Stata): A simple degrees-of-freedom correction: .
- HC2, HC3: More complex corrections that adjust for the leverage of individual observations. HC3 is often recommended for smaller samples as it is more conservative.
The **Robust Standard Errors ()** reported by statistical software are the square roots of the diagonal elements of one of these estimated matrices.