add line to nls fit and plot

336 views Asked by At

I am having problems adding a line to one scatter plot. My data is fit to an exponential model. I used nls to get coefficients:

fit <- nls(volumen ~ bo+ exp(b1*dap), data= df, start = list(bo=0, b1=55))

Later I used plot and lines commands to visualize the fit to my data:

plot(dap,volumen)
lines(dap,predict(fit,data.frame(x=dap)))

My Big problem is that I visualize a linear line that does not fit with my exponential points.

Could my model statement have errors?

Please, any comments I would appreciate.

0

There are 0 answers