[R] Error with Segmented package

andrew haywood ahaywood3 at gmail.com
Wed Oct 7 15:50:01 CEST 2015


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]]



More information about the R-help mailing list