[Rd] Inconsistency in AIC values for glm with family poisson (PR#8841)

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon May 8 12:51:20 CEST 2006

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Mon, 8 May 2006, x.sole at iconcologia.net wrote:

> Full_Name: Xavier Solé
> Version: 2.3.0
> OS: Windows XP SP2
> Submission from: (NULL) (
> #When computing AIC for one of the models shown in ?glm we get an 
> inconsistent AIC value. We also get the same wrong value if we use 
> "extractAIC" o "AIC" functions.

Inconsistent with what?  It seems to me that it consistently gives the 
right answer, but you have not used the actual definition of AIC.

> example(glm)
> glm.D93
> extractAIC(glm.D93)
> #AIC of this model should be 15.129 (residual deviance + 2*effective 
> degrees of freedom), but the AIC which R returns is 56.76. Function 
> extractAIC returns the right number of effective degrees of freedom (5), 
> but anyway seems to fail in calculating the correct AIC value.

Where do you get that from (it is not the definition of AIC)?

> AIC(glm.D93)
[1] 56.76132
> extractAIC(glm.D93)
[1]  5.00000 56.76132
> logLik(glm.D93)
'log Lik.' -23.38066 (df=5)

Did you read ?AIC, which gives the actual definition?  You may also need 
to review the definitions (note, plural) of `deviance'.

Please don't expect us to accept your assertions for definitions 
of statistical quantities: you need to supply your credentials and 
references.  In this case the help page actually points out that the 
quantity is not unambiguously defined.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list