piecewise regression ~ segmented package

I won't be able to attempt to reproduce your error without your data.
consider sharing it via suggested methods FAQ: ( reprex )

although best guess is that only the first breakpoint suggestion you make is being considered (for that purpose) and the other estimates are being interpreted as different parameters to segmented. you should pass the set of estimates within the c() construct like

df_seg <- segmented(df_lin, seg.Z = ~ timemonth, psi =c( 25, 115, 132))
1 Like