[R] curve fitting to data

2009-12-04 Thread Pascale Weber
Hi to all This is the first time I am quoting a question and I hope, my question is not too basic... For the following data, I wish to draw a fitted curve. x - c(123,129,141,144,144,145,149,150,158,159,163,174,183,187,242,248) y -

Re: [R] curve fitting to data

2009-12-04 Thread Gabor Grothendieck
A simple y vs log(x) fit seems to work pretty well here: fit - lm(y ~ log(x)) summary(fit) plot(y ~ log(x)) abline(fit) On Fri, Dec 4, 2009 at 9:06 AM, Pascale Weber pascale.we...@wsl.ch wrote: Hi to all This is the first time I am quoting a question and I hope, my question is not too

Re: [R] curve fitting to data

2009-12-04 Thread Peter Ehlers
Pascale, If you do want an nls fit with the associated error structure assumptions, check ?SSlogis. fm - nls(y ~ SSlogis(x, Asy, xmid, scal)) summary(fm) xx - seq(123, 248, length = 101) yy - predict(fm, list(x = xx)) plot(x, y) lines(xx, yy) -Peter Ehlers Gabor Grothendieck wrote: A