Tutorials › Regression Analysis (Undergraduate) › An Applied Analysis of Unequal Variance

Unequal Variance and Robust Uncertainty · Tutorial 541 of 991

An Applied Analysis of Unequal Variance

Work through a hypothetical regression with increasing residual spread, from diagnostic choices to robust and conventional slope intervals.

Advanced 10 min read

What You'll Learn

  • State the regression assumptions needed to interpret an income-and-expenditure slope.
  • Use residuals versus fitted values to assess whether the spread appears to increase.
  • Calculate a conventional slope standard error and confidence interval.
  • Calculate an HC3-robust slope standard error and confidence interval.
  • Compare the two conclusions without treating a p-value as evidence that a hypothesis is true.
  • Explain why a robust standard error does not repair a misspecified mean model or remove small-sample limitations.

From a Changing Residual Pattern to an Applied Analysis

A regression line summarizes how the mean response changes with a predictor. Its uncertainty calculations also depend on how the observations vary around that line. If the residual spread grows as income increases, the line may still summarize the conditional mean adequately, but the usual standard error formula may no longer be appropriate. An applied analysis must therefore examine the mean pattern and the spread pattern separately, then choose uncertainty calculations that match the evidence and the study design.

This tutorial follows a hypothetical sample of households, with annual income as the predictor and annual expenditure as the response. The goal is not to claim that income causes expenditure. It is to estimate a linear association, inspect whether residual variability appears constant, and compare conventional inference with an HC3 heteroskedasticity-robust interval.

Model and assumptions: For household \(i\), the simple linear regression model is \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(x_i\) is income, \(Y_i\) is expenditure, and \(\varepsilon_i\) is the error. The conditional mean assumption is \(E(Y_i\mid x_i)=\beta_0+\beta_1x_i\). For the usual conventional standard errors and exact \(t\)-inference, errors must also be independent, normally distributed, and have a common variance \(\operatorname{Var}(\varepsilon_i\mid x_i)=\sigma^2\). Heteroskedasticity means this conditional variance changes with \(x_i\). Robust standard errors can allow unequal variances, but still rely on a correctly specified mean model, independent observations, and suitable large-sample conditions for their approximate inference.

The fitted residual for observation \(i\) is \(e_i=Y_i-\hat{Y}_i\), where \(\hat{Y}_i\) is its fitted value from the regression line. A residual-versus-fitted plot is useful because it displays both the direction of departures from the line and whether their vertical spread changes across the range of fitted values. A widening band is evidence to investigate unequal variance; it is not, by itself, proof that the population errors are heteroskedastic.

Worked Example: Inspecting the Income-and-Expenditure Pattern

Worked Example: Inspecting the Income-and-Expenditure Pattern

Suppose six independently sampled households have the following hypothetical measurements. Income is recorded in units of $10,000 per year, and expenditure is recorded in thousands of dollars per year.

HouseholdIncome \(x_i\) ($10,000s)Expenditure \(Y_i\) ($1,000s)
115.7
225.8
337.0
446.5
556.8
668.7

The least-squares line for these values is \(\hat{Y}=5+0.5x\). For example, when \(x=1\), the fitted expenditure is \(5.5\) thousand dollars, so \(e_1=5.7-5.5=0.2\) thousand dollars. The residuals for the six households are \(0.2,-0.2,0.5,-0.5,-0.7,0.7\) thousand dollars.

A residual-versus-fitted plot would place those residuals at fitted values \(5.5,6.0,6.5,7.0,7.5,8.0\), respectively. The absolute residuals are \(0.2,0.2,0.5,0.5,0.7,0.7\) thousand dollars. Their increase across the fitted range suggests that the residual spread may be larger for households with higher fitted expenditure. With only six observations, this is a warning pattern rather than a reliable determination of the variance structure.

The plotted points also alternate above and below the line, with no evident smooth bend in this tiny sample. That is some limited reassurance about curvature, not a convincing validation of linearity. The hypothetical sampling statement supports treating the six households as independent for illustration; an actual analysis would need to assess how the households were selected and whether dependence is plausible.

Calculate Both Versions of the Slope Uncertainty

For this simple regression, the conventional slope standard error uses the residual mean square and the spread of incomes around their sample mean. It assumes constant error variance. A heteroskedasticity-robust standard error instead uses each residual’s contribution to the coefficient variance. We will use HC3, which divides each squared residual by \((1-h_{ii})^2\), where \(h_{ii}\) is the observation’s leverage. The leverage values enter this calculation as part of HC3; this example does not use them to diagnose which household is influential.

Formulas used: Let \(S_{xx}=\sum_i(x_i-\bar{x})^2\) and \(SSE=\sum_i e_i^2\). The conventional slope standard error is \(SE_{\mathrm{conv}}(\hat{\beta}_1)=\sqrt{[SSE/(n-2)]/S_{xx}}\). For simple regression with an intercept, the HC3 slope variance is \(\sum_i[(x_i-\bar{x})^2e_i^2/(1-h_{ii})^2]/S_{xx}^2\). In either case, a confidence interval is the estimate plus or minus a critical value times its standard error.

Worked Example: Conventional Slope Interval

For the six-household data, \(\bar{x}=3.5\), and the deviations from \(\bar{x}\) are \(-2.5,-1.5,-0.5,0.5,1.5,2.5\). Therefore,

$$ S_{xx}=(-2.5)^2+(-1.5)^2+(-0.5)^2+(0.5)^2+(1.5)^2+(2.5)^2=17.5 $$

The squared residuals sum to \(SSE=0.04+0.04+0.25+0.25+0.49+0.49=1.56\), in squared thousands of dollars. With \(n-2=4\) residual degrees of freedom, the residual mean square is \(1.56/4=0.3900\). Thus,

$$ SE_{\mathrm{conv}}(\hat{\beta}_1)=\sqrt{\frac{0.3900}{17.5}}=0.1493 $$

The estimated slope is \(0.5000\) thousand dollars of expenditure per $10,000 of income. Using \(t^*=2.776\), the 95% conventional interval is

$$ 0.5000\ \mathbin{\pm}\ 2.776(0.1493) =0.5000\ \mathbin{\pm}\ 0.4144 =(0.0856,\ 0.9144) $$

Under the conventional model assumptions, the interval procedure has 95% long-run coverage. In context, this interval estimates an increase of 0.0856 to 0.9144 thousand dollars in mean annual expenditure per $10,000 increase in annual income. Its positive lower endpoint would suggest a nonzero positive slope at the 5% two-sided level if the model assumptions were appropriate. The residual pattern gives reason to question the equal-variance assumption behind this interval.

Worked Example: HC3-Robust Slope Interval

For an intercept-and-slope regression, the leverage is \(h_{ii}=1/n+(x_i-\bar{x})^2/S_{xx}\). For the six incomes, the leverage values are approximately \(0.5238,0.2952,0.1810,0.1810,0.2952,0.5238\). Substituting the centered incomes, residuals, and leverages into the HC3 slope variance gives

$$ \widehat{\operatorname{Var}}_{\mathrm{HC3}}(\hat{\beta}_1) = \frac{ \frac{6.25(0.04)}{(1-0.5238)^2} +\frac{2.25(0.04)}{(1-0.2952)^2} +\frac{0.25(0.25)}{(1-0.1810)^2} +\frac{0.25(0.25)}{(1-0.1810)^2} +\frac{2.25(0.49)}{(1-0.2952)^2} +\frac{6.25(0.49)}{(1-0.5238)^2} }{17.5^2} \approx \frac{17.20}{306.25}=0.05615 $$

The HC3 standard error is therefore \(\sqrt{0.05615}=0.2370\) thousand dollars per $10,000 of income. Using the same \(t_4\) critical value for this illustrative small-sample comparison gives

$$ 0.5000\ \mathbin{\pm}\ 2.776(0.2370) =0.5000\ \mathbin{\pm}\ 0.6579 =(-0.1579,\ 1.1579) $$

This robust interval includes zero, unlike the conventional interval. If a two-sided test is formed using \(t=0.5000/0.2370=2.11\) and a \(t_4\) reference distribution, its p-value is about 0.102. On that reference, the slope is not statistically significant at \(\alpha=0.05\). The conclusion is not that the null hypothesis is true; the data do not provide sufficiently strong evidence against a zero slope under this approximate robust procedure.

This comparison is an illustration of how the uncertainty method can affect a conclusion, not a recommendation to treat either interval as definitive. With only six observations, HC3 does not make the sampling distribution normal or guarantee accurate coverage. The \(t_4\) reference is a small-sample approximation, and the earlier material on small-sample limits of robust inference is especially relevant. A real analysis would need more information and a substantially larger sample for dependable robust inference.

Why the Difference Matters

The conventional calculation pools residual variation into one estimate of \(\sigma^2\), then uses that common variance in the slope’s standard error. When the conditional variance changes with income, that pooled estimate does not in general produce the right coefficient uncertainty. HC3 allows residual contributions to vary across observations and adjusts them for leverage. The two calculations can therefore produce different standard errors, intervals, and test conclusions even though they use the same fitted least-squares line.

A robust standard error changes the estimated uncertainty; it does not change the least-squares slope, fix an incorrect conditional mean, account automatically for dependent households, or establish a causal effect. If the residual plot showed systematic curvature, for example, changing to HC3 would not make a straight-line mean model appropriate. Likewise, if households were clustered or repeatedly observed, an independence-based HC3 calculation would not address that dependence.

The six-point residual pattern is suggestive, not conclusive: residuals are noisy estimates of errors, and a small sample gives little power to distinguish a real spread trend from chance variation. A disciplined applied analysis therefore uses plots and context, considers whether the linear mean is plausible, checks the sampling structure, and reports uncertainty in a way that acknowledges limitations. It does not select an estimator solely because it produces a preferred p-value.

A Practical Analysis Sequence

1
Specify the question and units.
Define the response, predictor, population of interest, and the units of a one-unit change in the predictor.
2
Fit and examine the mean pattern.
Estimate the least-squares line and inspect the data and residual pattern for evidence that a straight-line conditional mean is inadequate.
3
Inspect residual spread and study design.
Look for changing vertical spread and consider whether observations are independent. A plot can flag concerns but cannot settle them on its own.
4
Match inference to the assumptions.
If equal variance is credible, conventional standard errors may be suitable. If unequal variance is a concern and the other conditions are reasonable, calculate a robust standard error and interval.
5
Interpret the result with its limitations.
State the estimated change in context and units, describe what the interval does and does not support, and note small-sample or model limitations.

Common Mistake

A common mistake is to see a widening residual pattern, calculate a robust standard error, and then say that the regression assumptions have all been repaired. The correction is narrower: a heteroskedasticity-robust covariance estimate can improve coefficient uncertainty calculations when the mean model is appropriate and observations are independent, but it cannot repair curvature, dependence, poor sampling, or a very small sample. Another mistake is to interpret the robust interval as giving a 95% probability that the fixed population slope lies inside it. The 95% refers to the long-run coverage of the interval procedure under its conditions, not a probability assigned to this particular fixed slope after observing the data.

Key takeaway: In an applied regression, inspect the conditional mean and residual spread separately. When the spread appears unequal, robust inference may be more suitable than conventional inference, but its assumptions, sample-size limitations, and interpretation still need to be stated.

Check Your Understanding

Use the model, diagnostics, and calculations in this tutorial to answer the following questions.

  1. What pattern in the hypothetical residuals suggests unequal variance, and why is six observations too little to treat that pattern as proof?
  2. State the conventional standard-error assumption that is in question when the residual spread increases with fitted expenditure.
  3. In context, what does the fitted slope of \(0.5\) mean, including its units?
  4. Why does the HC3 interval include zero when the conventional interval does not?
  5. Name one important problem that a heteroskedasticity-robust standard error cannot fix.