[R] Nonlinear Regression

2007-06-07 Thread tronter

Hello

I followed the example in page 59, chapter 11 of the 'Introduction to R'
manual. I entered my own x,y data. I used the least squares. My function has
5 parameters: p[1], p[2], p[3], p[4], p[5]. I plotted the x-y data. Then I
used lines(spline(xfit,yfit)) to overlay best curves on the data while
changing the parameters. My question is how do I calculate the residual sum
of squares. In the example they have the following:

df - data.frame( x=x, y=y)

fit - nls(y ~SSmicmen(s, Vm, K), df)

fit


In the second line how would I input my function? Would it be:

fit - nls(y ~ myfunction(p[1], p[2], p[3], p[4], p[5]), df) where
myfunction is the actual function? My function doesnt have a name, so should
I just enter it?

Thanks

-- 
View this message in context: 
http://www.nabble.com/Nonlinear-Regression-tf3886617.html#a11016968
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


[R] R: x-y data

2007-06-06 Thread tronter

Hello

I have an Excel file with x-y data. I saved this file as a cvs file. Then I
used the read.table() function to read the data into R. If I have a formula
like (x+y)/2, how would I access x and y in R? I have the table named as
something. But how do I access the individual columns if I want to plug them
into the formula?

Thanks
-- 
View this message in context: 
http://www.nabble.com/R%3A-x-y-data-tf3874502.html#a10978448
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.