[R] GLM function with poisson distribution

Göran Broström gb at tal.stat.umu.se
Wed Jan 26 14:23:28 CET 2005


On Wed, Jan 26, 2005 at 02:03:25PM +0100, Peter Dalgaard wrote:
> Göran Broström <gb at tal.stat.umu.se> writes:
> 
> > On Wed, Jan 26, 2005 at 11:01:03AM +0100, Peter Dalgaard wrote:
> > > Göran Broström <gb at tal.stat.umu.se> writes:
> > > 
> > > > > Try it with
> > > > > 
> > > > > b=c(rep(0,8),rmultinom(1,24,rep(1/8,8))) 
> > > > 
> > > > This is the conditional distribution, given the sufficient statistic.
> > > 
> > > Yes (and that was of course the point). I was surprised that there is
> > > a difference at all (between this and rep(3,8) and also between
> > > different calls to rmultinom). 
> > 
> > That surprises me :-) Really, if the observed values are exactly equal to
> > the predicted values or not must make a difference?
> 
> To the deviance, yes. It is less obvious why the table of coefficients
> comes out different, given that everything inside of it is a function
> of the same sufficient statistics. The reason is the termination
> criterion in glm.fit, which is on the relative change in deviance,
> 
> (I'm not too happy about that in principle. 

I had the same thought. Would it be possible to automatically reduce to
sufficient statistics inside glm, and would it be desirable? Should I, as a
user, reduce to sufficient statistics before running glm? It shouldn't
really matter, but I get different deviances and AIC, and that can be
confusing. Note that this is the case also in situations where the fitting 
algorithm converges nicely.

-- 
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umeå University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se




More information about the R-help mailing list