[Rd] glm(...,quasi(link="logit")) problem?

Simon Wood sw283 at maths.bath.ac.uk
Wed Jul 25 21:10:18 CEST 2007


There may be a good reason for this, but under R 2.5.1 (Windows XP, Suse 
Linux)

> glm(c(0,.5)~1,quasi(link=logit))
Error: NA/NaN/Inf in foreign function call (arg 4)

whereas the same code works under R 2.1.1.

The problem (in 2.5.1) is a -Inf in the pseudodata `z' in glm.fit, as a 
result of a `-Inf' in eta, which is in turn generated by `mustart <- y' and 
`logit(mustart)'. In 2.1.1 the line `mustart <- y + 0.1 * (y == 0)' is 
what avoids the problem.

A possible fix might be to set elements of `good' to FALSE for non-finite 
`eta', for the first fit iteration only, of course. Is it worth fixing? I 
found this after  someone reported a problem with mgcv::gamm (which 
calls MASS:glmmPQL which calls glm), which is why I'm not just supplying 
my own mustart and getting on with it...

best,
Simon


>- Simon Wood, Mathematical Sciences, University of Bath, Bath BA2 7AY
>-             +44 (0)1225 386603         www.maths.bath.ac.uk/~sw283/



More information about the R-devel mailing list