[R] white test to check homoscedasticity of the residuals

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Wed May 30 16:18:15 CEST 2007


On Wed, 30 May 2007, Benoit Chemineau wrote:

> Hi R-programmers,
>
> I can't find find the White test to check the homoscedasticity of the
> residuals from a linear model. Could you please help me with this?

The package "lmtest" includes the function bptest() for performing
Breusch-Pagan tests. White's test is a special case of this. For example,
if you fit a linear regression
  fm <- lm(y ~ x + z, data = foo)
then you can carry out White's test via
  bptest(fm, ~ x * z + I(x^2) + I(z^2), data = foo)
i.e., include all regressors and the squares/cross-products in the
auxiliary regression.

I haven't yet written a simple convenience interface for this...

hth,
Z

> Thank you !
>
> BC
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list