Segmental linear regression

I have tried to fit data in Labplot with a segmental linear regression. But struggling to get it working in LP.

This model fits two lines intersecting at X=X0, where X0 is the value of an intervention (e.g. could be time). I have used this equation in another software:

Y1 = intercept1 + slope1X
YatX0 = slope1
X0 + intercept1
Y2 = YatX0 + slope2*(X-X0)
Y = IF(X<X0, Y1, Y2)

results of this fit:

the plot looks like this:

how can this implemented in LP?

many thanks

Hi @Alf_N,

Can you share the project file with data in LabPlot?

sure, but cannot upload a file??

Maybe you can upload the project file here and then provide a link?

hmm, tried to include the link, but not allowed to do

Then please send it to us directly: Support and Contribution - LabPlot (see Email Support).

I replied to your email message with an outline of the steps needed to achieve this result.