White Test Calculator
Inputs
- Inputs: 120 observations, auxiliary regression R-squared 0.18, 9 auxiliary regressors (levels, squares and cross-products, excluding the constant).
- LM = n x R^2 = 120 x 0.18 = 21.60.
- Under the null of homoskedasticity LM follows a chi-square distribution with 9 degrees of freedom, giving p = 0.0102.
- The auxiliary regression explains too much of the squared residuals - heteroskedasticity is present at the 5% level.
White's test is the general-purpose check for heteroskedasticity: regress the squared residuals on everything the original regressors can offer - levels, squares and cross-products - and ask whether any of it predicts the size of the errors. This calculator takes the sample size, the auxiliary regression's R-squared and the number of auxiliary regressors, and returns the LM statistic nR^2 with its chi-square p-value. No assumption about the form of the heteroskedasticity is needed, which is both the test's power and its interpretive trap.
Worked examples
Heteroskedasticity detected
(120 · 0.18 · 9)
| White LM statistic | 21.60 |
| p-value | 0.0102 |
| Auxiliary degrees of freedom | 9 |
| Auxiliary R-squared | 18.00% |
Quiet auxiliary regression
(80 · 0.06 · 5)
| White LM statistic | 4.80 |
| p-value | 0.4408 |
| Auxiliary degrees of freedom | 5 |
| Auxiliary R-squared | 6.00% |
Large sample, borderline
(250 · 0.09 · 14)
| White LM statistic | 22.50 |
| p-value | 0.0689 |
| Auxiliary degrees of freedom | 14 |
| Auxiliary R-squared | 9.00% |
What the auxiliary regression does
If the error variance is constant, the squared residuals are just noise around a constant, and nothing built from the regressors should forecast them. White (1980) turned that observation into a regression: the auxiliary regression's R-squared measures how much of the squared residuals' variation the regressors can explain, and n times that R-squared is chi-square under the null, with degrees of freedom equal to the number of auxiliary regressors excluding the constant.
The auxiliary regression is deliberately generous. It includes each regressor, its square and every pairwise cross-product, because heteroskedasticity in practice hides in interactions - variance that grows with a product of two variables, or with the square of one. The generosity is also the cost: with many regressors the cross-products multiply, degrees of freedom burn quickly, and the test can lose power or even become infeasible in small samples.
- Statistic: LM = n x R^2 from the auxiliary regression
- Null distribution: chi-square with k degrees of freedom
- Auxiliary set: levels, squares and cross-products of the regressors
- Detects general heteroskedasticity without specifying its form
Counting degrees of freedom
The degrees of freedom are simply the count of auxiliary regressors, constant excluded - but the count is where implementations go wrong. With two original regressors the auxiliary set has five members (two levels, two squares, one cross-product); with five regressors it has twenty. Software that reports the test with the original regressor count has run a different, smaller test - often the fitted-value variant - and the two should not be confused when comparing results across packages.
In the first worked example, 120 observations with an auxiliary R-squared of 0.18 over 9 auxiliary regressors give LM = 21.60 and p = 0.0102: homoskedasticity is rejected. The second example's R-squared of 0.06 over 80 observations gives 4.80 on 5 degrees of freedom, p = 0.4408 - nothing there. The third shows the large-sample effect: a modest R-squared of 0.09 over 250 observations still produces 22.50 on 14 degrees of freedom, though at p = 0.0689 it falls just short of significance at the 5% level.
| Example | n | Auxiliary R^2 | df | LM | p |
|---|---|---|---|---|---|
| 1 | 120 | 0.18 | 9 | 21.60 | 0.0102 |
| 2 | 80 | 0.06 | 5 | 4.80 | 0.4408 |
| 3 | 250 | 0.09 | 14 | 22.50 | 0.0689 |
Worked examples
Example 1: Observations (n) 120; Auxiliary regression R-squared 0.18; Auxiliary regressors (excl. constant) 9. White LM statistic = 21.60. Supporting values: p-value 0.0102; Auxiliary degrees of freedom 9; Auxiliary R-squared 18.00%. Inputs: 120 observations, auxiliary regression R-squared 0.18, 9 auxiliary regressors (levels, squares and cross-products, excluding the constant). LM = n x R^2 = 120 x 0.18 = 21.60. Under the null of homoskedasticity LM follows a chi-square distribution with 9 degrees of freedom, giving p = 0.0102. The auxiliary regression explains too much of the squared residuals - heteroskedasticity is present at the 5% level.
Example 2: Observations (n) 80; Auxiliary regression R-squared 0.06; Auxiliary regressors (excl. constant) 5. White LM statistic = 4.80. Supporting values: p-value 0.4408; Auxiliary degrees of freedom 5; Auxiliary R-squared 6.00%. Inputs: 80 observations, auxiliary regression R-squared 0.06, 5 auxiliary regressors (levels, squares and cross-products, excluding the constant). LM = n x R^2 = 80 x 0.06 = 4.80. Under the null of homoskedasticity LM follows a chi-square distribution with 5 degrees of freedom, giving p = 0.4408. The squared residuals carry no significant pattern - homoskedasticity is not rejected at the 5% level.
Example 3: Observations (n) 250; Auxiliary regression R-squared 0.09; Auxiliary regressors (excl. constant) 14. White LM statistic = 22.50. Supporting values: p-value 0.0689; Auxiliary degrees of freedom 14; Auxiliary R-squared 9.00%. Inputs: 250 observations, auxiliary regression R-squared 0.09, 14 auxiliary regressors (levels, squares and cross-products, excluding the constant). LM = n x R^2 = 250 x 0.09 = 22.50. Under the null of homoskedasticity LM follows a chi-square distribution with 14 degrees of freedom, giving p = 0.0689. The squared residuals carry no significant pattern - homoskedasticity is not rejected at the 5% level.
White vs Breusch-Pagan
The Breusch-Pagan test is the White test's narrower sibling: its auxiliary regression uses only the levels of the regressors (or the fitted values), betting that variance moves with the regressors themselves. When that bet is right, Breusch-Pagan is the more powerful test, spending few degrees of freedom. When variance depends on a square or an interaction, Breusch-Pagan can miss it entirely while White catches it - at the price of the cross-product explosion.
A sensible workflow uses both: Breusch-Pagan as the sharp test, White as the sweep. A White rejection with a quiet Breusch-Pagan points at squares or interactions; rejection by both points at the levels. And a White rejection can also be the smoke of a different fire - a misspecified functional form makes squared residuals predictable too - so a rejection is the start of a diagnosis, not its conclusion.
What to do after a rejection
Heteroskedasticity does not bias OLS coefficients; it invalidates their standard errors. The modern default response is therefore not to remodel but to report heteroskedasticity-consistent standard errors - White's own other contribution in the same 1980 paper - and it is worth pausing on the fact that the test and the remedy share an author and a publication year. If the heteroskedasticity has a known structure, weighted least squares buys efficiency, but a guessed structure can do worse than robust standard errors.
What a rejection should never trigger is deleting observations until the test passes. Large squared residuals are the data's testimony about where the model strains; winsorising them away manufactures a false calm and biases every subsequent number. Investigate the pattern the auxiliary regression found - it is printed in its coefficients - and let that pattern argue for a respecification on economic grounds.
Practical notes
Feed the calculator the R-squared of the auxiliary regression of squared residuals - not of the original regression, the single most common input error. The auxiliary regression must include a constant (whose exclusion from the degrees of freedom the calculator already handles), and the sample size is the number of observations in that regression, which can differ from the original if the auxiliary variables lose observations to missing values.
Finally, treat borderline outcomes honestly. The third example's p = 0.0689 is neither a pass nor a discovery; it is weak evidence, and with robust standard errors reported anyway - as they should be in any modern workflow - the practical stakes of the borderline are small. The test earns its keep at the extremes, like the first example's 0.0102, where the variance pattern is unmistakable.
The fitted-value variant deserves a precise statement, because it is the version much software quietly runs. Regressing the squared residuals on the fitted value and its square spends only 2 degrees of freedom and tests whether variance varies with the level of the prediction - a powerful test against the commonest alternative, blind to patterns the fitted value does not summarise. When a package reports a White test with 2 degrees of freedom it has run this variant, and comparing its verdict with the full test's - 9 degrees of freedom in the first worked example - is comparing two different questions, not two implementations of one.
In panel and clustered data the same logic scales up: the auxiliary regression idea survives, but the chi-square reference gives way to cluster-robust Wald statistics, because residuals within a cluster are not independent witnesses. The enduring contribution of White's 1980 paper is less the specific statistic than the reframing - heteroskedasticity as a regression question about squared residuals, answerable with the same machinery that fitted the model. Every modern descendant, including the robust standard errors that made the test itself optional, lives inside that reframing.
A historical footnote completes the picture of the test's standing. White's 1980 paper is among the most cited in economics not for the test but for the covariance estimator in its title, and the test is best understood as the estimator's diagnostic companion: the same squared-residual machinery that detects the problem supplies the corrected standard errors that make the detection, in many workflows, unnecessary to act on. That the author published the disease and the cure in one paper is a neatness the field has enjoyed ever since - and a reminder that the test's modern role is descriptive: it tells you where the variance lives, which the corrected errors alone never will.
FAQs
What LM statistic does the first example give?
LM = 120 x 0.18 = 21.60, on 9 degrees of freedom - the sample size times the auxiliary R-squared.
What is its p-value?
The p-value is 0.0102, so homoskedasticity is rejected at the 5% level: the squared residuals carry a real pattern.
What statistic does the quiet second example give?
It gives 4.80 on 5 degrees of freedom, p = 0.4408 - no evidence against constant variance.
What statistic does the third example give?
It gives 22.50 on 14 degrees of freedom; with 250 observations even an R-squared of 0.09 nearly reaches significance, at p = 0.0689.
What auxiliary R-squared does the first example use?
It uses 0.18 - the share of squared-residual variation the levels, squares and cross-products explain.
How many auxiliary regressors does the first example have?
It has 9, excluding the constant; that count is the chi-square degrees of freedom.