[R] Error in segmented() output from segmented package
tsippel
tsippel at gmail.com
Tue Jan 27 00:40:40 CET 2009
Hi-
I'm gettting the following error message when trying to use the segmented
function to look for breakpoints in my data.
Error in segmented.glm(glm, seg.Z = ~segmentdist, psi = 2, control =
seg.control(display = F), :
(Some) estimated psi out of its range
Here are some real data and the models I'm calling which gives the error
above.
> segmentdist
[1] 0.000000 8.547576 12.700485 13.291767 15.701552 17.567891 18.936836
19.846242 20.325434 20.397607 20.066126 17.976218 16.772871 16.513030
16.434075
[16] 16.508426 16.717404 17.049235 17.501350 18.077070
> dal
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5
9.0 9.5
lm<-lm(data=df, segmentdist~dal)
lm(formula = segmentdist ~ dal, data = df)
Coefficients:
(Intercept) dal
13.77564 -0.06682
seg<-segmented(lm, seg.Z=~segmentdist, psi=2,
control=seg.control(display=F), model.frame=T)
The range of the data I'm looking for breaks in is min=0, max=44.5, so I
don't understand how my psi=2 could be out of range.
Thanks for your help,
Tim
--
View this message in context: http://www.nabble.com/Error-in-segmented%28%29-output-from-segmented-package-tp21674240p21674240.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list