From bbolker at gmail.com  Wed May 29 19:58:03 2013
From: bbolker at gmail.com (Ben Bolker)
Date: Wed, 29 May 2013 13:58:03 -0400
Subject: [Rd] quick question about glm() example
Message-ID: <51A641AB.1020404@gmail.com>


  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



[Rd] quick question about glm() example
Ben Bolker