[R] syntax of nlme with nesting

Spencer Graves spencer.graves at pdf.com
Sun Nov 6 01:25:45 CET 2005


	  If you have not yet solved this problem and are still interested in a 
solution, I have three suggestions:

	  1.  Try to simplify the problem as much as possible.  If this does 
not lead you to a solution to your problem, when you get an example that 
is completely self-contained in a few lines of code, please submit that 
to this group.  I can't comment on your problem in part because I have 
neither your function NRhyperbola nor lit.data.

	  2.  Copy the "nlme" function into a script file and walk through it 
line by line, either manually or using "debug".  The "nlme" function is 
a bit cryptic to people unfamiliar with R, consisting of 
'UseMethod("nlme")'.  To move beyond this, I used 'methods("nlme")', 
which identified "nlme.formula" and "nlme.nlsList".  Then entering 
"nlme.formula" produced the desired listing.

	  3.  PLEASE do read the posting guide! 
"www.R-project.org/posting-guide.html".  This might help in other ways.

	  Good Luck,
	  spencer graves

Bill Shipley wrote:

> This may appear too elementary to some on this list, but not to me.  My
> apologies if this is the case.  I have mastered the lme function but the
> nlme function has me stumped.
> 
>  
> 
> I am attempting to fit a nonlinear mixed model with 4 levels of nesting.
> I am getting a cryptic error message and do not know what is wrong with
> the syntax of the call.  This is the call:
> 
>  
> 
> 
>>nlme(Photosynthese~NRhyperbola(Irr,theta,Am,alpha,Rd),
> 
> 
> + fixed=theta+Am+alpha+Rd~1,
> 
> + random=theta~1|Reference/Espece/Plante/Groupe,
> 
> + data=lit.data)
> 
>  
> 
> NRhyperbola is a self-starting function with one variable (Irr) and four
> parameters (theta,Am,alpha,Rd).  The data set (lit.data) contains
> Photosynthese (dependent variable) and Irr, as well as the grouping
> structure, which is Reference, Espece nested in Reference, Plante nested
> in Espece and Groupe nested in Plante.  I want to allow only the
> parameter theta to vary randomly.  I get the following error message:
> "Error: subscript out of bounds".
> 
>  
> 
> What does this mean?  There are some "Plante" for which there is only
> one "Groupe" , some "Espece" for which there is only one "Plante" etc.
> Is this the source of the error?  If so, how can one solve this?
> 
>  
> 
> Bill Shipley
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list