Re: [R] glm() problem

From: svante <svante_at_math.aau.dk>
Date: Sat 07 Apr 2007 - 21:46:12 GMT

Thanks Christian,

Now I get a more informative trace:
glm(n~.,data=mDat,family=poisson,control = glm.control(trace = TRUE))

Deviance = 23.48435924 Iterations - 1
Deviance = 22.23499386 Iterations - 2
Deviance = 22.21320309 Iterations - 3
Deviance = 22.20690862 Iterations - 4
Deviance = 22.20459309 Iterations - 5
Deviance = 22.20374125 Iterations - 6
Deviance = 22.20342787 Iterations - 7
Deviance = 22.20331259 Iterations - 8
Deviance = 22.20327018 Iterations - 9
Deviance = 22.20325458 Iterations - 10
Deviance = 22.20324884 Iterations - 11
Deviance = 22.20324673 Iterations - 12
Deviance = 22.20324595 Iterations - 13
Deviance = 22.20324566 Iterations - 14
Deviance = 22.4735046 Iterations - 15
Deviance = Inf Iterations - 16

Step halved: new deviance = 4.154792321e+266 Error: NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message:
step size truncated due to divergence

Actually, the expected counts can be fitted by a quotient between marginal counts,
and my alternative calculation of the deviance yields 22.20324550.

I guess, that I just have to accept that glm() is not garanteed to converge.

best,
svante

Christian Ritz wrote:

> Hi,
>
> try using the function 'glm.control' in the first place:
>
>
> glm(n~., data = mDat, family = poisson,
> control = glm.control(trace = TRUE))
>
>
>
> Christian
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Apr 08 07:50:54 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 07 Apr 2007 - 23:31:17 GMT.

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