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

From: Simon Wood <sw283_at_maths.bath.ac.uk>
Date: Wed, 25 Jul 2007 20:10:18 +0100 (BST)

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/



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 25 Jul 2007 - 22:10:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jul 2007 - 23:38:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.