# Re: R-alpha: glm and substitute bugs

Thomas Lumley (thomas@biostat.washington.edu)
Tue, 14 Jan 1997 18:32:05 -0800 (PST)

```Date: Tue, 14 Jan 1997 18:32:05 -0800 (PST)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: r-testers <r-testers@stat.math.ethz.ch>
Subject: Re: R-alpha: glm and substitute bugs

On Mon, 13 Jan 1997, Jim Lindsey wrote:

> 1. Kurt Hornik has asked me to look at a  data set where glm with
> binomial gives all zero coefficients and S-Plus does not. It turns out
> that R gives all zero coefficients (except the intercept) for all
> binomial data sets!

I'm not getting this problem:

shuksan% uname -a
SunOS shuksan 5.5.1 Generic_103640-03 sun4m sparc SUNW,SPARCstation-20
shuksan% ~/R15
R : Copyright 1996, Robert Gentleman and Ross Ihaka
Version 0.15  (Released: December 25, 1996)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.

R> y<-rep(0:1,20)
R> x<-rnorm(40)
R> glm(y~x,family=binomial())

Call:  glm(y ~ x, family = binomial())

Coefficients:
(Intercept)            x
0.0284       0.2861

Degrees of Freedom: 40 Total; 38 Residual
Null Deviance: 55.45
Residual Deviance: 54.88

> 2. While tracing that problem down, I discovered that Ross's changes
> to glm have introduced a new error. He has incorrectly changed the
> initial values of eta so that IWLS no longer always converges (and
> usually more slowly). Here is an example that does not converge with
> the new initial estimates, giving completely wild values, but does
> converge correctly with the old:
>
> y <- c(3,5,4,3,11,20,31,40,43,48,48,50)
> glm(y~1,family=poisson)

Or this problem:
R> y <- c(3,5,4,3,11,20,31,40,43,48,48,50)
R> glm(y~1,family=poisson)

Call:  glm(y ~ 1, family = poisson)

Coefficients:
(Intercept)
3.2387

R> log(mean(y))
[1] 3.238678

Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
```