[Rd] quick question about glm() example

Ben Bolker bbolker at gmail.com
Wed May 29 19:58:03 CEST 2013


  I don't have a copy of Dobson (1990) from which the glm.D93 example is
taken in example("glm"), but I'm strongly suspecting that these are
made-up data rather than real data; the means of the responses within
each treatment are _identical_ (equal to 16 2/3), so two of the
parameters are estimated as being zero (within machine tolerance).  (At
this moment I don't understand why the means rather than the geometric
means being identical is what matters ...)

  This therefore feels like a somewhat strange (i.e. non-generic)
example to use (although I know it's been that way for a long time).

  Perhaps more importantly, the example illustrates the use of glm()
without a data= argument, which I think should not generally be
encouraged.  I would prefer to see the example written as:

d.AD <- data.frame(
 counts=c(18,17,15,20,10,20,25,13,12),
 outcome=gl(3,1,9),
 treatment=gl(3,3))

print(d.AD)

 glm.D93 <- glm(counts ~ outcome + treatment, family = poisson(),
       data=d.AD)

  Thoughts?

  Ben Bolker



More information about the R-devel mailing list