Three-group variance-ratio tests for heteroscedasticity in linear regression: an exact null distribution and an outlier-resistant version
Tests for heteroscedasticity in linear regression lose their level or power in three situations: when the data contain outliers, when the variance is not monotone, and when it changes along a variable outside the regressors, such as time. The proposed tests sort the observations by any chosen variable, split them into three equal parts, fit the regression in each part and compare the largest with the smallest error scale. With least squares fits and normal errors, the ratio follows Hartley's maximum F distribution with three groups exactly. With least trimmed squares fits, the ratio resists outliers spread along the ordering. Its square is approximately a maximum F ratio with effective degrees of freedom, whose limit we derive in closed form from the influence function of the trimmed variance. A factorial simulation covered 72 settings of variance shape, ordering variable, number of regressors, contamination and sample size. The robust test had the highest mean size-adjusted power, 67%, against 45% for the next test; when the variance changed along a regressor, which all tests were given, it led White's test after an outlier screen, 67% against 56%. With heavy-tailed t3 errors its lead was similar, 64% against 35%. Unlike the tests built on the regressors, it can follow a variance changing along time, and it identifies the part of the data where the variance changes. Two published robust versions of the Goldfeld-Quandt test, as implemented from their descriptions, did not hold their nominal level. The R package KOTORY implements the methods.