White Test

White Test

Overview

Definition

The White Test is a general statistical test used to detect heteroscedasticity in a regression model. Unlike the Breusch-Pagan test, it does not assume any specific form of heteroscedasticity, making it more robust but also less powerful in specific cases.


1. Procedure

  1. Obtain OLS residuals ui.
  2. Run auxiliary regression of squared residuals ui2 on:
    • All original predictors (X1Xp).
    • The squared terms (X12Xp2).
    • The cross-products (X1X2,).
  3. Compute LM=nR2 from this auxiliary regression.

2. Comparison: White vs. Breusch-Pagan

Feature Breusch-Pagan White Test
Assumed Form Linear function of X General (Quadratic/Interaction)
Sensitivity Linear Heteroscedasticity Non-linear Heteroscedasticity and Specification Error
Degrees of Freedom Lower (p) High (p+p(p+1)/2)
Power Higher (if linear) Lower (due to high df)

3. Python Implementation Example

from statsmodels.stats.diagnostic import het_white

lm, lm_p, f, f_p = het_white(model.resid, model.model.exog)
print(f"White Test p-value: {lm_p:.4f}")