Perform White's test for heteroscedasticity¶
Source: man/performWhiteTest.Rd · Help: ?performWhiteTest
Implements White's test on a fitted linear model.
Usage¶
Arguments¶
model- an object of class
lm. data- Data frame used to fit
model. WhenNULL, the default, the model frame ofmodelis used. It holds the terms of the model rather than its variables (log(x)rather thanx), so a model that transforms a variable needsdata, as does a model with anoffset()term, and so may a fit whoseweightsoroffsetargument is a column of the data, which the model frame holds as(weights)or(offset). cross_products- Logical. Include cross-product terms in the auxiliary regression?
max_interactions- Maximum number of cross-product terms admitted to the auxiliary regression. Guards the auxiliary design against growing quadratically with the number of regressors.
Value¶
An object of class htest containing the test statistic, p-value and degrees of freedom.
Details¶
An auxiliary regression of \(e^2\) on all regressors, their squares and cross-products produces \(R^2\). The statistic \(n R^2\) follows a chi-square distribution with degrees of freedom equal to the number of regressors in the auxiliary model.
Weighted fits¶
On a fit with weights the test is computed from the Pearson residuals \(\sqrt{w_i}\, e_i\), so it tests whether the weights are adequate; see the section on weighted fits in performKoenkerTest(), which also covers weights estimated by fitWLS().
References¶
White, H. (1980). A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica, 48(4), 817–838. doi:10.2307/1912934
Greene, W. H. (2018). Econometric Analysis (8th ed.). Pearson.