Can I check autocorrelation from a generalized least squares model?

I am trying to use a generalized least square model ( glsin R) on my panel data to solve the problem of autocorrelation. I do not want to have any delays for any variables.

I am trying to use the Durbin-Watson test ( dwtestin R) to test the autocorrelation problem from my generalized least square model ( gls). However, I found that it is dwtestnot applicable to a function gls, whereas it is applicable to other functions, such as lm.

Is there any way to check the autocorrelation problem from my model gls?

+6
source share
1 answer

The Durbin-Watson test is designed to check for autocorrelation in standard least squares models (for example, one installed lm). If autocorrelation is detected, it can then be explicitly fixed in the model, using, for example, generalized least squares ( glsin R). I understand that Durbin-Watson is not suitable for testing “goodness of fit” in the resulting models, since glsresiduals may no longer follow the same distribution as residuals of the standard model lm. (Someone with a deeper knowledge of statistics should correct me if I am wrong).

durbinWatsonTest car . - :

v <- gls( ... )$residuals
attr(v,"std") <- NULL      # get rid of the additional attribute
car::durbinWatsonTest( v )

, durbinWatsonTest p lm (, - ), , /.

+3

All Articles