[Rd] update forgets about offset() (PR#6656)
ripley at stats.ox.ac.uk
ripley at stats.ox.ac.uk
Thu Mar 18 11:47:01 MET 2004
On Mon, 15 Mar 2004 Mark.Bravington at csiro.au wrote:
> Thanks (I hadn't realize 'response' could be 0). However, there's now a problem (in R 1.9.0 alpha) with *removing* offsets via 'update':
>
> > fit2 <- glm( y ~ z + offset(x), data=df)
> > fit2$call
> glm(formula = y ~ z + offset(x), data = df)
>
> > update( fit2, ~.-offset(x))$call
> glm(formula = y ~ z + offset(x), data = df)
>
> # the offset wasn't removed even though it should have been
No, it should not have been. In neither R nor S does - offset remove an
offset term. For specials, - is equivalent to +.
> glm(y ~ offset(x) + z - offset(x), data=df)
Call: glm(formula = y ~ offset(x) + z - offset(x), data = df)
Coefficients:
(Intercept) z
-1.3660 0.1610
is the same as fit1.
--
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-devel
mailing list