[R] nlme function examples for dose-respone

Christof Kluß ckluss at email.uni-kiel.de
Tue Sep 25 18:57:00 CEST 2012


Hi,

thx Bert, I forward the question. I forgot a detail. For each (location,
plot, year) combination there are 6 (dose, response) pairs.

$ plot: Factor w/ 4 levels "1","2","3","4":
$ location : Factor w/ 5 levels "loc1","loc2",..:
$ year: Factor w/ 3 levels "2009","2010",..:
$ dose: num  27.3 32.7 57.2 33 183.1 ...
$ response: num  54.2 64.9 74.3 62 92.2 ...

So I can fit each (location, plot, year) with 6 points and make a bottom
up approach. But I would be glad to have one overall model, like

mod <- nlme(response ~ fun(dose,a,b,c)
             , fixed = list(a ~ 1, b ~ 1, c ~ 1)
             , random = list(a ~ 1, b ~ 1, c ~ 1)
             , groups = ~location
             , data=dat
             , start= ... )

and "location*plot" and "location*year" as random and for each location
one best fitted curve. But unfortunately I did not know how to formulate
this in nlme.

Christof


Am 25-09-2012 18:13, schrieb Bert Gunter:
> 1. Post on R-sig-mixed-models instead. Much more expertise and relevance there.
> 
> 2. I would forget about mixed effects and treat the locations as
> fixed. With only 5, you don't have enough information  to estimate the
> variance component with any precision anyway.
> 
> 3. Feel free to ignore (2) and defer to the experts at (1).
> 
> Cheers,
> Bert
> 
> 
> On Tue, Sep 25, 2012 at 8:52 AM, Christof Kluß <ckluss at email.uni-kiel.de> wrote:
>> Hi,
>>
>> I want to fit nonlinear dose-response curves, as "fun(X,a,b,c)", for
>> each of our 5 trail locations. Our data basis is something like
>>
>> location plot year dose response
>>
>> For each location there are 4 plots as repetitions (over 3 years). So
>> the interactions "location*year" and "location*plot" should be random
>> effects.
>>
>> There are some examples in "Mixed-Effects Models in S and S-PLUS"
>> (Pinheiro and Bates), but I do not see how they can help me for my
>> model. Of course I can start with something like
>>
>> mod <- nlme(response ~ fun(dose,a,b,c)
>>             , fixed = list(a ~ 1, b ~ 1, c ~ 1)
>>             , random = list(a ~ 1, b ~ 1, c ~ 1)
>>             , groups = ~location
>>             , data=dat
>>             , start= ... )
>>
>> But that is not what I want. How do you describe that you want one fit
>> for each of the five locations and that "location*year" and
>> "location*plot" or something similar are random effects?
>>
>> Do you have some other examples that fit better to this problem setting?
>> I welcome any tips.
>>
>> thx
>> Christof
>>
>> ______________________________________________
>> R-help at 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.
> 
> 
>




More information about the R-help mailing list