A piecewise linear regression model can be easily fitted in R by using the same
lm function and a bit of caution. A loop is used to find the points at which the model is supposed to have changed its trajectory.
PW_Illusobject by using
break1 <- X[which(X>=12 & X<=18)] break2 <- X[which(X>=27 & X<=33)]
n1 <- length(break1)and
n2 <- length(break2).
We do not have a clear defining criterion to select one of ...