Back on January 16, a message on R-help from Ravi Varadhan described a
problem with gnls using weights=varPower(). The problem was that the
fit failed with error
Error in eval(expr, envir, enclos) : Object "." not found
I can reliably get this error in version 2.0.1-patched 2004-12-09 on
Windows XP and 2.0.1-Patched 2005-01-26 on Linux.
The key feature of that example is that the data are being passed in the
environment. Consider a modification of the example in the man page for
gnls:
First, something that should work:
+ start=c(Asym=16,xmid=50,scal=7),weights=varPower()))
Error in eval(expr, envir, enclos) : Object "." not found
## drop the weights argument from gnls, and the error message goes away.
The problem is in a call to model.frame. When varPower() (and
presumably other weight functions using '.' to represent a fitted model)
is used, gnls() constructs a formula argument for model.matrix that
looks like:
~.+weight+Time
This works when the data are passed in a data frame, but not when they
are in the environment. Look at the example in the man page for
model.frame
data.class(model.frame(~.+dist+speed, data=cars))
[1] "data.frame"
data.class(with(cars,model.frame(~.+dist+speed)))
Error in eval(expr, envir, enclos) : Object "." not found
Error in eval(expr, envir, enclos) : Object "." not found
I'm sending this to r-help rather to the authors of nlme because I am
not sure where the bug is: is model.frame misbehaving, or should gnls
not include '.' in its call to model.frame?
R. Woodrow Setzer, Jr. Phone: (919) 541-0128
Experimental Toxicology Division Fax: (919) 541-4284
Pharmacokinetics Branch
NHEERL B143-01; US EPA; RTP, NC 27711
On Wed, 2 Mar 2005 Setzer.Woodrow at epamail.epa.gov wrote:
Back on January 16, a message on R-help from Ravi Varadhan described a
problem with gnls using weights=varPower(). The problem was that the
fit failed with error
[...]
I'm sending this to r-help rather to the authors of nlme because I am
not sure where the bug is: is model.frame misbehaving, or should gnls
not include '.' in its call to model.frame?
'.' is only defined in a formula for model.frame() when there is a 'data'
argument (otherwise what do you think it might mean?). So this is not a
problem in model.frame(), hence on your analysis in gnls() or the usage of
it.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595