R-beta: offset

Jim Lindsey (jlindsey@luc.ac.be)
Tue, 2 Dec 1997 09:17:32 +0100 (MET)


From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9712020817.AA17524@alpha.luc.ac.be>
Subject: R-beta: offset
To: r-help@stat.math.ethz.ch (r-help)
Date: Tue, 2 Dec 1997 09:17:32 +0100 (MET)

Sometime ago Thomas Lumley posted a fix for offset after an inquiry.
That correction is necessary but not sufficient. Here are sufficient
corrections for the two methods of offset to work:
1. in the form  glm(y~x+offset(z))
as Thomas said, in model.offset (file models, l.179)
change
offsets <- attr(x,"terms")$offset
to
offsets <- attr(attr(x,"terms"),"offset")
but also in model.matrix (file models, ll.194-5)
remove these two lines:
if(!is.null(offset))
	nn[offset] <- "(offset)"
2. in the form glm(y~x,offset=z)
in glm (file glm, l.34)
change
offset <- model.offset(mf)
to
if(is.null(offset))offset <- model.offset(mf)

Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._