R-beta: offset and glm again

Thomas Lumley thomas at biostat.washington.edu
Wed Jun 3 22:12:46 CEST 1998


On Wed, 3 Jun 1998, Mike Meyer wrote:

> I guess I understand it now (although it is surprising to me).
> 
> The following is a valid model formula
> 	fred ~ wilma + offset(barney)
> that sets the model offset to barney.
> 
> Given that this works, it would seem that one could remove the 
> 	offset =
> argument from the glm call (and document the offset feature somewhere).
>

It will be documented in 0.62 (as will dozens of other functions)

> Too bad that one can't set weights the same way.
> 
> The anova bug when offsets are used is still there.
> 
> (Thomas, you seem to be the last to hack on glm, have I got it right?)
> 

Yes.  In fact offsets should be interpreted in the data frame even when
supplied as offset=.  This is an easy fix -- just change

        if (is.null(offset)) 
                offset <- model.offset(mf)

to
	offset<-model.offset(mf)


The offset argument shouldn't ever be interpreted as is, it should always
be obtained from the model frame. This is left over from before
model.frame() worked. 

Fixing the null deviance will take more work.

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list