Posted: Thu Dec 29, 2011 3:04 pm
I have a quick R question since it seems like we have some users here. Plus you guys are a lot more tolerant of newbie type questions than the R list. I"m having a hard time matching the results up to my reading on the subject.
I'm running OLS regression on interest rates and index prices.
> lmLevel <- lm(index~rates, data=df)
Then run a BP and DW test
> bptest(lmLevel)
studentized Breusch-Pagan test
data: lmLevel
BP = 2.1318, df = 1, p-value = 0.1443
> dwtest(lmLevel)
Durbin-Watson test
data: lmSReturn
DW = 0.3123, p-value < 2.2e-16
alternative hypothesis: true autocorrelation is greater than 0
re: bptest. With such a high p-value, it's basically stating that there is conditional heteroskedasticity, correct?
re: dwtest. With a low DW number and very low p-value. Positive serial correlation exists, correct?
So I then run a test to correct for both ..
> coeftest(lmLevel,vcoc=vcovHAC(lmLevel))
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1579.9570 34.9740 45.175 < 2.2e-16 ***
rates -124.6063 4.6965 -26.532 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
So are these now valid results?
I'm running OLS regression on interest rates and index prices.
> lmLevel <- lm(index~rates, data=df)
Then run a BP and DW test
> bptest(lmLevel)
studentized Breusch-Pagan test
data: lmLevel
BP = 2.1318, df = 1, p-value = 0.1443
> dwtest(lmLevel)
Durbin-Watson test
data: lmSReturn
DW = 0.3123, p-value < 2.2e-16
alternative hypothesis: true autocorrelation is greater than 0
re: bptest. With such a high p-value, it's basically stating that there is conditional heteroskedasticity, correct?
re: dwtest. With a low DW number and very low p-value. Positive serial correlation exists, correct?
So I then run a test to correct for both ..
> coeftest(lmLevel,vcoc=vcovHAC(lmLevel))
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1579.9570 34.9740 45.175 < 2.2e-16 ***
rates -124.6063 4.6965 -26.532 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
So are these now valid results?