Why the Breusch-Pagan test fails if I set the intercept to zero? 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!
 A: The Breusch-Pagan test regresses the square of the residual from your regression on your predictors. The square of the residual cannot have mean 0 and thus it requires an intercept in this regression in order to achieve unbiased results. 
When your predictors don't include an intercept, an intercept is not included in the canned version of the BP test that you are running. As a result, you get biased coefficients and biased test statistics.
If you want to force your model to have a 0 intercept (generally not a good idea, but...), you can do a BP test by hand by getting the residuals from your model, squaring them, and regressing them on an intercept term and your predictors. You can do a Wald ($\chi^2$) test of the significance of the coefficients on your predictors to get the official BP test statistic, but the reported F statistic and its p-value that come standard in the output of the residual-squared ("auxiliary") regression are close approximations to the official/standard versions.
