R-beta: anova.glm is broken with offsets

Mike Meyer mikem at stat.cmu.edu
Wed Jun 3 16:14:04 CEST 1998


I have *not* tracked this bug very far because I hope someone who is more 
familiar with the glm/anova code will jump in.

If one fits a glm model with an offset, the NULL deviance is incorrectly 
calculated (it is calculated without the offset).  The means one can get 
examples where the model deviance is greater than the NULL deviance.

Here is some example output, (without the data).


> mymod <-glm(cens ~ group, family=poisson,offset=log(time))
> anova(mymod)

Analysis of Deviance Table

Model: poisson, link: log

Response: cens

Terms added sequentially (first to last)

       Df  Deviance  Resid. Df  Resid. Dev
NULL                        41       20.19
group   1    -17.83         40       38.02

> 
Mike Meyer, Department of Statistics, Carnegie Mellon University


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list