I want to use non-linear regression lines to show the Height over Diameter relation of trees. I'm using the following formula:
h = A + B ∙ d + C ∙ d²
For this I used the nls package in R. I inserted the Formula in the follwing way:
M1<-nls(T_Height~p1+p2*DBH+p3*DBH^2)
plot(T_Height~DBH)
lines(DBH,predict(M1),lty=2,col='red',lwd=3)
However the result is not a single line fit but looks as follows
What am I doing wrong? Is there a way to reduce the result to one single fitted line?
Thanks in advance