jfox@mcmaster.ca
2003-Apr-14 13:59 UTC
[Rd] suggested changes to summary.glm and summary.lm (PR#2776)
Something for the wish list (not really a bug): I was reminded of what I see as a problem with summary.glm last week when some of my students fell into a trap in a homework exercise, defining a logit model in which coefficients were aliased. When this happens in lm, summary.lm prints a message ["Coefficients: (1 not defined because of singularities)"], but summary.glm is silent. In both instances, the print methods show aliased coefficients as NA. At minimum, I think that it would be desirable for summary.glm to indicate that there's a problem. In addition, I would prefer that both summary.glm and summary.lm include aliased coefficients (as NA) in the table of coefficients. Thanks for your consideration, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox@mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox -----------------------------------------------------
Prof Brian Ripley
2003-Apr-28 14:29 UTC
[Rd] suggested changes to summary.glm and summary.lm (PR#2776)
This is a little tricky, and the issue is with the print methods, not the return values I believe. I don't think we want to alter summary.lm nor summary.glm, which in neither S nor R include aliased coefficients in the coef component (nor the covariance nor correlation components). However, S's print.summary.glm does expand the coef and correl matrices to include NAs (which I noticed after starting a similar strategy). However, print.coefmat prints NAs as empty strings, so my current version shows the aliased coefficients as a blank row and not via NAs. Anyone know why print.coefmat suppresses NAs? I am about to commit a version of the print methods that - warns of undefined coefficients - shows them in the coef dispay as NAs - omits them from the correlation matrix. On Mon, 14 Apr 2003 jfox@mcmaster.ca wrote:> Something for the wish list (not really a bug): > > I was reminded of what I see as a problem with summary.glm last week when > some of my students fell into a trap in a homework exercise, defining a > logit model in which coefficients were aliased. When this happens in lm, > summary.lm prints a message ["Coefficients: (1 not defined because of > singularities)"], but summary.glm is silent. In both instances, the print > methods show aliased coefficients as NA. > > At minimum, I think that it would be desirable for summary.glm to indicate > that there's a problem. In addition, I would prefer that both summary.glm > and summary.lm include aliased coefficients (as NA) in the table of > coefficients.-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595