R-alpha: glm

Jim Lindsey jlindsey@luc.ac.be
Wed, 12 Nov 1997 09:58:18 +0100 (MET)


Here is another bug in glm. Occasionally, with log linear models for
small tables, there can be more parameters (many aliased) than cells
in the table. Then, glm does not work. The problem is in the qr
decomposition. Here is a quick hack that works, although not very
elegant.
  In glm.fit, replace l. 254

Rmat <- fit$qr[1:nvars, 1:nvars]

by

Rmat <- diag(nvars)
nr <- min(sum(good),nvars)
Rmat[1:nr,1:nvars] <- fit$qr[1:nr,1:nvars]

  Jim
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-devel 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-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=