[R] formula formatting/grammar for regression
dieter.menne at menne-biomed.de
Fri Feb 27 17:25:36 CET 2009
Brigid Mooney <bkmooney <at> 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 for "more complex than poly",
you should check function nls which works for non-linear functions.
However, if you really want to solve this problem only, doing a
log on you data and fitting a log of the above function with lm()
is the easiest way out. Results can be a bit different from the
nonlinear case depending on noise, because in one case weight
are log-weighted, in the other linearly.
More information about the R-help