Displaying 1 result from an estimated 1 matches for "regtest1".
Did you mean:
regtest
2011 Aug 12
1
Which Durbin-Watson is correct? (weights involved) - using durbinWatsonTest and dwtest (packages car and lmtest)
Hello!
I have a data frame mysample (sorry for a long way of creating it
below - but I need it in this form, and it works). I regress Y onto X1
through X11 - first without weights, then with weights:
regtest1<-lm(Y~., data=mysample[-13]))
regtest2<-lm(Y~., data=mysample[-13]),weights=mysample$weight)
summary(regtest1)
summary(regtest2)
Then I calculate Durbin-Watson for both regressions using 2 different packages:
library(car)
library(lmtest)
durbinWatsonTest(regtest1)[2]
dwtest(regtest1)$stat...