Tutorials › Exam SRM - Statistics for Risk Modeling › White Testing for General Heteroscedasticity

Exam SRM · Regression Diagnostics · Tutorial 94 of 926

White Testing for General Heteroscedasticity

Construct and interpret White tests using fitted values or predictor terms, while checking the reference distribution and degrees of freedom.

Intermediate 10 min read

What You'll Learn

  • State the null hypothesis and broad alternative tested by the White procedure
  • Build auxiliary regressions from fitted values or linear, squared, and interaction terms
  • Count the test degrees of freedom from the independent nonconstant auxiliary terms
  • Calculate and interpret the conventional n times auxiliary R-squared statistic
  • Identify when conditional fourth moments make the conventional chi-square calibration unreliable
  • Use a robust Wald test when the conventional calibration is not justified

Why Use the White Test?

A regression can have a correctly specified conditional mean and still have errors whose variance changes with the predictors. A residual plot may reveal a simple pattern, such as a steadily widening band, but variance can also change in a more complicated way. The White test looks for systematic relationships between squared residuals and a selected set of functions of the predictors. Its flexibility is useful, but it also makes the choice and number of auxiliary terms important.

The test assesses the constant-variance assumption. It does not establish that the regression mean is correctly specified, that errors are independent, or that the errors are normally distributed. A rejection signals evidence that the squared residuals are associated with the chosen auxiliary regressors; it does not, by itself, identify the cause of that association.

Definition: In a fitted regression, let \(e_i=y_i-\hat{y}_i\) be the ordinary residual for observation \(i\). The White test regresses the squared residuals \(e_i^2\) on an intercept and selected functions of the original predictors, or on selected functions of the fitted values. It tests whether the slopes on those auxiliary regressors are jointly zero. The usual test statistic is \(nR^2_{\text{aux}}\), where \(R^2_{\text{aux}}\) is the coefficient of determination from that auxiliary regression.

Constructing the Auxiliary Regression

Suppose the original model has \(p\) non-intercept predictors. A full quadratic auxiliary regression includes each predictor linearly, each predictor squared, and every pairwise product of two different predictors. The intercept is included, but it is not counted as a tested slope. If all the nonconstant terms are linearly independent, their number is

$$ q=p+p+\binom{p}{2}=\frac{p(p+3)}{2}. $$

For example, with predictors \(x_1\) and \(x_2\), the auxiliary regressors are \(x_1,\ x_2,\ x_1^2,\ x_2^2,\) and \(x_1x_2\), so \(q=5\). The test uses the rank of the nonconstant auxiliary terms, not simply a count of the terms written down. If a term is constant or is an exact linear combination of other terms in the observed data, it does not add an independent degree of freedom.

A common alternative is to use fitted values. Regressing \(e_i^2\) on an intercept and \(\hat{y}_i\) tests association with the fitted value through one slope. Including both \(\hat{y}_i\) and \(\hat{y}_i^2\) tests a two-term fitted-value alternative when both terms are independent. This is a more restricted choice than the full predictor-based quadratic regression: different predictor combinations can have similar fitted values but different variances.

Null and alternative: The null hypothesis is that the conditional error variance is constant, \( \operatorname{Var}(\varepsilon_i\mid X_i)=\sigma^2 \), for all predictor settings in the model. The auxiliary-regression alternative is that the conditional mean of squared errors varies with at least one included auxiliary term. A finite auxiliary basis can detect only departures represented by that basis; failure to reject does not prove constant variance.

The Conventional Statistic and Its Calibration

After fitting the original regression, square each residual and fit the auxiliary regression with an intercept. Record its \(R^2_{\text{aux}}\), then calculate \(nR^2_{\text{aux}}\). Under the conventional calibration, compare this statistic with a chi-square distribution having \(q\) degrees of freedom, where \(q\) is the number of independent nonconstant auxiliary regressors being tested. At significance level \(\alpha\), reject when the statistic exceeds the upper-tail critical value \(\chi^2_{q,1-\alpha}\).

The chi-square reference for the conventional \(nR^2_{\text{aux}}\) test needs conditions; it is not guaranteed just by independence of observations and finite fourth moments. One standard sufficient setting is a correctly specified conditional-mean regression with errors that are identically distributed and independent of the predictors under the null, with mean zero, constant variance, finite fourth moment, and the usual regularity conditions for the design and fixed-dimensional auxiliary regression. Under those conditions, the squared-error score has a common variance factor, and the conventional statistic has the stated asymptotic chi-square distribution.

If the conditional variance is constant but the conditional fourth moment varies with the predictors, the variance of the squared-error score may vary too. The conventional \(nR^2_{\text{aux}}\) statistic then need not have a chi-square distribution with \(q\) degrees of freedom. In that situation, use a properly studentized joint test with a heteroskedasticity-robust covariance estimate for the auxiliary-regression slopes, subject to the moment and regularity conditions needed for that estimate.

Why the Conventional Result Holds Under Its Conditions

The key idea is that the auxiliary regression measures association between the squared errors and the chosen terms. For this justification, write \(z_i\) for the vector of the \(q\) nonconstant auxiliary regressors, centered so that its sample mean is zero. Under the null, if the original errors are independent and identically distributed with variance \(\sigma^2\), then \(E[\varepsilon_i^2]=\sigma^2\) and \(\operatorname{Var}(\varepsilon_i^2)=\tau^2\), the same finite constant for every observation. The auxiliary slope score is approximately the sum of \(z_i(\varepsilon_i^2-\sigma^2)\). Its covariance is approximately \(\tau^2\sum_i z_i z_i'\): the common \(\tau^2\) factor is what permits the ordinary, unstudentized calibration.

The auxiliary regression's explained sum of squares is the corresponding quadratic measure of this score. Dividing by the total sum of squares of the squared errors, which is approximately \(n\tau^2\) under the stated conditions, gives the large-sample relationship between \(nR^2_{\text{aux}}\) and the squared, standardized score. The joint standardized score has an asymptotic chi-square distribution with \(q\) degrees of freedom, yielding the conventional result. This argument also shows the limitation: if the conditional variance of \(\varepsilon_i^2\) changes with the predictors, its covariance is generally not a common scalar times \(\sum_i z_i z_i'\). A robust studentization is then needed instead.

Worked Example: A One-Predictor Quadratic White Test

A hypothetical insurer models a continuous claim-cost measure using one predictor, policy tenure \(x\). For \(n=40\) policies, the full quadratic auxiliary regression of squared residuals on an intercept, \(x\), and \(x^2\) has \(R^2_{\text{aux}}=0.18\). Use the conventional test at the 5% level, assuming its calibration conditions hold.

Method and degrees of freedom. There is one original predictor. The auxiliary regression has the two nonconstant terms \(x\) and \(x^2\), so \(q=2\), provided the observed values make the terms independent.

Calculate the statistic.

$$ nR^2_{\text{aux}}=40(0.18)=7.20. $$

Decision. The 5% upper-tail critical value for a chi-square distribution with 2 degrees of freedom is 5.991. Since \(7.20>5.991\), reject the constant-variance null at the 5% level.

Check and trap avoided. The intercept is not a tested slope, so it is not counted in \(q\). The result is evidence of association with the selected tenure terms, not proof that tenure alone causes the variance change.

Worked Example: Counting Terms in a Two-Predictor Test

A hypothetical analyst models the annual repair cost of a fleet vehicle using vehicle age \(x_1\) and annual mileage \(x_2\). The full quadratic auxiliary regression has \(n=50\) and \(R^2_{\text{aux}}=0.23\). Apply the conventional 5% test, assuming the conventional calibration conditions hold.

Method and degrees of freedom. The auxiliary regressors are \(x_1,\ x_2,\ x_1^2,\ x_2^2,\) and \(x_1x_2\). Thus \(q=5\); the intercept is excluded.

Calculate the statistic.

$$ nR^2_{\text{aux}}=50(0.23)=11.50. $$

Decision. The 5% upper-tail critical value for 5 degrees of freedom is 11.070. Because \(11.50>11.070\), reject the null at the 5% level.

Check and trap avoided. Counting the intercept as a sixth tested term would give the wrong reference distribution. The test has five slopes, not six. Also, including only \(x_1\) and \(x_2\) would omit the squared and interaction terms and would not be the full quadratic version of this test.

Worked Example: Robustly Testing Fitted-Value Terms

For a hypothetical portfolio model, an analyst regresses squared residuals on an intercept, centered fitted values, and their squares. There are \(n=70\) observations. Because the error distribution may have predictor-dependent fourth moments, the analyst uses a robust covariance estimate for the two auxiliary slopes rather than the conventional \(nR^2_{\text{aux}}\) calibration. The estimated slope vector is \(\hat{b}=(0.60,0.40)'\), and its robust covariance estimate is

$$ \widehat{\operatorname{Cov}}(\hat{b})= \begin{pmatrix} 0.09 & 0.018\\ 0.018 & 0.04 \end{pmatrix}. $$

Test the two slopes jointly at the 5% level.

Method and degrees of freedom. The null is that both slopes are zero. The robust Wald statistic is \(W=\hat{b}'\widehat{\operatorname{Cov}}(\hat{b})^{-1}\hat{b}\), compared asymptotically with a chi-square distribution having 2 degrees of freedom.

Calculate the statistic. The covariance determinant is \(0.09(0.04)-(0.018)^2=0.0036-0.000324=0.003276\). Therefore its inverse is

$$ \frac{1}{0.003276} \begin{pmatrix} 0.04 & -0.018\\ -0.018 & 0.09 \end{pmatrix}. $$

The numerator of the resulting quadratic form is \(0.04(0.60)^2+2(-0.018)(0.60)(0.40)+0.09(0.40)^2 =0.0144-0.00864+0.0144=0.02016\). Thus \(W=0.02016/0.003276\approx6.154\).

Decision and check. The 5% critical value with 2 degrees of freedom is 5.991, and \(6.154>5.991\), so reject the joint zero-slope null. The covariance matrix's off-diagonal terms matter; treating the two slope estimates as independent would not reproduce this Wald statistic. The result is an asymptotic robust joint test, not the conventional \(nR^2_{\text{aux}}\) test.

Interpreting Results and Avoiding Common Errors

The conventional test is convenient when its distributional conditions are defensible and the auxiliary regression has a manageable number of terms. A full quadratic expansion can become large quickly: with \(p=4\) predictors it has \(q=14\) nonconstant terms. A large \(q\) can reduce power in a limited sample, make auxiliary columns nearly dependent, and leave little residual information. Use a prespecified basis appropriate to the problem, check that its terms are estimable, and report the basis and degrees of freedom used.

A frequent exam error is to assume that constant conditional variance alone guarantees the usual chi-square calibration. Constant variance ensures that the auxiliary slopes have zero population targets under suitable mean assumptions, but it does not force the conditional variance of the squared-error scores to be constant. If that score variance varies, \(nR^2_{\text{aux}}\) is not automatically chi-square. The robust Wald approach studentizes the joint slope departures using their estimated covariance; it is a distinct calibration, not a relabeling of \(nR^2_{\text{aux}}\).

Other common errors include counting the auxiliary intercept as a degree of freedom, using the number of original predictors instead of the number of independent tested auxiliary terms, and interpreting nonrejection as proof of homoscedasticity. The fitted-value version is also narrower than a full predictor-based quadratic test. A test can miss variance patterns outside its chosen basis, so interpret the conclusion as evidence about the specified auxiliary terms.

Key takeaway: Specify the squared-residual auxiliary regression first, count its independent nonconstant terms, and then select a calibration justified by the assumptions. Use \(nR^2_{\text{aux}}\) with \(q\) chi-square degrees of freedom under conditions that justify its conventional distribution; when conditional fourth-moment variation undermines that calibration, use a properly studentized robust joint test.

Check Your Understanding

For each problem, identify the auxiliary terms and degrees of freedom before making the decision.

  1. A one-predictor model uses an auxiliary regression on the predictor and its square. With \(n=36\) and \(R^2_{\text{aux}}=0.10\), test at 5% using the conventional calibration. (Answer: \(q=2\), statistic \(=3.60\); do not reject because \(3.60<5.991\).)
  2. A model has three predictors and uses the full quadratic auxiliary basis. With \(n=80\) and \(R^2_{\text{aux}}=0.16\), test at 5% using the conventional calibration. (Answer: \(q=9\), statistic \(=12.80\); do not reject because \(12.80<16.919\).)
  3. A two-predictor model uses all linear, squared, and pairwise interaction terms. With \(n=40\) and \(R^2_{\text{aux}}=0.30\), test at 5% using the conventional calibration. (Answer: \(q=5\), statistic \(=12.00\); reject because \(12.00>11.070\).)
  4. A fitted-value auxiliary regression includes the fitted value and its square. A robust joint Wald statistic is 10.25. What is the 5% decision? (Answer: \(q=2\); reject because \(10.25>5.991\).)
  5. Suppose the conditional error variance is constant, observations are independent, but the conditional fourth moment varies with predictors. Is the conventional \(nR^2_{\text{aux}}\) chi-square reference justified solely by those facts? (Answer: No; use a properly studentized robust joint test, with suitable regularity and moment conditions.)
Clinical Biostats