2

The question is straightforward: How to implement White test (a test for heteroscedasticity) for a simple linear regression model (lm object) in R?

I have tried "whites.htest(var.model)", however, it requires an input of varest object.

I learned that it requires to regress the squared of residuals with all squared variables, as well as their interaction terms. However, there seems no functions in R to implement this.

Can anyone give an example of it?

for example: if i have 4 variables in a regression equation lm(y~A+B+C+D). How should I write the white test code?

Note: my question is more general than this question that has been asked before: White's test for heteroskedasticity in R It only explains how to implement when there are only two variables. However, what if I have more than 3 variables? How could I express the regression equation to implement White test?

Master Shi
  • 643
  • 6
  • 10
  • Have you tried the function whites.htest() in the package "het.test"? – Matt P Apr 11 '19 at 17:23
  • Take this with a grain of salt as I have not tried the approach, but if the problem is only the inclusion of more than 2 parameters (as in the answer), try changing the formula objects, i.e., ``m – runr Apr 15 '19 at 13:39

0 Answers0