[R] nlme Error: Subscript out of bounds

From: Lisa Avery <lisa_avery_at_sympatico.ca>
Date: Mon 30 Oct 2006 - 14:51:05 GMT


Hello, I am new to non-linear growth modelling in R and I am trying to reproduce an analysis that was done (successfully) in S-Plus.  

I have a simple non-linear growth model, with no nesting. I have attempted to simplify the call as much as possible (by creating another grouped object, instead of using subset= and compacting the fixed and random expressions.)  

This is a what the grouped data object looks like:  

levelI.data[1:2,]

Grouped Data: GMAE ~ AGE | STUDYID

   STUDYID TIME SCORE INCURVES MOST FIRST AGE 19 1005 1 ACTUAL (unaided) in JAMA curves Level I Level I 49.11301

20 1005 2 ACTUAL (unaided) in JAMA curves Level I Level I 56.53745

       GMFM GMFCS GMAE YRS 19 91.03394 1 74.16 4.092751

20 95.35018 1 84.05 4.711454  

Here is the nlme model:  

cp.grad<-deriv(~ (100/(1+exp(-L)))*(1-exp(-exp(logR)*x)), c("L", "logR"), function(x=0:100,L,logR) NULL)

levelI.nlme<-nlme(GMAE~cp.grad(AGE,limit,lograte),

            data=levelI.data,

            fixed = limit+lograte~1,

            random = limit+lograte~1,

            start = c(2.0, -3.0))  

I get a subscript out of bounds error - which I am not finding very helpful because I don't know where things are going wrong.  

Bill Shipley posted a similar problem with nlme called with a self-starting function - but here I don't use a self-starting function and I give the starting values explicitly so I assume that this is not the same problem he is having.  

What am I doing wrong? Any insights would be very much appreciated.  

Kind Regards, Lisa Avery

        [[alternative HTML version deleted]]



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 and provide commented, minimal, self-contained, reproducible code. Received on Tue Oct 31 02:17:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 30 Oct 2006 - 16:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.