I'm using bptest function of lmtest
package to use Breusch-Pagan test.
I get a strange result, doing the follow:
> m <- lm(prices[,1]~prices[,2]+0)
> bptest(formula(mod))
studentized Breusch-Pagan test
data: formula(mod)
BP = 0.458, df = 0, p-value < 2.2e-16
> m <- lm(prices[,1]~prices[,2])
> bptest(formula(m))
studentized Breusch-Pagan test
data: formula(m)
BP = 0.0503, df = 1, p-value = 0.8225
as you can see if I set the intercept to zero (+ 0
) i get a very low p-value, then if I do the test again WITH the intercept I get a good p-value.
Setting the intercept to zero also returns df = 0
so, something went wrong.
Could someone explain me the reason?
Thank you!