分段回归:davies.test returns p 值 = NA
Piecewise regression : davies.test returns p-value = NA
我的数据:
require(segmented)
cp <- c(0.079, 0.079, 0.079, 0.080, 0.080, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.082, 0.083, 0.084, 0.086, 0.088, 0.088, 0.088, 0.088, 0.088)
dates <- c(1443991015, 1443994615, 1443998215, 1444001815, 1444005415, 1444009015, 1444012615, 1444016215, 1444019815, 1444023415, 1444027015, 1444030615, 1444034215, 1444037815, 1444041415,
1444045015, 1444048615, 1444052215, 1444055815, 1444059415)
我会测试断点的发生。所以我按照建议 here 做了 Davies.test :
davies.test(lm(cp ~ dates), seg.Z = ~ dates)
但它 returns p 值 = NA :
Davies' test for a change in the slope
data: formula = cp ~ dates , method = lm
model = gaussian , link = identity
segmented variable = dates
= , n.points = 0, p-value = NA
alternative hypothesis: two.sided
看起来 davies.test
无法处理该规模的值;内部发生某种溢出。
dd <- scale(dates)
davies.test(lm(cp ~ dd), seg.Z = ~ dd)
似乎工作正常。
我的数据:
require(segmented)
cp <- c(0.079, 0.079, 0.079, 0.080, 0.080, 0.081, 0.081, 0.081, 0.081, 0.081, 0.081, 0.082, 0.083, 0.084, 0.086, 0.088, 0.088, 0.088, 0.088, 0.088)
dates <- c(1443991015, 1443994615, 1443998215, 1444001815, 1444005415, 1444009015, 1444012615, 1444016215, 1444019815, 1444023415, 1444027015, 1444030615, 1444034215, 1444037815, 1444041415,
1444045015, 1444048615, 1444052215, 1444055815, 1444059415)
我会测试断点的发生。所以我按照建议 here 做了 Davies.test :
davies.test(lm(cp ~ dates), seg.Z = ~ dates)
但它 returns p 值 = NA :
Davies' test for a change in the slope
data: formula = cp ~ dates , method = lm
model = gaussian , link = identity
segmented variable = dates
= , n.points = 0, p-value = NA
alternative hypothesis: two.sided
看起来 davies.test
无法处理该规模的值;内部发生某种溢出。
dd <- scale(dates)
davies.test(lm(cp ~ dd), seg.Z = ~ dd)
似乎工作正常。