[Rd] aic in binomial models is often wrong (PR#796)
ripley@stats.ox.ac.uk
ripley@stats.ox.ac.uk
Fri, 29 Dec 2000 12:38:36 +0100 (MET)
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._