Re: [R] formula formatting/grammar for regression

2009-02-27 Thread Dieter Menne
BKMooney gmail.com> writes: > > > Also, when I tried to use nls, I get an error: > nls(ypts ~ exp(xpts)) > Error in getInitial.default(func, data, mCall = as.list(match.call(func, : > no 'getInitial' method found for "function" objects > > If someone could please point out what I am doin

Re: [R] formula formatting/grammar for regression

2009-02-27 Thread BKMooney
This is just (or should be) just a simple example of what I would like to extend to further regression - which is why I was looking for a resource on the grammar. If I try: lm(ypts ~ exp(xpts)), I only get an intercept and one coefficient. And for the coefficient, I am not sure where that shou

Re: [R] formula formatting/grammar for regression

2009-02-27 Thread Dieter Menne
Brigid Mooney gmail.com> writes: > I am doing some basic regression analysis, and am getting a bit > confused on how to enter non-polynomial formulas to be used. .. > But am confused on what the formula should be for trying to find a fit > to y = A*exp(r*x). If this example is just a placeholder

[R] formula formatting/grammar for regression

2009-02-27 Thread Brigid Mooney
Hi all, I am doing some basic regression analysis, and am getting a bit confused on how to enter non-polynomial formulas to be used. For example, consider that I want to find A and r such that the formula y = A*exp(r*x) provides the the best fit to the line y=x on the interval [0,50]. I can set: