[R] update/offset
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Mar 26 21:16:00 CET 2004
Which version of R? This is supposedly fixed in 1.9.0 beta, so please try
that.
On Fri, 26 Mar 2004, Simon.Bond wrote:
> I've noticed that the update() function does not seem to work correctly
> when offset(..) terms are there:
>
> update(modelwithoffset, .~.-afixedeffect)
>
> drops the offset term.
>
> I'm using this with a negbin model, but I think it goes wrong with the
> update.formula() function.
>
> update.formula
> function (old, new, ...)
> {
> env <- environment(as.formula(old))
> tmp <- .Internal(update.formula(as.formula(old), as.formula(new)))
> out <- formula(terms.formula(tmp, simplify = TRUE))
> environment(out) <- env
> return(out)
> }
> <environment: namespace:base>
>
>
>
> The .Internal command in the code is where my efforts grind to a halt.
The prohlem was in terms.formula(tmp, simplify = TRUE).
> Any suggestions (apart from redefine the new model from scratch) ?
--
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
More information about the R-help
mailing list