[R] Problems with nlme: Quinidine example

Spencer Graves spencer.graves at pdf.com
Fri Jul 8 04:30:25 CEST 2005


	  Since I've seen no reply to this so far, I will venture a few 
questions / suggestions.  I have not used nlme (nor nln for Maggie Zhu), 
so I can not comment on the specifics.  I have two general procedures 
for debugging when I get a cryptic error message.

	  First, in R, I can get the source just by entering the name of the 
function.  I copy the results into a script file and trace the code line 
by line until I identify what crashes the code.  Then I can work to 
identify what change I need to make, either to the code or prefereably 
to my argument(s), to make it work.

	  Requestion "nlme" produces the following:

 > nlme
function (model, data = sys.frame(sys.parent()), fixed, random = fixed,
     groups, start, correlation = NULL, weights = NULL, subset,
     method = c("ML", "REML"), na.action = na.fail, naPattern,
     control = list(), verbose = FALSE)
{
     UseMethod("nlme")
}

	  This is not particularly helpful by itself.  However, 
'methods("nlme")' returns the following:

[1] nlme.formula nlme.nlsList

	  I can list these two functions [or access them via getAnywhere if the 
name is followed by an asterisk (*)] and get more detail.

	  Second, with a complicated function call like the two nlme examples, 
I can try to delete or simplify arguments, e.g., delete terms from a 
formula, until I get something that either changes or eliminates the 
error message.

	  Finally, "PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html".  It can help you formulate 
a question to increase the chances of a useful reply -- and you may even 
find the answer without waiting for someone on the list to reply.

	  spencer graves

rich at mi.fu-berlin.de wrote:

> This concerns the "Clinical Study of Quinidine" example on page 380
> of the book "Mixed-Effects Models in S and S-PLUS" by Pinheiro and Bates (2000).
> 
> I have tried to reproduce the example, but get an error:
> 
> 
>>library(nlme)
>>fm1Quin.nlme <- nlme(conc ~ quinModel(Subject, time, conc, dose, interval, lV,
> 
> lKa, lCl),
> +                      data=Quinidine,
> +                      fixed=lV + lKa + lCl ~ 1,
> +                      random=pdDiag(lV + lCl ~ 1),
> +                      groups= ~ Subject,
> +                      start=list(fixed=c(5, -0.3, 2)),
> +                      na.action=na.pass, naPattern= ~ !is.na(conc))
> Error in solve.default(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop =
> FALSE]) :
>         system is computationally singular: reciprocal condition number =
> 6.61723e-17
> 
> Note:
>  - I am running R version 2.1.0 on Linux.
>  - The only difference between the code in the book and the code above is
>    that I use na.pass instead of na.include for the na.action argument, but
>    I don't think this is significant.
> 
> I would appreciate help from anybody who has been able to get this example to
> work.
> 
> ______________________________________________
> 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