R-beta: glm bug

Jim Lindsey (jlindsey@luc.ac.be)
Mon, 5 Jan 1998 12:25:05 +0100 (MET)

From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9801051125.AA32077@alpha.luc.ac.be>
Subject: R-beta: glm bug
To: r-help@stat.math.ethz.ch (r-help)
Date: Mon, 5 Jan 1998 12:25:05 +0100 (MET)

glm with binomial does not work when a binomial denominator is zero.
One possibility is to set the value to NA and use na.action=na.remove.

  However, family can easily be fixed to work like GLIM4 (which is
different than GLIM3.77): In the file, family, in the function
binomial(), after line 204,
	y <- y[,1]/n
add the following line to remove the NAs created by division by 0:
	y <- ifelse(is.na(y),0,y)
Because the weight is n, these values are eliminated anyway.
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