[R] update/offset

Simon.Bond Simon.Bond at mrc-bsu.cam.ac.uk
Fri Mar 26 13:12:11 CET 2004


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.


Any suggestions (apart from redefine the new model from scratch) ?

Thanks

Simon Bond.




More information about the R-help mailing list