Heteroscedasticity — Definition & Example
Heteroscedasticity is a problem in regression where the scatter of points around the fitted line is not even. The residuals get noticeably larger or smaller as the predictor changes, which often shows up as a fan or cone shape in a residual plot.
In the model , the errors are heteroscedastic if is not the same for all . This violates the constant-variance assumption that the usual ordinary least squares (OLS) standard-error formulas rely on. The opposite condition is called homoscedasticity. The alternative spelling is heteroskedasticity.
Worked Example
Problem: A courier fits a regression that predicts delivery time (minutes) from distance (miles). The residuals for five short deliveries (under 5 miles) are . The residuals for five long deliveries (over 20 miles) are . Compare the spread of the two groups. Use the common rough guideline that a ratio of largest to smallest standard deviation above 2 signals unequal spread.
Step 1: Find the mean squared residual for the short deliveries. Square each residual, add, and divide by 5.
Step 2: Do the same for the long deliveries.
Step 3: Compare the spreads. The variance ratio is . Take the square root to compare typical residual sizes (standard deviations).
Answer: Typical residuals for long deliveries are 3 times as large as for short ones. That exceeds the guideline of 2, so these residuals suggest heteroscedasticity: prediction errors appear to grow with distance.
Why It Matters
In econometrics and data science courses, heteroscedasticity is common with income, prices, and sales data, where variability grows with size. It makes the usual OLS standard errors wrong, so hypothesis tests and confidence intervals for the slope can mislead you. Standard fixes include a log transformation of y, weighted least squares, or robust (heteroskedasticity-consistent) standard errors.
Common Mistakes
Mistake: Believing heteroscedasticity makes the fitted slope and intercept biased.
Correction: Under the other standard assumptions, the OLS coefficient estimates stay unbiased. What breaks is the estimated uncertainty: the standard errors, p-values, and confidence intervals are unreliable. Fix the inference, for example with robust standard errors, rather than discarding the line.
