5
$\begingroup$

I was experimenting with cabbages data set and linear regression in R. I tried a Durbin-Watson test on model "Vitamin C concentration as function of cabbage head weight" and got significant result of autocorrelation:

data(cabbages, package = "MASS")
lmtest::dwtest(VitC ~ HeadWt, alternative="two.sided", data=cabbages)

Result:

Durbin-Watson test

data:  VitC ~ HeadWt
DW = 1.2929, p-value = 0.003546
alternative hypothesis: true autocorrelation is not 0
  1. How should I interpret this result of significant autocorrelation in this context?
  2. Does it mean that linear regression is not suitable for this data set? If yes, what are the alternatives?
  3. Is Durbin-Watson test appropriate in this case, as it is not time-series?

I read several post on Durbin-Watson test (e.g., 1, 2, 3). I noticed, that usually it is mentioned in context of econometrics ant time series analysis but do not clearly understand in what situations it is appropriate to use this test and in what situations it is not.

$\endgroup$

1 Answer 1

6
$\begingroup$

(1) There is some correlation in the ordering of the observations. In this case, (part of) the reason is that the observations are ordered by Cult (a factor indicating the cultivator of the cabbages). And because the first cultivator is mostly associated with negative residuals and the second cultivator mostly with positive residuals, this pattern will be picked up by diagnostic tests. It might look like a "trend" or like "autocorrelation" if this is all the tests look for.

(2) Linear regression itself seems to work ok. But it is important to control for Cult and not only for HeadWt. Possibly Date could be relevant as well. It would also be good to check what the MASS book says about the data (my copy is in the office, hence I can't check right now).

(3) No. The Durbin-Watson is appropriate if you have correlations over "time" or some other kind of natural ordering of the observations. And even then there might be other autocorrelation tests that could be more suitable.

$\endgroup$
4
  • 1
    $\begingroup$ Nice answer! I don't like the term autocorrelation when not dealing with time series. But I guess it really just means correlation on itself which could apply to any ordered series or sequence. $\endgroup$ Commented Nov 29, 2016 at 0:31
  • 2
    $\begingroup$ I completely agree. Autocorrelation is really for time series. However, I can see there may be applications to other ordered observations (e.g., ordered in space rather in time). But for unordered cross-section data the tests probably picks up some other signal if it is significant (as in your example). Also, if the post answered your question please consider accepting it so that it is flagged as resolved on StackExchange. $\endgroup$ Commented Nov 29, 2016 at 11:23
  • $\begingroup$ @AchimZeileis It's a good and useful answer, you have mentioned *"Linear regression itself seems to work ok." Could you elaborate on that and provide an example of where Durbin-Watson test could indicate that linear model is not appropriate? Is it possible to determine suitability of the linear regression only by looking at DW results? $\endgroup$
    – Konrad
    Commented Mar 15, 2020 at 19:42
  • 1
    $\begingroup$ I meant that linear regression itself is not the problem, but omitting an important regressor is. The DW test alone can never show that a model is appropriate - but it might reveal autocorrelation. Depending on the extent you might still stick to linear regression but correct the standard errors. $\endgroup$ Commented Mar 16, 2020 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.