Skip to content
Grad Coach

Diagram · CC BY 4.0

Heteroscedasticity example: spread that grows with x

A hundred points that lie almost on a rising trend at the left and scatter widely at the right.

Scatter plot of 100 simulated observations, one at each x from 1 to 100, on axes from 0 to 100, rising with the trend y = 5 + 0.8x (no line drawn). The points sit close to the trend at small x and fan out as x grows, the increasing variance called heteroscedasticity.
Heteroscedasticity scatter plot. Derek Jansen, Grad Coach, CC BY 4.0.

What it shows

Simulated data from y = 5 + 0.8x with normal error whose standard deviation is 0.12x, from 0.12 at x = 1 to 12 at x = 100. The error variance rises with x, which is heteroscedasticity, and the points open out from left to right.

One observation sits at each whole number x from 1 to 100, on axes from 0 to 100. While x is small the error is under one unit, so after rounding y to a whole number the first points lie almost exactly on the trend. Its counterpart with constant error is the homoscedasticity example.

How to read it

  1. Read the plot from left to right: the points start in a narrow line and spread wider with every step along x.

  2. Split the x range into thirds and the residuals from the least-squares line have standard deviations of 1.9, 5.7 and 11.0, each at least half again the one before.

  3. Heteroscedasticity leaves the least-squares estimates unbiased, and the fitted line here, y = 5.2 + 0.80x, is close to the model’s. The cost is in inference: the usual standard errors assume constant variance, so the tests and confidence intervals built on them can mislead.

The numbers behind it

  • The model is y = 5 + 0.8x + e, with one observation at each x from 1 to 100 and y rounded to a whole number; e is normal with mean 0 and standard deviation 0.12x.
  • Least-squares line y = 5.2 + 0.80x. Sample standard deviation of the residuals: 1.9 for x = 1 to 33, 5.7 for 34 to 66 and 11.0 for 67 to 100.
  • This is the first draw in sequence in which every y lies between 1 and 100, every point lies within 2.5 standard deviations of the model line (allowing 0.5 for rounding), and the residual standard deviation grows at least 1.3 times from each third to the next, ending more than 2.5 times the first. The screen was set so the fan is unmistakable.

Ways to use it in teaching

  • Ask students for a variable whose spread should grow with its level, such as spending on meals against income, and whether taking the log of spending would even out the fan.

  • Turn it into a residual plot: the fan here becomes the funnel in the residual plot examples, which is the view students meet when they check a regression of their own.

  • Before showing the homoscedasticity example, ask what an ordinary least-squares fit to these data gets right (the line) and what it gets wrong (the standard errors). Then introduce weighted least squares, which gives the precise points at small x more weight.

For where regression sits among the statistical tests, see our guide to inferential statistics.

Sources

  • Çetinkaya-Rundel, M., & Hardin, J. (2024). Introduction to modern statistics (2nd ed.). OpenIntro. https://openintro-ims.netlify.app/
  • Homoscedasticity and heteroscedasticity. (n.d.). In Wikipedia. Retrieved November 4, 2026, from https://en.wikipedia.org/wiki/Homoscedasticity_and_heteroscedasticity

Inference and evidence

Related diagrams

All open educational resources

Need something else?

Tell us which diagram, template or worked examples would help your teaching, and we’ll do our best to add it to the collection.