Heteroskedasticity in Regression
A practical guide to recognizing changing error variance in regression, understanding its consequences for OLS, and choosing an appropriate response.
What Is and How to Detect It
What varies—and what does not
In the linear regression model , the error is the difference between an observation and the part of the outcome represented by the model. means the conditional variance of that error is constant:
If the conditional variance changes with predictors or fitted outcomes, the errors are heteroskedastic. For instance, household spending may vary relatively little among low-income households but much more among high-income households.
This is a claim about the spread of errors, not necessarily about the modeled average relationship. A regression can represent the conditional mean correctly and still have heteroskedastic errors. Conversely, a pattern in the residual mean, such as curvature, may suggest a problem with the functional form rather than—or as well as—changing variance.
Diagnose with plots and tests together
Start by plotting residuals against fitted values and important predictors. With roughly constant variance, the residuals should have similar vertical spread throughout the plot. A funnel or fan shape, or another systematic widening or narrowing, suggests changing variance. Also look for outliers and patterns in the residual mean; a variance diagnosis alone does not resolve those issues.
The Breusch–Pagan test checks whether squared residuals are associated with specified variables that might explain the variance. Its null hypothesis is constant variance, so a small p-value is evidence against that null. The White test uses functions of the regressors to look for variance patterns more generally; Breusch–Pagan is particularly useful when plausible variance predictors are available.
Treat these tests as supporting evidence, not verdicts. A non-significant result does not prove constant variance, and neither test establishes that the rest of the model is correct. Interpret test results alongside residual plots and subject-matter knowledge.
Consequences for OLS and Robust Inference
What changes for OLS
does not automatically make OLS coefficients biased. If the conditional mean is correctly specified and the errors have conditional mean zero, changing error variance alone does not bias the coefficient estimates. Those conditions matter: this conclusion is not a general cure for a misspecified mean model or other problems.
Efficiency is a separate issue. With , OLS is generally no longer the most efficient linear unbiased estimator; another estimator may have smaller variance. Thus, “unbiased” does not mean “as precise as possible.”
The usual OLS standard-error formula assumes constant error variance. When that assumption fails, conventional standard errors may be too large or too small. As a result, t-tests, p-values, confidence intervals, and standard F-tests based on them can be unreliable. does not imply that conventional standard errors are always too small.
Robust standard errors: an inference adjustment
When the mean model is appropriate but the variance pattern is unknown or not worth modeling, provide an alternative for inference. They leave the OLS coefficient estimates unchanged while adjusting the estimated covariance matrix. Common choices are ; HC3 includes a leverage adjustment and is a commonly available option.
Robust standard errors do not repair omitted variables, endogeneity, outliers, or an incorrect functional form. Nor do they automatically account for dependence between observations, such as serial or within-cluster correlation. They address inference under changing variance; they are not a substitute for checking the model and the structure of the data.
Choosing a Model or Variance Adjustment
Match the response to what is known
If the conditional mean is appropriate but the variance pattern is unknown or not worth modeling, robust standard errors can address inference while leaving OLS coefficients unchanged. If the pattern is understood and can be estimated credibly, is another possibility. WLS gives less weight to observations with higher error variance; ideally, weights are proportional to the inverse conditional variance. This can improve efficiency when the variance model and weights are suitable. Misspecified weights may fail to improve precision and can lead to misleading uncertainty estimates. When the variance is estimated from the data, the procedure is often called .
A transformation or a different model may be more appropriate when it better represents the outcome and research question. For example, a logarithmic transformation may reduce variance that grows with the outcome’s level. A generalized linear model may be suitable when the outcome distribution and variance structure call for one. These are modeling choices, not automatic fixes: after changing the model, recheck residual patterns and assumptions.
Apply the choices to spending and income
Suppose a regression predicts household spending from income. Its residual plot has a narrow band at low predicted spending and a wider band at high predicted spending. This pattern suggests that the error variance increases as predicted spending rises.
If the conditional mean model is plausible but the variance pattern is unknown, use OLS coefficients with for inference. If there is a well-supported model for how error variance changes with income, WLS may improve efficiency. But if the same plot also shows curvature, reconsider the mean specification: robust standard errors address inference, not that functional-form problem. Whatever model or variance adjustment is chosen, revisit the residual patterns to assess what remains.