Hi Bill, I am not sure what you want, but...
mydf<-read.table(stdin(), head=T, sep=",") Np,year 96,2 91,5 89,7 85,10 plot(Np~year, data=mydf) mymodel<-lm(Np~year, data=mydf) abline(mymodel, col="red") bests milton On Wed, Sep 9, 2009 at 2:27 PM, Bill Hyman <billhym...@yahoo.com> wrote: > My data look like: > > Np year > 96 2 > 91 5 > 89 7 > 85 10 > > > > ----- Original Message ---- > From: Bill Hyman <billhym...@yahoo.com> > To: r-help@r-project.org > Sent: Wednesday, September 9, 2009 11:23:26 AM > Subject: [R] fitting nonlinear model > > I only have 4 data points and want to fit a curve. It does not work in > "modreg" due to too few data. Do you have any idea? Many thanks! > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.