Check model for independence of residuals.
Check model for independence of residuals, i.e. for autocorrelation of error terms.
check_autocorrelation(x, ...) ## Default S3 method: check_autocorrelation(x, nsim = 1000, ...)
x |
A model object. |
... |
Currently not used. |
nsim |
Number of simulations for the Durbin-Watson-Test. |
Performs a Durbin-Watson-Test to check for autocorrelated residuals. In case of autocorrelation, robust standard errors return more accurate results for the estimates, or maybe a mixed model with error term for the cluster groups should be used.
Invisibly returns the p-value of the test statistics. A p-value < 0.05 indicates autocorrelated residuals.
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) check_autocorrelation(m)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.