offset arg (was Re: [R] variable scope)

Bill.Venables@cmis.csiro.au Bill.Venables@cmis.csiro.au
Sun, 4 Aug 2002 12:42:02 +1000


I certainly think we should deprecate it and Peter has (probably
unintentionally) offered yet another cogent argument as to why (although
that could be fixed by including "offset" among the arguments to be handled
by model.frame, like subset, weights, &c, and yes, I do know this would
break existing code...)

For me the main argument against it, though, is that it de-links the offset
from the linear predictor, where naturally it belongs.  It is hard to find a
truly natural and effective syntax for saying "this is part of the linear
predictor but it has a known coefficient of unity, not to be estimated", but
the ... + offset(gunk) device that we now allow, (along with the commercial
R clone, of course), is not all that bad.

Bill.

-----Original Message-----
From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk]
Sent: Saturday, August 03, 2002 8:25 PM
To: Peter Dalgaard BSA
Cc: r-devel@stat.math.ethz.ch
Subject: offset arg (was Re: [R] variable scope)


On 3 Aug 2002, Peter Dalgaard BSA wrote:

> Another example that has come back to haunt us several times is
> lm(...,data=d,offset=foo). The problem is that we want "foo" to be
> found inside "d" if present, but call-by-value semantics imply that it
> is an object in the caller's scope. You really ought to pass the name
> "foo" (or maybe better: quote(foo), or a formula ~foo).

Should we not just deprecate the offset argument in lm and glm?  Using the
offset() function in the formula works as one would expect (at least if
one remembers the R rules which start at the formula's environment).

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._