如何使用Durbin Watson测试找到自相关值?

时间:2018-12-12 15:53:20

标签: r

如何使用Durbin Watson测试获得自相关值?当使用<script src="http://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div> $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: "One might think points get grouped by name" }, "series": [{ "data": [{ x: 1, "name": "May", "y": 1 }], "name": "Alpha" }, { "data": [{ x: 0, "name": "Apr", "y": 1 }, { x: 1, "name": "May", "y": 2 }, { x: 2, "name": "Jun", "y": 3 }], "name": "Beta" }], xAxis: { type: 'category', //categories : ["Jun", "Apr", "May"] }, yAxis: { type: 'category', categories : ["First", "Second", "Third", "fourth","fifth"] } }); }); 完成durbin watson测试时,我得到了答案。

dwtest()

1 个答案:

答案 0 :(得分:1)

保存变量,然后将其提取。例如:

fit <- lm(mpg ~ cyl, mtcars)
dw <- dwtest(fit)
dw$statistic
#      DW 
#1.669691