Mathwords logoMathwords

Homoscedasticity — Definition, Formula & Example

Homoscedasticity is the condition in which the data points scatter around a regression line by about the same amount everywhere, whether x is small or large. It is also spelled homoskedasticity, and data with this property are called homoscedastic.

In the regression model yi=β0+β1xi+εiy_i = \beta_0 + \beta_1 x_i + \varepsilon_i, the errors are homoscedastic if their conditional variance is a single constant: Var⁡(εi∣xi)=σ2\operatorname{Var}(\varepsilon_i \mid x_i) = \sigma^2 for every ii. The opposite condition, in which the variance depends on xx, is called heteroscedasticity.

Key Formula

Var⁡(εi∣xi)=σ2for all i\operatorname{Var}(\varepsilon_i \mid x_i) = \sigma^2 \quad \text{for all } i
Where:
  • εi\varepsilon_i = The error term for observation i, which is the vertical gap between the true line and the data point
  • xix_i = The value of the explanatory variable for observation i
  • σ2\sigma^2 = One fixed error variance that does not change with x

Worked Example

Problem: A coffee cart owner records the daily high temperature xx (°F) and the number of cups of iced coffee sold yy on six days: (60, 42), (64, 45), (68, 57), (72, 65), (76, 69), (80, 82). The least-squares line is y^=2x−80\hat{y} = 2x - 80. Compute the residuals and describe the shape of the residual plot. Decide whether the residuals look homoscedastic, and explain what that means for the standard error of the slope.
Step 1: Find the predicted number of cups for each temperature by substituting xx into y^=2x−80\hat{y} = 2x - 80.
y^(60)=40,  y^(64)=48,  y^(68)=56,  y^(72)=64,  y^(76)=72,  y^(80)=80\hat{y}(60) = 40,\; \hat{y}(64) = 48,\; \hat{y}(68) = 56,\; \hat{y}(72) = 64,\; \hat{y}(76) = 72,\; \hat{y}(80) = 80
Step 2: Compute each residual e=y−y^e = y - \hat{y}. As expected for a least-squares line, the residuals add to 0.
e=42−40,  45−48,  57−56,  65−64,  69−72,  82−80=2,  −3,  1,  1,  −3,  2e = 42-40,\; 45-48,\; 57-56,\; 65-64,\; 69-72,\; 82-80 = 2,\; -3,\; 1,\; 1,\; -3,\; 2
Step 3: Read the residual plot, which has temperature on the horizontal axis and residual on the vertical axis. At the cool end (60–68°F) the residuals run from −3 to 2. At the warm end (72–80°F) they also run from −3 to 2. The points form a horizontal band of the same width all the way across. A fan shape, with residuals that start close to 0 and spread wider as temperature rises, would signal unequal spread. These residuals show no fan.
band width at cool end=2−(−3)=5,band width at warm end=2−(−3)=5\text{band width at cool end} = 2 - (-3) = 5, \qquad \text{band width at warm end} = 2 - (-3) = 5
Step 4: Because the spread is the same at every temperature, a single number can describe the typical residual size everywhere. This number is the residual standard deviation ss, which divides by n−2=4n - 2 = 4.
s=22+(−3)2+12+12+(−3)2+226−2=284=7≈2.65 cupss = \sqrt{\frac{2^2 + (-3)^2 + 1^2 + 1^2 + (-3)^2 + 2^2}{6 - 2}} = \sqrt{\frac{28}{4}} = \sqrt{7} \approx 2.65 \text{ cups}
Step 5: The standard error of the slope uses that one value of ss for all six days. First find SxxS_{xx}, the sum of squared deviations of xx from xˉ=70\bar{x} = 70. Then divide ss by Sxx\sqrt{S_{xx}}. This formula assumes one common spread, so it is trustworthy here. With a fan-shaped plot, the single ss would overstate the spread on cool days and understate it on hot days, and the standard error would be unreliable.
Sxx=102+62+22+22+62+102=280,SEb=sSxx=7280=140≈0.16 cups per °FS_{xx} = 10^2 + 6^2 + 2^2 + 2^2 + 6^2 + 10^2 = 280, \qquad SE_b = \frac{s}{\sqrt{S_{xx}}} = \frac{\sqrt{7}}{\sqrt{280}} = \frac{1}{\sqrt{40}} \approx 0.16 \text{ cups per °F}
Answer: The residuals are 2, −3, 1, 1, −3, 2. In the residual plot they form a horizontal band of constant width, running from −3 to 2 at both the cool and warm ends, with no fan. So the residuals are consistent with homoscedasticity. One residual standard deviation, s=7≈2.65s = \sqrt{7} \approx 2.65 cups, describes the spread at every temperature. The standard error of the slope, about 0.16 cups per °F, can therefore be computed from that single ss.

Why It Matters

The standard error of the slope, the t-test for the slope, and the confidence interval for the slope all assume a single error variance. This assumption appears as the "equal variance" condition in AP Statistics and introductory college statistics. When the assumption fails, these standard errors can be too small or too large. That is why econometrics courses teach heteroscedasticity-robust standard errors.

Common Mistakes

Mistake: Thinking homoscedasticity means the residuals are small or that all residuals are equal.
Correction: Homoscedasticity is about constant spread, not small spread. Residuals that scatter widely by the same amount at every x are still homoscedastic. Small residuals that fan out as x grows are not homoscedastic.

Related Terms