AI Glossary / Statistics and probability / Advanced
White test
Definition
The White test is a regression diagnostic for heteroskedasticity: variation in error variance across observations. Its familiar Lagrange multiplier version examines whether squared fitted residuals are related to explanatory variables, their squares and their cross-products. A small p-value provides evidence against constant error variance under the test's assumptions.
What it means
A regression can predict average outcomes reasonably while making errors of very different sizes for different inputs. For example, mistakes in estimated delivery time may be more variable for long routes than short ones. Assuming a common variance can then make conventional uncertainty calculations misleading.
The White test investigates this aspect of model adequacy. It does not measure overall prediction quality, identify the correct replacement model or prove that the regression coefficients represent causal effects. Its result needs interpretation alongside the mean model, data collection process and residual plots.
How it works
Fit the original regression and obtain residuals. Regress their squared values on an intercept and a chosen set containing the original predictors, squares and pairwise products. This second fit is called an auxiliary regression. For its coefficient of determination R² and sample size n, calculate LM = nR².
Under the null and suitable large-sample regularity conditions, compare LM with a chi-square distribution. Degrees of freedom equal the number of linearly independent nonconstant auxiliary terms. Count the design's effective rank, not simply the number of columns generated. An auxiliary F statistic is another reported variant; it is not identical to the original LM statistic.
Three practical examples
1. Delivery forecasting: An operations analyst tests whether residual variability changes with route distance and workload. The result informs review of uncertainty estimates rather than automatically changing the predicted average delivery time.
2. Demand modeling: A retailer suspects that large stores have more variable forecast errors. A White test complements plots before the team chooses a variance model or a suitable robust covariance estimate.
3. AI benchmarking: A researcher models processing time using input length and configuration settings. Testing squared residuals helps investigate whether one common noise level is a reasonable description of the observed runs.
Think of it this way
Think of drawing a road through a cloud of points. The regression describes the road's center, while the test asks whether the cloud's width changes with the surroundings. A wider cloud in some places concerns uncertainty around the road. It does not, by itself, reveal whether the road has been drawn along the right route.
Worked example
Consider an original teaching scenario with 100 independent observations and an original regression containing an intercept and one continuous predictor x. The auxiliary regression uses 1, x and x². Assume these three columns are linearly independent and its fitted R² is 0.12.
The LM statistic is 100 × 0.12 = 12. There are two nonconstant independent auxiliary terms, so the reference distribution has two degrees of freedom. For chi-square with two degrees of freedom, the upper-tail probability at 12 is exp(−12/2) = exp(−6), approximately 0.00248.
At a prespecified 5% significance level, this rejects the constant-variance null under the stated asymptotic framework. The example supplies an illustrative auxiliary-fit summary rather than a real dataset. Its 0.12 is the R² for squared residuals, not the prediction R² of the original model. The p-value is also not the probability that constant variance is true.
Illustrative case study
In this fictional case, Vale Deliveries uses a linear model to plan staffing. Analysts observe wider residuals on long routes and obtain a small White-test p-value. They first inspect route definitions and the mean model, finding that some remote destinations were grouped too broadly.
After revising the analysis, they compare conventional and heteroskedasticity-robust coefficient uncertainty and separately evaluate prediction intervals on held-out deliveries. The team records both investigations. It does not advertise the original test as proof that a particular variance formula is correct or that its operational forecasts have become accurate.
Common misconceptions and mistakes
Do not confuse the White test with White's heteroskedasticity-consistent covariance estimator. One is a diagnostic test; the other is a way to estimate coefficient uncertainty under appropriate conditions. Robust standard errors do not repair omitted predictors, biased sampling or an incorrect causal interpretation.
A rejection can reflect problems with the conditional mean specification as well as changing variance. Non-rejection does not demonstrate homoskedasticity, especially with limited data. Expanding many predictors into squares and interactions can exhaust degrees of freedom. Serial dependence, clustering and other violations may require methods designed for those structures rather than the elementary independent-observation reference calculation.
Business use
The test can support model review when regression outputs guide budgets, capacity planning or performance comparisons. Its practical purpose is to challenge uncertainty assumptions before decisions rely on excessively precise estimates.
An actionable report includes the original model, auxiliary terms, sample size, effective degrees of freedom and diagnostic findings. Follow with an explanation of what changed in the analysis and why. Do not turn a significance threshold into a universal rule for deploying a forecasting model; business loss and predictive calibration require their own evaluation.
People also ask
Does heteroskedasticity always bias ordinary least-squares coefficients?
No. Under appropriate conditional-mean assumptions, coefficients can remain unbiased or consistent while conventional standard errors are inappropriate.
Does the test identify the exact variance function?
No. It detects relationships represented by the auxiliary terms without selecting a unique explanation.
Should a large p-value end model checking?
No. Other forms of misspecification and limited power remain possible.
Check your understanding
Which R² enters nR²?
Answer: The one from the auxiliary regression of squared residuals.
With an intercept, x and x² all independent, how many reference degrees of freedom are used?
Answer: Two, excluding the intercept.
Does rejection prove the original predictions are biased?
Answer: No. Changing error variance and biased conditional-mean predictions are different issues.
Related terms
- Residual
- Heteroskedasticity
- homoskedasticity
- auxiliary regression
- Lagrange multiplier test
- robust standard errors
- model specification
- chi-square distribution
Learn next
Next, compare residual-versus-fitted plots with the test output. Study heteroskedasticity-consistent covariance estimation, weighted least squares and methods for dependent observations. Then assess whether any proposed revision improves the particular uncertainty or prediction claim used in the business decision.
More in Statistics and probability
- Western Electric rules - Western Electric rules are a set of pattern checks used with statistical process control charts to flag possible changes in a process.
- Whipple's index - Whipple's index is a demographic measure of concentration in reported ages ending in selected digits, conventionally zero and five.
- Whiskers - Whiskers are the lines extending outward from a box in a boxplot.
- Whittle likelihood - The Whittle likelihood is a frequency-domain approximation used to estimate parameters of stationary time-series models.
- Wide model - A wide model is a linear model with many input features, often represented sparsely, that connect directly to an output score.
- Widely applicable information criterion - The widely applicable information criterion, or WAIC, estimates a Bayesian model's out-of-sample predictive performance using pointwise likelihood values...
Sources
The statsmodels documentation describes the White LM test and its auxiliary-regression inputs: https://www.statsmodels.org/stable/generated/statsmodels.stats.diagnostic.het_white.html
The corresponding implementation shows squared-residual regression, nR² and rank-based degrees of freedom: https://www.statsmodels.org/stable/_modules/statsmodels/stats/diagnostic.html#het_white
The worked numbers and Vale Deliveries case are original illustrations, not empirical evidence from these sources.
Previous: White-patch assumption Next: Whitelist