R-beta: alias in glm

Jim Lindsey (jlindsey@luc.ac.be)
Mon, 3 Nov 1997 08:45:52 +0100 (MET)

From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9711030745.AA26261@alpha.luc.ac.be>
Subject: R-beta: alias in glm
To: r-help@stat.math.ethz.ch
Date: Mon, 3 Nov 1997 08:45:52 +0100 (MET)

There is an error in glm when aliased or colinear variables are
introduced so that the matrix is singular. The variable names do not
correspond to the coefficients estimated. This is because the variable
names are updated at every iteration instead of only once. The
following four lines in glm.fit
if(fit$rank != nvars){
(plus the comment lines) should be moved down outside the iteration
loop, that is just before
This procedure moves the aliased parameters to the end of the list and
leaves them with zero estimates. This is not compatible with lm which
leaves them in place but gives them NAs. I prefer the glm solution.
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