| Statistics Toolbox™ | ![]() |
[P,DW] = dwtest(R,X)
[...] = dwtest(R,X,method)
[...] = dwtest(R,X,method,tail)
[P,DW] = dwtest(R,X) performs a Durbin-Watson test on the vector R of residuals from a linear regression, where X is the design matrix from that linear regression. P is the computed p-value for the test, and DW is the Durbin-Watson statistic. The Durbin-Watson test is used to test if the residuals are independent, against the alternative that there is autocorrelation among them.
[...] = dwtest(R,X,method) specifies the method to be used in computing the p-value. method can be either of the following:
'exact' — Calculates an exact p-value using the PAN algorithm (the default if the sample size is less than 400).
'approximate' — Calculates the p-value using a normal approximation (the default if the sample size is 400 or larger).
[...] = dwtest(R,X,method,tail) performs the test against the alternative hypothesis specified by tail:
'both' | Serial correlation is not 0. |
'right' | Serial correlation is greater than 0 (right-tailed test). |
'left' | Serial correlation is less than 0 (left-tailed test). |
![]() | dummyvar | ecdf | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |