statsmodels.stats.diagnostic.spec_white

statsmodels.stats.diagnostic.spec_white(resid, exog)[source]

White’s Two-Moment Specification Test

Parameters:
residarray_like

OLS residuals.

exogarray_like

OLS design matrix.

Returns:
statfloat

The test statistic.

pvalfloat

A chi-square p-value for test statistic.

dofint

The degrees of freedom.

See also

het_white

White’s test for heteroskedasticity.

Notes

Implements the two-moment specification test described by White’s Theorem 2 (1980, p. 823) which compares the standard OLS covariance estimator with White’s heteroscedasticity-consistent estimator. The test statistic is shown to be chi-square distributed.

Null hypothesis is homoscedastic and correctly specified.

Assumes the OLS design matrix contains an intercept term and at least one variable. The intercept is removed to calculate the test statistic.

Interaction terms (squares and crosses of OLS regressors) are added to the design matrix to calculate the test statistic.

Degrees-of-freedom (full rank) = nvar + nvar * (nvar + 1) / 2

Linearly dependent columns are removed to avoid singular matrix error.

References