The Durbin–Watson function is used for testing whether there is autocorrelation in the residuals from
a linear model or a generalized linear model, and is implemented as part of the car package (see
a linear model or a generalized linear model, and is implemented as part of the car package (see
Fox, 2002):
library("car")
durbinWatsonTest(model)
dataEllipse(explanatory,response)
The car package also contains functions for drawing ellipses, including data ellipses, and confidence
ellipses for linear and generalized linear models. Here is the dataEllipse function for the present
example: by default, the ellipses are drawn at 50% and 90%:

本文介绍如何使用R语言中的car包进行Durbin-Watson检验,以检测线性模型残差中的自相关性,并展示了如何绘制解释变量与响应变量之间的数据椭圆。
1万+

被折叠的 条评论
为什么被折叠?



