[R] nls factor

Paul Smith phhs80 at gmail.com
Wed Apr 15 15:37:55 CEST 2009


On Wed, Apr 15, 2009 at 2:33 PM, Paul Smith <phhs80 at gmail.com> wrote:
> On Wed, Apr 15, 2009 at 1:27 PM, Manuel Gutierrez
> <manuelgutierrezlopez at gmail.com> wrote:
>> I want to fit the model y=a*x^b using nls; where "a" should be different for
>> each level of a factor.
>> What is the easiest way to fit it? Can i do it with nls?
>> I've looked the help pages and the MASS example in page 249 but the formula
>> is different and I don't know how to specify it for my model.
>
> What about linearizing the model with log() and use lm() afterwards?

Oops, sorry, I misread your post -- 'a' changes with the level of a factor.

Paul




More information about the R-help mailing list