Skip to content

predict.glm(..., type="response") loses names (was RE: [R] A sugg estion for predict function(s))

2 messages · Liaw, Andy, Brian Ripley

#
[You'd want names() rather than row.names(), since predict() 
in this case returns a vector.]
 
I don't know if this is intended (and if it is, I don't 
understand why):  the names are missing only for 
type="response".  For the other types, the names are 
there.  The problem seems to be the order of arguments
in pmin() inside make.link():

            eta <- pmin(thresh, pmax(eta, -thresh))

which should probably be:

            eta <- pmin(pmax(eta, -thresh), thresh)

This is because pmin/pmax preserve the names of it's first 
argument, not the second.

There are quite a few other places in make.link() like
this.  Question to R Core:  Would such fixes be considered
`trivial' enough to make it into R-2.1.0?

Andy
#
On Wed, 13 Apr 2005, Liaw, Andy wrote:
[...]
No.

This sort of thing could affect packages, and at this point in code freeze 
we are only going to change things which are tightly confined (changing 
endianness in complex vectors in writeBin is one example) or show-stoppers 
(so if for example a new compiler were released and no longer compiled R, 
which has happened in code freeze before).

There will be 2.1.0-patched and no doubt 2.1.1 will be along in 1-2 
months.  Right now (during code freeze) is the least helpful time to make 
suggestions because we do not have any open branch to work on.  (Other 
projects do this differently: I have in the past suggested branching at 
code freeze and releasing from the branch.  But the reason for the exact 
release date is that our release manager is busy until then.)

Please file a report and proposed changes with R-bugs so it does not get 
overlooked.