[R] Error in nonlinear mixed-effects model

From: Revilla,AJ (pgt) <A.J.Revilla_at_lse.ac.uk>
Date: Wed 27 Apr 2005 - 01:39:04 EST


Dear all,

I am trying to fit a mixed-effects non linear regression, but I have some trouble with it. My data are a balanced panel of 904 subjects with 8 observations (at regular periods) per subject. The functional form of my model is Y=Aexp(-BX1)X2 +e. I want to allow parameters A and B to vary among subjects and also include an autocorrelation term. I have already fitted a standard nonlinear regression to the data, but I keep having problems with NLME.

I have defined my data as a groupedData object, and when I try to fit the model I get this error message:

dat<-groupedData(V~VAC|ID,data=dat)
attach(dat)
mod<-nlme(V~A*exp(B*YEAR)*VAC, fixed=A+B~1, random=A+B~1, correlation=corCAR1(), start=c(A=1.2,B=0.2))
Error in getGroups.data.frame(dataMix, eval(parse(text = paste("~1", deparse(groups[[2]]), :

        Invalid formula for groups

Do you have any clue of whatís happening? Itís the first time I fit a model like this in R, so the problem is probably pretty obvious, but I cannot see it.

Thank you very much,

Antonio



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Apr 27 02:02:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:26 EST