Hi, Julian- I'm not sure if this will be what you want but you could start by taking a look at: ?predict.nls Ken
On 01/17/12, crimsonengineer87 <julianjonre...@gmail.com> wrote: > Dear Forum, > > I have been wracking my head over this problem for the past few days. I have > a dataset of (x,y). I have been able to obtain a nonlinear regression line > using nls. However, we would like to do some statistical analysis. I would > like to obtain a confidence interval for the curve. We thought we could > divide up the curve into piecewise linear regressions and compute CIs from > those portions. There is a package called strucchange that seems helpful, > but I am thoroughly confused. > > 'breakpoints' is used to calculate the number of breaks in the data for > linear regressions. I have the following in my script: > > bp.pavlu <- breakpoints(Na ~ f(yield, a, b), h=0.15, breaks=3, > data=pavludata) > plot(bp.pavlu) > breakpoints(bp.pavlu) > > But I am confused as to how to graph the piecewise functions that make up > the curve. I am not even sure if I am using breakpoints correctly. Do I just > give it a linear relationhip (Na ~ yield), instead of what I have? > > Is there an easier way to calculate the confidence interval for a non-linear > regression? > > I am new to R (as I've read in many questions), but I have most certainly > tried many things and am just getting frustrated with the lack of examples > for what I'd like to do with my data... I'd appreciate any insight. I can > also provide more information if I am not clear. Thanks in advance. > > Julian > > -- > View this message in context: > http://r.789695.n4.nabble.com/breakpoints-and-nonlinear-regression-tp4303629p4303629.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. > >
______________________________________________ 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.