Skip to content
Prev 68611 / 398526 Next

Error in nonlinear mixed-effects model

Revilla,AJ (pgt) wrote:
> attach(dat)

I don't think that attach'ing a groupedData object will propagate the 
grouping factors.  I suggest that you avoid the construction of the 
groupedData object and also that you avoid attaching and detaching data 
frames.  Just use

  mod <- nlme(V~A*exp(B*YEAR)*VAC, dat, fixed=A+B~1, random=A+B~1|ID, 
correlation=corCAR1(), start=c(A=1.2,B=0.2))

You will also need to specify a formula for the corAR1 constructor.  My 
guess is form = ~ YEAR | ID but you will need to decide if that is what 
you intend.  Check the help page for corAR1 to see the list of possible 
arguments.


Error in