Solved – Can the Breusch-Pagan test be applied to GLM

heteroscedasticitylinearmodel

I have developed a model to test if a relationship is unimodal by using a Gaussian GLM. In an effort to diagnose the various assumptions of linear models I used the Breusch-Pagan test to determine heteroscedasticity from the lmtest package in R. Does the Breusch-Pagan test lend itself to be used with glm or is it strictly just an lm function? If not is there a Breusch-Pagan test function that can be used with glm?

Best Answer

The bptest() function in the R package lmtest is just designed for linear regression models and internally uses lm.fit() to estimate the main regression equation and the auxiliary regression.

Conceptually, I think that the Breusch-Pagan test has only been developed for the linear regression case (as far as I know). Similar ideas - i.e., some auxiliary regression for some transformation of (squared) residuals - can probably be applied to other models as well. However, in several GLMs the question would be how to incorporate the heteroscedasticity into the model. In binary GLMs no heteroscedasticity is possible (or would indicate a misspecification in the mean equation) and in Poisson models it would signal violation of the Poisson likelihood assumption. So some care is needed in specifying exactly what should be tested how.