From ripley at stats.ox.ac.uk  Thu Mar 18 11:47:01 2004
From: ripley at stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Thu Mar 18 11:47:08 2004
Subject: [Rd] update forgets about offset() (PR#6656)
Message-ID: <20040318104701.550E610428@slim.kubism.ku.dk>




On Mon, 15 Mar 2004 Mark.Bravington@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@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


[Rd] update forgets about offset() (PR#6656)
ripley@stats.ox.ac.uk