Re: R-beta: glm bugs

Ross Ihaka (
Wed, 17 Dec 1997 13:19:10 +1300 (NZDT)

Date: Wed, 17 Dec 1997 13:19:10 +1300 (NZDT)
Message-Id: <>
From: Ross Ihaka <>
To: Peter Dalgaard BSA <>
Subject: Re: R-beta: glm bugs
In-Reply-To: <>

Peter Dalgaard writes:
 > Jim Lindsey <> writes:
 > > Potential users of the glm function in R0.60 should be aware that a
 > > number of the bug fixes for glm in R0.50 (offsets, aliases, ...) that I
 > > sent on the list have not been implemented in R0.60. If they want to
 > > have (more) correct answers with glm, they should consult the archives
 > > of the list and make the appropriate corrections.
 > >   Jim

 > The glaring bug is in this line in glm():
 >        offset <- model.offset(mf)
 > .. which overrides the optional argument whether or not an offset()
 > term is present in the model formula. Easily fixed, but which offset
 > should take precedence if both are specified?

I have changed this to

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

so (for the moment at least) an explicit argument to glm will take
precedence.  Thomas had an idea that multiple offsets should just be
added together.  So we could also try something like

	if(is.null(offset)) offset <- model.offset(mf)
	else {
		offset2 <- model.offset(mf)
			offset <- offset+offset2

r-help mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: