Heteroskedasticity and Robust Standard Errors
Learn why uneven scatter around a regression line makes ordinary standard errors unreliable, and how robust errors fix them.
Key takeaways
- Heteroskedasticity means the spread of the errors changes with the explanatory variables.
- The coefficients stay unbiased, but the usual standard errors are wrong, so t tests and confidence intervals mislead.
- A plot of residuals against fitted values, which shows a fan shape, is the quickest check.
- Robust standard errors correct the problem without changing the coefficients.
- Weighted least squares or a log transformation can also fix it when you know the pattern.
Here is a puzzle about groceries. Take two households, one earning $20,000 a year and one earning $200,000. Ask each how much they spend on food. The poorer household will spend something close to a fixed necessary amount: maybe $3,000, give or take a few hundred. The richer household might spend $6,000, or $15,000, or $25,000, depending on whether they cook at home, dine out nightly or host big dinners. The spread of possible answers is far wider for the rich household.
If you plot food spending against income, the points do not sit evenly around a line. They fan out like a trumpet: tight on the left, loose on the right. A regression's standard error formula quietly assumes that is not happening. When the spread changes with the variable, the formulas give the wrong answer. This problem has a famously awkward name, heteroskedasticity (say it: HET-er-oh-skeh-DAS-tiss-ih-tee), meaning "different scatter." Its cure is a pair of words that you will see in nearly every research table: robust standard errors.
Equal scatter, the assumption in question
Recall the classical assumptions. One of them says the error term has the same variance at every value of X. That is homoskedasticity: "same scatter." Written out, the variance of the error, σ², is one fixed number. Under that assumption, a single formula for standard errors works.
Heteroskedasticity breaks it: the variance changes with X. Suppose in the food example the typical error is about $300 at low incomes and about $3,000 at high incomes. The regression line may run through the middle of the cloud just fine, but the cloud is thick on one side and thin on the other.
Around the line, points sit within ±0.3 at income 2, ±0.8 at income 5, and ±1.6 at income 8.
In the picture the line is 1 + 0.6 × Income. At Income = 2, the line gives 2.2, and the points sit at 1.9 and 2.5, which is ±0.3. At Income = 5, the line gives 4.0, and the points sit at 3.2 and 4.8, ±0.8. At Income = 8, the line gives 5.8, and the points sit at 4.2 and 7.4, ±1.6. The scatter grows with income. That is heteroskedasticity in one glance.
It shows up all over economics: household spending, firm profits (big firms swing by more dollars), city crime counts, country GDP. Whenever the thing you measure has a natural scale that grows, the noise tends to grow with it.
What it breaks and what it spares
Here is the part to memorize.
The line is fine. The measure of how sure you are is not.
The coefficients are not biased: across many samples they still land on the truth on average. What goes wrong is the uncertainty measure. The ordinary standard error formula averages the scatter across the whole sample. If most of the information comes from the high-income households with wide scatter, the formula understates how uncertain the slope really is. A t statistic that should be 1.9 shows up as 3.0, and you declare a finding that is not there. In other datasets it can go the other way, and you miss a real one. The direction depends on the pattern, which is why you cannot just guess.
Spotting it
Plot the residuals. After the regression, plot the residuals against the fitted values or against the suspect variable. A random cloud of even thickness is good. A fan or cone is the warning sign. Look at the residual-check lesson for more on this habit.
Run a formal test. The Breusch–Pagan test is a common one. The idea: if the errors are heteroskedastic, their squared size should be explained by the X variables. So regress the squared residuals on X and measure how much it explains. The test statistic is n × R², where R² comes from that side regression, and it is compared with a chi-square cutoff.
For example, with n = 100 observations and one X variable, suppose the side regression gives R² = 0.08. Then the statistic is 100 × 0.08 = 8. For one degree of freedom the 5% chi-square cutoff is about 3.84. Since 8 is larger, we reject the claim of equal scatter. (The White test is a more general cousin of this idea.)
Tests tell you whether there is evidence, but with large samples even tiny, harmless unevenness is flagged. Use the plot to judge whether it is big.
The fix: robust standard errors
The most common remedy is to keep the same coefficients and change only how the standard errors are computed. Robust standard errors, also called heteroskedasticity-consistent or White standard errors (after the economist Halbert White, who proposed them in 1980), estimate the scatter observation by observation instead of assuming one value for everyone. They remain valid whether or not the scatter is equal. Software reports them with an option, often written "robust" or "HC1" and similar.
Compare the same regression with both kinds of standard errors. Suppose that in a different sample the slope on income is 0.15 (in thousands of dollars of food per $10,000 of income, say).
Usual standard error: 0.05 → t = 0.15 ÷ 0.05 = 3.00
Robust standard error: 0.08 → t = 0.15 ÷ 0.08 = 1.875 A 95% confidence interval uses roughly the coefficient ± 1.96 standard errors:
Usual: 0.15 ± 1.96 × 0.05 = 0.15 ± 0.098 → [0.052, 0.248]
Robust: 0.15 ± 1.96 × 0.08 = 0.15 ± 0.157 → [−0.007, 0.307] With the usual errors, the interval excludes zero and the effect looks solid. With robust errors the interval just barely includes zero, and the t of 1.875 falls short of the usual cutoff near 1.96. The honest conclusion changes from "clearly positive" to "probably positive but not certain." The coefficient did not move. Only our knowledge of how much to trust it did.
Many applied researchers simply report robust errors by default.
Robust errors are valid in large samples. With very small samples, they can be unreliable, and some software offers small-sample adjustments. Check your software's documentation for which version it uses.
Why the usual formula goes wrong
Think of the ordinary formula as a pollster who surveys a city, calculates one average margin of error, and applies it to every neighborhood. If some neighborhoods are far more varied than others, the single average hides that. The slope of a regression line is mostly decided by the points far from the middle of the X values, since they have the most leverage. In the food example those are the high-income households, which are exactly where the scatter is wide. The ordinary formula spreads the wide scatter evenly over everyone and so makes the slope look better pinned down than it is.
A tiny numerical sketch makes this concrete. Suppose a sample has half its households at low income, with errors around ±$300, and half at high income, with errors around ±$3,000. The ordinary formula uses one overall error size, somewhere around $2,100 (the root-mean-square, since √((300² + 3,000²) ÷ 2) = √4,545,000 ≈ 2,132). But the observations that tilt the slope the most, the high-income ones, really have errors near $3,000. Using $2,132 where $3,000 is more appropriate understates the standard error by roughly 30%. Robust errors avoid this by using each observation's own residual.
Weighted least squares in one example
Suppose you know that the error's standard deviation in the food example equals 0.5 × Income (in the graph's units). A household with Income = 2 has errors of about 1.0 and a household with Income = 8 has errors of about 4.0. The high-income household is four times as noisy, so its observation deserves less trust. Weighted least squares gives each observation a weight of 1 ÷ (standard deviation)², which is 1 ÷ 1 = 1 for the first and 1 ÷ 16 = 0.0625 for the second. The noisy household counts one-sixteenth as much. Because it uses the extra knowledge, WLS gives smaller standard errors than plain OLS with robust errors, when the knowledge is right. If you guess the pattern wrong, though, it can do worse, which is why robust errors are the cautious default.
Other cures
Transform the variables. The fan shape often disappears when you take logs. A food-spending regression in logs asks about percentage changes, and percentage scatter is often steady across rich and poor. This is one reason economists log money variables (see the lesson on logs and functional form).
Weighted least squares (WLS). If you know how the scatter grows, you can weight observations by their reliability. Suppose the error's standard deviation is proportional to income. Then dividing every variable by income, or equivalently giving each observation a weight of 1 ÷ income², produces a model with even scatter, and it is more precise than plain OLS. The catch: you must know the pattern, and a wrong guess hurts. Robust errors do not need the pattern, so they are the safe default.
Rethink the model. Sometimes uneven scatter hints that the model is missing something, such as a curve or a group difference. Fix those with dummy variables or a better functional form before you reach for robust errors.
Common mistakes
Thinking it biases the slope. It does not. Reporting that "the coefficients are wrong because of heteroskedasticity" is a common slip. Only the standard errors are in trouble.
Assuming robust errors are always bigger. They are often bigger, but not always. They are simply the honest ones.
Mixing it up with autocorrelation. Heteroskedasticity is about the size of errors changing. Autocorrelation, covered in the next lesson, is about errors being linked from one period to the next. They are different problems with different cures, although some "robust" options handle both.
Fixing the standard errors and forgetting the model. Robust errors repair the uncertainty measure. They do not repair a model that leaves out an important variable.
Words to know
Homoskedasticity the situation where the error term has the same variance at every value of X.
Heteroskedasticity the situation where the variance of the error term changes with X.
Residual the gap between an actual value and the value the regression predicted.
Robust standard error a standard error that stays valid whether or not the scatter is even.
Breusch–Pagan test a test that checks whether the squared residuals are explained by the X variables.
Weighted least squares a method that gives less weight to the noisier observations.
Confidence interval a range of plausible values for a coefficient, built from the estimate and its standard error.
Check yourself
- In your own words, what does heteroskedasticity mean?
- Does heteroskedasticity bias the coefficients? What does it harm instead?
- A coefficient is 0.30 with a robust standard error of 0.10. Compute the t statistic and the 95% interval (use 1.96).
- In the Breusch–Pagan example, n = 200 and the side regression R² is 0.03. Compute n × R², and say whether it beats the cutoff of 3.84.
- What picture would make you suspect heteroskedasticity?
- Explain why taking logs of a money variable can reduce uneven scatter.
Show the answers
- The spread of the errors is not the same at all values of X; it grows or shrinks with X.
- No, the coefficients stay unbiased; the usual standard errors, t tests and intervals become unreliable.
- t = 0.30 ÷ 0.10 = 3.0; the interval is 0.30 ± 1.96 × 0.10 = 0.30 ± 0.196, or [0.104, 0.496].
- 200 × 0.03 = 6.0, which is above 3.84, so we reject equal scatter.
- A residual plot that fans out into a cone, tight at one end and wide at the other.
- Logs turn dollar swings into percentage swings, and percentage scatter is often more even across small and large values.