[R] White test

Achim Zeileis Achim.Zeileis at uibk.ac.at
Sun Oct 14 10:00:08 CEST 2012


On Sat, 13 Oct 2012, Afrae Hassouni wrote:

> Hello,
>
> Is there a way to perform a White test (testing heteroscedasticity) 
> under R?

White's test is a special case of the Breusch-Pagan test using a 
particular choice of auxiliary regressors. The Breusch-Pagan test is 
available in bptest() from "lmtest" or ncvTest() from "car". A worked 
example on how to perform the White test with bptest is provided in
help("CigarettesB", package = "AER"), based on an example from Baltagi's 
"Econometrics" textbook:

library("AER")
data("CigarettesB", package = "AER")
cig_lm2 <- lm(packs ~ price + income, data = CigarettesB)
bptest(cig_lm2,
   ~ income * price + I(income^2) + I(price^2),
   data = CigarettesB)

hth,
Z

> Best regards,
>
> Afrae Hassouni
>
> ______________________________________________
> R-help at r-project.org 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