[R] problem with extractAIC()
ligges at statistik.tu-dortmund.de
Sat Mar 6 19:37:05 CET 2010
On 06.03.2010 15:58, Jordi Moya wrote:
> Dear friends,
> If I use:
> model<-lm(y ~ x)
> and then extractAIC(model), the value that I obtain does not match (not even
> However, using AIC from the AICcmodavg(), the value matches exactly the
> above value.
> I read the help of extractAIC() and could not figure out what was wrong,
> other than what I call k (number of parameters) is edf in the help and k
> they use for the value 2 that multiplies my k, their edf, and which is
> implemeted as the default, thus not possibly being the cause of the
> Does anybody know whether am I missing something or whether there may be a
> bug in extractAIC()?
?extractAIC tells you
For linear models with unknown scale (i.e., for lm and aov), -2\log L is
computed from the deviance and uses a different additive constant to
logLik and hence AIC.
Hence you want to compare your formula above with
To compare the code type
and compare the logLik related devianbce part of it with the
as used in AIC().
> Best wishes,
> Jordi Moya-LaraÃ±o
> Cantabrian Institute of Biodiversity (ICAB)
> Dpto. BiologÃa de Organismos y Sistemas
> Universidad de Oviedo
> CatedrÃ¡tico Rodrigo UrÃa s/n
> 1. http://www.uniovi.es/icab/jordi.html
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help