R-beta: glm bugs

Ross Ihaka ihaka at stat.auckland.ac.nz
Wed Dec 17 01:19:10 CET 1997


Peter Dalgaard writes:
 > Jim Lindsey <jlindsey at 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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list