Dear List,
I am trying to run a simple pieewise regression using the segmented package.
When running the following code
library(segmented)
data = data.frame(x=c(50,60,70,80,90,100,110) , y=
c(703.786,705.857,708.153,711.056,709.257, 707.4, 705.6))
model.lm = segmented(lm(y~x,data = data),seg.Z = ~x, psi = NA, control =
seg.control(K=1))
I get the following error.
Error in if (psi == Inf) psi <- median(XREGseg) :
missing value where TRUE/FALSE needed
Any advice would be greatly appreciated.
Kind regards
Andrew
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.