Hi, I ran an experiment with 3 factors, 2 levels and 200 replications and as I want to test for residuals independence, I used Durbin-Watson in R. I found two functions (durbin.watson and dwtest) and while both are giving the same rho, the p-values are greatly differ:
> durbin.watson(mod1) lag Autocorrelation D-W Statistic p-value 1 -0.04431012 2.088610 0.012 Alternative hypothesis: rho != 0 > dwtest(mod1) Durbin-Watson test data: mod1 DW = 2.0886, p-value = 0.9964 alternative hypothesis: true autocorrelation is greater than 0 durbin.watson suggests that I should reject the null hypothesis while dwtest suggests that I should NOT reject Ho. If I look it up in the following table: http://www.stanford.edu/~clint/bench/dw05d.htm, T = 1600 and K = 8 gives dL = 1.90902 and dU = 1.92659. Which means I should not reject Ho as DW > dU. Is there a bug in durbin.watson? should I use dwtest instead? can somebody help me explain what is happening? Thank you, ~ Hardi ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.