[R] Problems with nlme: Quinidine example
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:
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)
This is not particularly helpful by itself. However,
'methods("nlme")' returns the following:
 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
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.
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:
>>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 - (p:1), dimE - (p:1), drop =
> FALSE]) :
> system is computationally singular: reciprocal condition number =
> - 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
> R-help at stat.math.ethz.ch mailing list
> 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
More information about the R-help