Tutorials › Regression Analysis (Undergraduate) › The White Test for Heteroskedasticity

Unequal Variance and Robust Uncertainty · Tutorial 525 of 991

The White Test for Heteroskedasticity

Learn to construct and interpret the White auxiliary regression, including its assumptions, degrees of freedom, and trade-off between flexibility and power.

Advanced 10 min read

What You'll Learn

  • Define the White test’s null and alternative hypotheses in a regression setting.
  • Build the auxiliary regression from predictors, their squares, and pairwise cross-products.
  • Count the test’s degrees of freedom after removing redundant terms.
  • Calculate and interpret the \(nR^2\) statistic and its chi-square p-value under suitable conditions.
  • Explain why a flexible test can have limited power in modest samples.
  • Recognize when the usual chi-square calibration needs stronger assumptions or a robust alternative.

Why Use a Flexible Heteroskedasticity Test?

A residual plot can reveal changing spread, but a formal test can summarize evidence that the error variance varies with the predictors. The Breusch–Pagan test looks for a particular form of relationship between variance and explanatory variables. The White test takes a broader approach: it allows the variance to be associated with the predictors, their squares, and their pairwise cross-products. That flexibility can detect a wider range of patterns, but it also adds terms and can make the test less powerful when the sample is modest.

The test is a diagnostic for the variance assumption in a specified regression model. It does not establish that the mean model is correct, identify the physical cause of a spread pattern, or show that any association is causal. Its result should be read alongside the model specification and residual diagnostics.

Set Up the Auxiliary Regression

Suppose the fitted mean model has \(p\) explanatory variables, \(X_1,\ldots,X_p\), and an intercept. Write its error as \(u_i\), and its ordinary least squares residual as \(e_i\), for observation \(i\). The constant-variance null hypothesis is that the conditional error variance is the same for all predictor values. Under the alternative, it changes with at least some predictor values.

Definition: The White auxiliary regression is an ordinary least squares regression of the squared residuals \(e_i^2\) on an intercept, the original predictors \(X_1,\ldots,X_p\), their squares \(X_1^2,\ldots,X_p^2\), and all pairwise cross-products \(X_jX_k\) for \(j<k\). The White test uses the auxiliary regression’s \(R^2_{\text{aux}}\) to test whether the non-intercept terms jointly explain variation in the squared residuals.

The regression is auxiliary because its response is not the original outcome \(Y_i\); it is the squared residual from the original mean model. The fitted values from this second regression are not a replacement for the original regression’s predictions. The purpose is to ask whether squared residuals have a systematic association with the specified variance predictors.

If all listed terms are linearly independent after including the intercept, the number of non-intercept terms is \(q=p+p+\binom{p}{2}=p(p+3)/2\). The test’s degrees of freedom are \(q\), not the number of observations and not the number of terms including the intercept. If terms are redundant, use the rank of the auxiliary design matrix: \(q\) is the number of independent non-intercept columns.

$$ e_i^2=\gamma_0+\sum_{j=1}^{p}\gamma_jX_{ij} +\sum_{j=1}^{p}\delta_jX_{ij}^2 +\sum_{j<k}\theta_{jk}X_{ij}X_{ik}+v_i $$

Here \(v_i\) is the auxiliary regression error. The joint null is that every non-intercept coefficient in this regression is zero. With a correctly specified conditional mean, \(E(u_i\mid X_i)=0\), this asks whether the conditional second moment of the errors is constant; since \(E(u_i\mid X_i)=0\), that second moment equals the conditional variance. In practice, the test uses estimated residuals \(e_i\), rather than unobserved errors \(u_i\).

Hypotheses: \(H_0\): the non-intercept coefficients in the population auxiliary regression of \(u_i^2\) on the listed terms are jointly zero. With a correctly specified conditional mean, constant conditional variance implies this null. \(H_a\): at least one of those coefficients is nonzero, indicating a nonzero projection of the conditional variance onto the included terms. Zero coefficients do not in general imply constant variance; that interpretation requires an additional assumption, such as the conditional variance being represented by the auxiliary terms.

Statistic, Calibration, and Conditions

Let \(R^2_{\text{aux}}\) be the usual centered coefficient of determination from the auxiliary regression, which includes an intercept. The conventional White statistic is \(nR^2_{\text{aux}}\). Under \(H_0\) and suitable regularity conditions, its large-sample reference distribution is chi-square with \(q\) degrees of freedom. The p-value is the probability, under that reference distribution, of a statistic at least as large as the observed one.

The chi-square calibration needs more than constant conditional variance and finite moments. One sufficient set of conditions is that the original errors are independent with a common distribution, independent of the predictors (or with a fixed design), have mean zero, common positive variance, and finite fourth moment. In addition, the auxiliary model must have fixed effective dimension as \(n\) grows, its non-intercept columns must have a nonsingular limiting design after suitable scaling, and no observation may dominate the design (a standard condition is that the maximum leverage tends to zero). These conditions make the squared errors have the common variance structure needed for the usual unstudentized \(nR^2_{\text{aux}}\) calibration, while the use of fitted residuals has a negligible first-order effect.

If errors are independent but their conditional fourth moments vary with the predictors, constant conditional variance alone does not guarantee the usual chi-square limit. The squared-error auxiliary regression can then have nonconstant error variance even under the variance null, affecting the calibration. In that situation, do not automatically report the conventional \(nR^2_{\text{aux}}\) chi-square p-value as valid; a covariance-robust joint test of the auxiliary slopes is an alternative when its own conditions are appropriate.

Why the \(nR^2\) Statistic Has a Chi-Square Reference

The connection to a joint test can be seen by considering the auxiliary regression under the null. After centering the non-intercept columns, suppose there are \(q\) independent terms. Let \(TSS\) be the total sum of squares of the auxiliary response \(e_i^2\), and \(ESS\) the part explained by those columns. Then \(R^2_{\text{aux}}=ESS/TSS\). In a large sample under the conditions just stated, the auxiliary residual variance estimates the common variance of the squared errors. The joint score-type statistic for the \(q\) slopes is therefore approximately the explained sum of squares divided by that variance estimate.

Since \(TSS/n\) estimates the same variance, this ratio is asymptotically equivalent to \(nR^2_{\text{aux}}\). Under the null, a standardized \(q\)-dimensional score has an approximately chi-square quadratic form with \(q\) degrees of freedom. This explains both the statistic and the need for appropriate variance conditions on the auxiliary errors: if their variance changes with the predictors, the ordinary quadratic form need not have that chi-square limit.

Worked Example: Two Predictors and Five Auxiliary Terms

In a hypothetical regression of travel time on distance and number of stops, there are \(n=80\) observations. The original model includes an intercept. Suppose the auxiliary regression of squared residuals on distance, stops, their squares, and their cross-product has \(R^2_{\text{aux}}=0.160\), with no redundant columns. Assume for this example that the original errors and design meet the regularity conditions for the conventional calibration. Test at \(\alpha=0.05\).

There are \(p=2\) predictors, so the auxiliary terms are distance, stops, distance squared, stops squared, and distance times stops. Thus \(q=2(2+3)/2=5\).

The statistic is \(nR^2_{\text{aux}}=80(0.160)=12.8\). Under \(H_0\), compare this with a chi-square distribution with 5 degrees of freedom. The upper-tail p-value is approximately \(0.025\).

Because \(0.025<0.05\), reject \(H_0\). Under the stated calibration conditions, this is evidence that the squared residuals are associated with one or more of the included variance terms, consistent with nonconstant error variance. It does not identify which term is responsible; the test is joint.

Flexibility Has a Cost

Adding squares and cross-products lets the test respond to curved or interacting variance patterns, not just a simple linear association with the original predictors. But each independent term increases \(q\). In a modest sample, fitting many terms can make the auxiliary regression noisy and use up information. A real variance pattern may then produce only a small \(R^2_{\text{aux}}\), or the chi-square reference distribution may be a poor small-sample approximation. A non-significant result is not proof of constant variance.

Redundancy also matters. If a predictor is an indicator \(D\) taking only 0 or 1, then \(D^2=D\), so its square duplicates its original column. Such a duplicate must not be counted as an additional degree of freedom. More generally, the effective \(q\) is determined by the independent columns in the auxiliary regression, not by blindly applying the formula for a fully independent set of terms.

Worked Example: A Larger Auxiliary Regression

A hypothetical model has three predictors: study hours, class attendance, and a baseline score. For \(n=60\) observations, the full White auxiliary regression includes all three predictors, all three squares, and all three pairwise products. Suppose it has \(R^2_{\text{aux}}=0.090\), its nine non-intercept columns are independent, and the calibration conditions are met.

The number of terms is \(q=3+3+\binom{3}{2}=9\). The test statistic is \(nR^2_{\text{aux}}=60(0.090)=5.40\). Its reference distribution is chi-square with 9 degrees of freedom, giving an upper-tail p-value of approximately \(0.80\).

At \(\alpha=0.05\), this is not evidence against constant variance. It does not show that the variance is constant: with nine terms and only 60 observations, the broad test may have limited power against some alternatives. A targeted variance pattern can sometimes be easier to detect with fewer, substantively justified terms, but choosing terms after inspecting the data can complicate the interpretation of the test.

Worked Example: Adjusting the Degrees of Freedom for Redundancy

Consider a hypothetical model with predictors \(X\) and a binary indicator \(D\), where \(D\) is either 0 or 1. Suppose \(n=100\), and the auxiliary regression has \(R^2_{\text{aux}}=0.070\). The nominal terms are \(X,D,X^2,D^2,XD\), but \(D^2=D\), so one column is duplicated. Assume the remaining four non-intercept columns are independent and that the usual calibration conditions hold.

The effective number of terms is \(q=4\), not 5. The statistic is \(nR^2_{\text{aux}}=100(0.070)=7.00\). For a chi-square distribution with 4 degrees of freedom, the upper-tail probability is approximately \(0.136\).

At \(\alpha=0.05\), the result is not statistically significant. Using 5 degrees of freedom just because five terms were written down would give the wrong reference distribution: the duplicated \(D^2\) column contributes no independent information.

Using the Result Responsibly

The White test is useful when a variance pattern is not known in advance and a broader set of possible relationships is desired. Its result is evidence about the variance structure of the specified mean model, not a substitute for inspecting residuals. In particular, a misspecified conditional mean can leave systematic patterns in residuals that appear in squared residuals as well. The test alone cannot distinguish such mean misspecification from genuine changing variance.

A sensible interpretation reports the auxiliary terms, effective degrees of freedom, statistic, reference distribution, p-value, and significance level, together with the calibration assumptions. It also describes the conclusion as evidence for or against the constant-variance model, rather than as proof. A large p-value can reflect limited power, especially when many terms are fitted relative to the sample size.

Common Mistakes

  • Using only the original predictors. The White auxiliary regression also includes their squares and pairwise cross-products. Leaving those out changes the test.
  • Counting terms without checking rank. Duplicated or linearly dependent columns do not each add a degree of freedom; use the effective number of independent non-intercept columns.
  • Assuming constant variance alone validates the usual p-value. The ordinary \(nR^2_{\text{aux}}\) calibration also needs suitable conditions on the squared errors, such as a common error distribution with finite fourth moment and regular design conditions.
  • Calling a non-significant result proof of homoskedasticity. The test may lack power, particularly when the auxiliary regression has many terms for the available sample size.
  • Treating a rejection as a diagnosis of the cause. Rejection indicates an association represented by the auxiliary terms; it does not say which feature caused the pattern or rule out a misspecified mean.
Key takeaway: The White test regresses squared residuals on original predictors, squares, and pairwise cross-products, then evaluates \(nR^2_{\text{aux}}\) using the effective number of independent auxiliary terms. Its conventional chi-square p-value requires appropriate fourth-moment and design conditions, and its flexibility can reduce power in modest samples.

Check Your Understanding

Answer each question using the definitions and conditions from this tutorial.

  1. For a model with four predictors and no redundant auxiliary terms, how many non-intercept terms are in the full White auxiliary regression?
  2. Why does a binary predictor’s square not necessarily add a degree of freedom to the auxiliary regression?
  3. What does a small White-test p-value indicate, and what does it not identify?
  4. Why is constant conditional variance by itself not enough to guarantee the conventional \(nR^2_{\text{aux}}\) chi-square calibration?
  5. Give one reason a White test might fail to detect a real variance pattern in a modest sample.