Possible Duplicate:
Change point analysis using R's nls()
I want to do a nonlinear regression with nls() but also include a specific type of segmented or piecewise regression. The Formula I want to implement is:
S ~ b0 + (A > T) * b1 * (A - T)
T
should be the threshold value or breakpoint as identified by the nonlinear-segmented regression. I know that I can use "algorithm = plinear"
but that does not work at all.
The data I have is:
A S
0.000809371 1
0.003642171 3
0.009712455 4
0.010521827 2
0.004046856 4
0.015378054 5
0.000404686 0
0.000404686 0
0.000404686 0
0.000809371 0
0.000809371 3
0.037635765 3
0.008903084 2
0.016187426 5
0.043301364 1
0.000404686 1
0.002428114 1
0.003642171 1
0.013759312 4
0.051395077 9
0.394568501 9
0.005665599 1
0.013354626 1
0.028732681 3
0.026304567 2
0.004451542 1
0.050585705 2
0.00647497 1
0.010926512 0
0.013354626 1
1.695632841 4
0.013354626 2