Thanks, Jean. I've actually looked at that source before. The issue is that I can't constrain the slope of the /center/ section to be zero - in fact, I've applied similar code to a three-segment regression and I can get a zero slope either of the two sides, but not in the middle.
Here's a list of the main resources I've consulted so far: https://climateecology.wordpress.com/2012/08/19/r-for-ecologists-putting-together-a-piecewise-regression/ http://www.stackoverflow.dluat.com/questions/30060278/creating-piecewise-linear-regression-with-flat-slope-in-r https://rpubs.com/MarkusLoew/12164 -- View this message in context: http://r.789695.n4.nabble.com/Piecewise-segmented-linear-regression-with-center-section-slope-constraint-tp4710839p4710875.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.