Re: R-beta: glm bugs

Ross Ihaka (ihaka@stat.auckland.ac.nz)
Wed, 17 Dec 1997 13:19:10 +1300 (NZDT)


Date: Wed, 17 Dec 1997 13:19:10 +1300 (NZDT)
Message-Id: <199712170019.NAA12189@stat1.stat.auckland.ac.nz>
From: Ross Ihaka <ihaka@stat.auckland.ac.nz>
To: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Subject: Re: R-beta: glm bugs
In-Reply-To: <x267oouada.fsf@blueberry.kubism.ku.dk>
	<x267oouada.fsf@blueberry.kubism.ku.dk>

Peter Dalgaard writes:
 > Jim Lindsey <jlindsey@luc.ac.be> 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)
		if(!is.null(offset2))
			offset <- offset+offset2
	}

Ross
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._