From ripley@stats.ox.ac.uk  Fri Dec 29 11:38:36 2000
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Fri, 29 Dec 2000 12:38:36 +0100 (MET)
Subject: [Rd] aic in binomial models is often wrong (PR#796)
Message-ID: <200012291138.MAA01699@pubhealth.ku.dk>

The following two models are the same:

data(esoph)
glm(cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp, 
    data = esoph, family = binomial())
...
Degrees of Freedom: 87 Total (i.e. Null);  67 Residual
Null Deviance:      227.2 
Residual Deviance: 47.48        AIC: 237 

glm(ncases/(ncases+ncontrols) ~ agegp + tobgp * alcgp, 
    data = esoph, family = binomial(), weights=ncases+ncontrols)
...
Degrees of Freedom: 87 Total (i.e. Null);  67 Residual
Null Deviance:      227.2 
Residual Deviance: 47.48        AIC: 934.4 

The second AIC value is wrong: fixed in R-patched now.

You may think you only ever use the first form, but internally
R uses the second quite a bit.

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] aic in binomial models is often wrong (PR#796)
ripley@stats.ox.ac.uk