Skip to content

Durbin-Watson test in packages "car" and "lmtest"

2 messages · Ahmad, Torsten Hothorn

#
Hi,
P-values in Durbin-Watson test obtained through the use of functions available in packages "lmtest" and "car" are different. The difference is quite significant. function "dwtest" in "lmtest" is much faster than "burbinwatson" in "car". Actually, you can take a nap while the latter trying to calculated Durbin-Watson test. My question is which p-value is better?
  
Thank you,
Ahmad Abu Hammour
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020419/274907c1/attachment.html
#
The answer is essencially given in ?durbin.watson and ?dwtest. The latter
states that

 The p value is computed
     using a Fortran version of the Applied Statistics Algorithm AS 153
     by Farebrother (1980, 1984). This algorithm is called "pan" or
     "gradsol". For large sample sizes the algorithm might fail to
     compute the p value; in that case a warning is printed and an
     approximate p value will be given; this p value is computed using
     a normal approximation with mean and variance of the Durbin-Watson
     test statistic.

while ?durbin.watson says

  simulate: if `TRUE' p-values will be estimated by bootstrapping.

What is a "quite significant" difference for p-values? 

Looking at the example from ?durbin.watson gives: 

R> durbin.watson(lm(fconvict ~ tfr + partic + degrees + mconvict,
data=Hartnagel))
 lag Autocorrelation D-W Statistic p-value
   1        0.688345     0.6168636       0
R> dwtest(fconvict ~ tfr + partic + degrees + mconvict, data=Hartnagel)

        Durbin-Watson test

data:  fconvict ~ tfr + partic + degrees + mconvict 
DW = 0.6169, p-value = 6.96e-09

which is fairly close, so you might give us more details (that is: a
working example) to see what the "difference" is (that is: a bug in
either function or a difference due to simulation error / bad
approximation ...). 

Torsten
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._