[R] glm() problem

svante svante at math.aau.dk
Sat Apr 7 23:46:12 CEST 2007


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
>



More information about the R-help mailing list