[R] Error Using dwtest
Achim Zeileis
zeileis at ci.tuwien.ac.at
Thu Jun 5 13:54:50 CEST 2003
On Wednesday 04 June 2003 16:44, rwatkins at cornerstonelp.com wrote:
> Hello all-
> I have two time series, Index1stdiff and Comps1stdiff. I regressed
> the first on the second and R returned the summary stats I expected.
> Then I looked at and plotted the residuals. I then wanted to
> assess autocorrelation characteristics and tried to run a
> Durbin-Watson using:
>
> library(lmtest)
>
> dwtest(formula=Index1stdiff~Comps1stdiff,alternative=c("greater"))
>
> I am getting the following error:
>
> Error in solve.default(crossprod(X), tol = tol) :
> Lapack routine dgesv: system is exactly singular
>
> Can anyone assess why my attempt crashes? I tried this earlier on
> what I thought was similar data and was returned an answer for "d"
> and a "p-value".
It means that the cross product X'X of your model matrix X, which is
computed by
X <- model.matrix(formula, data = data)
is exactly singular and thus cannot be inverted. In such a case
dwtest() cannot compute the p value. You might want to try
durbin.watson() in the package car which uses a different approach for
computing the p value.
Best,
Z
> Thanks in advance for your assistance.
> Rick
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
More information about the R-help
mailing list