Skip to content

Contradictory results between different heteroskedasticity tests

2 messages · Carlos Pita, John Fox

#
Hi all,

I'm getting contradictory results from bptest and ncvTest on a model
calculated by GLS as:

olslm = lm(log(rr)~log(aloi)*reg*inv, data)
varlm = lm(I(residuals(olslm)^2)~log(aloi)*reg*inv, data)
glslm = lm(log(rr)~log(aloi)*reg*inv, data, weights=1/fitted(varlm))

Testing both olslm and glslm with both ncvTest and bptest gives:
Non-constant Variance Score Test
Variance formula: ~ fitted.values
Chisquare = 46.88206    Df = 1     p = 7.538963e-12
Non-constant Variance Score Test
Variance formula: ~ fitted.values
Chisquare = 0.001466426    Df = 1     p = 0.9694533
studentized Breusch-Pagan test
data:  olslm
BP = 213.1477, df = 7, p-value < 2.2e-16
studentized Breusch-Pagan test
data:  glslm
BP = 213.1477, df = 7, p-value < 2.2e-16

Please notice the last output. It seems as if bptest is not
considering the weights given to lm. What am I doing wrong here?

Best regards
--
Carlos
#
Dear Carlos,

Please note that the default alternative hypothesis is different in
ncvTest() and bptest() -- in the former that the error variance is a
function of the expectation of Y (hence the formula ~ fitted.values, with 1
df for the test), and in the latter that the error variance is a function of
a linear combination of the predictors in the model (hence, in your case, 7
df for the test). For testing a different alternative hypothesis with
ncvTest(), see ?ncvTest. 

I won't comment of what bptest() does with the weighted model, but ncvTest()
uses the Pearson residuals and hence takes account of the weights.

I hope this helps,
 John

-----------------------------------------------
John Fox
Senator McMaster Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada