[R] Fixed zeros in tables

David Duffy David.Duffy at qimr.edu.au
Tue Nov 28 03:27:17 CET 2006


"A.R. Criswell" <rstatistics at gmail.com> wrote:

> Hello Andrew Robinson and R-List
> 
> Thanks, Andrew, but this does not work. Puttting zero weights on
> structural zeros, one's elsewhere in glm() does not deliver the
> appropriate expected cell counts loglm() provides as one would expect.
> 
> If you run the code provided below, you'll see loglm() delivers zero
> cell counts with loglm() but using glm() with the weights you suggest,
> the expected cell counts are not zero.
> 
> Still hoping for a resolution.
> Andrew Criswell
> 
> Associate Professor
> Hedmark University
> Postboks 104, Rena 2510, NORWAY

If they are structural zeros, I believe you want:

  glm(COUNT ~  CONCERNS + AGE + GENDER, data=health, subset=(WEIGHTS>0),
      family=poisson)

David Duffy.

-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v



More information about the R-help mailing list