What Is Heteroskedasticity in Regression: Causes and Fixes

Heteroskedasticity is a condition in regression analysis where the spread of the data points around the regression line is not constant. In a well-behaved regression, you’d expect roughly the same amount of scatter at every point along the line. When that scatter widens or narrows systematically, you have heteroskedasticity, and it can quietly undermine the reliability of your results even though your coefficient estimates remain correct.

What Constant Variance Means (and What Breaks)

Standard regression assumes that the random errors in your data all come from the same distribution with the same spread. Statisticians call this “homoskedasticity,” and it’s one of the core assumptions behind ordinary least squares (OLS) regression. Formally, every observation’s error term is expected to have the same variance. When that holds, your regression line is not just a good estimate of the relationship between variables, it’s the best possible linear estimate you can get. This is guaranteed by the Gauss-Markov theorem, which says OLS produces the most precise linear unbiased estimates when errors have mean zero and constant variance.

Heteroskedasticity means the variance of those errors changes systematically across your data. Maybe the scatter is tight for small values of your predictor variable and wide for large ones. Maybe it’s the reverse. Either way, the “constant variance” assumption no longer holds, and the Gauss-Markov guarantee breaks down. Your coefficient estimates are still unbiased, meaning they’re centered on the true values, but they’re no longer the most efficient estimates available.

A Practical Example: Income and Spending

The classic example comes from economics. Imagine you’re modeling how much people save based on their income. People earning $25,000 a year don’t have much flexibility: nearly all of their income goes to necessities, so there’s little variation in savings. But people earning $200,000 have far more discretion. Some save aggressively, others spend lavishly. The result is that the spread of savings data fans out as income rises. Low-income observations cluster tightly around the regression line while high-income observations scatter widely. That fanning pattern is textbook heteroskedasticity.

This isn’t limited to economics. In psychology, reaction time data often shows more variability for certain experimental conditions. In biology, measurement error can grow with the size of the organism being measured. Any time the precision of your outcome variable depends on the level of a predictor, you’re likely dealing with non-constant variance.

Why It Matters for Your Results

Heteroskedasticity doesn’t bias your regression coefficients. If the true effect of education on income is $3,000 per year of schooling, your OLS estimate will still center on that number. The problem is everything built on top of those coefficients: standard errors, p-values, and confidence intervals.

Standard errors calculated under the assumption of constant variance will typically be wrong. In many cases, they’re too small, which makes your test statistics too large. This inflates your Type I error rate, meaning you’ll reject the null hypothesis more often than you should. If you’re testing at the 5% significance level, your actual false positive rate could be considerably higher. Your confidence intervals will also be too narrow, giving you false precision. You think your estimate is pinned down tightly when it’s actually more uncertain than the numbers suggest.

The core issue is that the t-statistics your software reports assume a specific distribution that depends on having correct standard errors. When those standard errors are misestimated, the test statistics don’t follow the expected distribution, and the p-values attached to them become unreliable.

How to Spot It in Residual Plots

The most common diagnostic is a residual-versus-fitted-values plot. After running your regression, you plot the residuals (the differences between observed and predicted values) on the vertical axis against the fitted values on the horizontal axis. If homoskedasticity holds, you’ll see a roughly even band of points with no obvious pattern.

Heteroskedasticity shows up as a fan shape or cone shape. The residuals might be tightly clustered on the left side of the plot and spread apart on the right, forming a triangle or megaphone pattern. A double-bow pattern, where the spread widens in the middle and narrows at the extremes, can also signal non-constant variance. When you plot squared residuals instead, the tell is a wedge-shaped pattern, though this wedge isn’t always obvious even when heteroskedasticity is present.

These plots are symmetric around zero. The key isn’t whether the residuals are above or below the line (that would suggest bias), it’s whether the vertical range of the scatter changes as you move left to right.

Formal Tests for Non-Constant Variance

Visual inspection is useful but subjective, so statisticians have developed formal hypothesis tests. The Breusch-Pagan test checks whether the squared residuals are systematically related to the predictor variables. If they are, that’s evidence the variance isn’t constant. White’s test is a more general version that doesn’t require you to specify the exact form of heteroskedasticity. Both tests produce a p-value; a small value suggests the constant-variance assumption is violated.

These tests work best in larger samples. With small datasets, they may lack the statistical power to detect heteroskedasticity even when it’s present, which is why residual plots remain a valuable complement.

Robust Standard Errors

The most widely used fix doesn’t change how you estimate the coefficients at all. Instead, it corrects the standard errors so they’re valid even when the variance isn’t constant. These are called robust standard errors, sometimes referred to as Huber-White or sandwich standard errors after the researchers who developed them.

The idea is straightforward. Rather than assuming every observation contributes equally to the uncertainty of your estimate, the sandwich estimator uses the actual squared residuals from each observation to build a more realistic picture of variability. The resulting standard errors are asymptotically correct even when the constant-variance assumption fails, meaning they converge to the right values as your sample grows. Your coefficients stay the same, but the p-values and confidence intervals around them become trustworthy.

In practice, using robust standard errors is simple. In Stata, you add vce(robust) to your regression command, or use the hetregress command for models that explicitly account for heteroskedasticity. In R, the sandwich and lmtest packages provide robust standard errors with just a few lines of code. Many researchers in economics and the social sciences now report robust standard errors by default, regardless of whether they’ve detected heteroskedasticity, as a precautionary measure.

Weighted Least Squares

If you have a good idea of how the variance changes across observations, weighted least squares (WLS) offers a more efficient alternative. The logic is intuitive: observations with less variance (more precision) should count more in your regression, and observations with more variance (less precision) should count less.

WLS assigns each data point a weight inversely proportional to its variance. If an observation’s error variance is four times as large as another’s, it receives one-quarter the weight. This effectively transforms the model so that the errors have constant variance, restoring the conditions under which OLS works optimally. The result is more precise parameter estimates than you’d get from ordinary regression with robust standard errors.

The catch is that you need to know, or at least have a reasonable model for, how the variance changes. In the income-savings example, if variance grows proportionally with income, you’d weight each observation by the inverse of income. Getting the weights wrong can introduce new problems, so WLS works best when you have strong theoretical or empirical reasons to specify a particular variance structure.

Choosing Between Fixes

Robust standard errors are the safer, more general option. They don’t require you to know the form of heteroskedasticity, they’re easy to implement, and they protect you from inflated false positive rates. The trade-off is that they can be imprecise in small samples, and because they don’t change the estimation itself, they don’t improve the efficiency of your coefficient estimates.

Weighted least squares, when the weights are correctly specified, produces more precise estimates and more powerful tests. But it requires additional modeling decisions and can go wrong if the variance structure is misspecified. For most applied researchers, robust standard errors are the pragmatic default. WLS is worth pursuing when you have clear knowledge about why and how the variance changes, and when maximizing statistical power matters for your analysis.