[R] Newbie Poisson regression question

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun May 16 22:18:34 CEST 2004


adelmaas at musc.edu writes:

> Greetings.
> 
> I'm getting started learning R, and I'm trying to reproduce some
> models I've done previously in SAS.  I'm trying to fit simple Poisson
> regressions, and I keep getting impossible results:  the models
> predict negative numbers of cases for many observations.  The code for
> the models are:
> 
> Female.model <- glm(Observed ~ Black + Other, family =
> poisson(link=log), offset=log(PYAR), data=Females)
> 
> and
> 
> Male.model <- glm(Observed ~ Black + Other +
> poly(Minus.log.proportion.moved,3), family = poisson(link=log),
> offset=log(PYAR), data=Males)
> 
> where Observed is the number of cases of childhood ALL in a
> race-gender stratum of a county, Black and Other are Boolean variables
> what race a race-gender stratum of a county belongs to,
> Minus.log.proportion.moved is -log(proportion in county who moved
> between 1985 and 1990), PYAR is person-years at risk for a race-gender
> stratum of a county, and Females and Males are the data sets for
> females and males respectively.  As far as I can tell, this is set up
> the same way as examples of Poisson regressions in R I've found on the
> Net.  I've checked, and my data seems to be read in properly (code not
> shown).  Can anyone tell me if there's anything obviously wrong I've
> missed?  Thanks in advance for any help anyone can provide.

You're not telling us what the perceived problem is. What exactly
makes you think that the models are predicting negative numbers of
cases? Are you using predict() (and if so, on what scale) or what?

        -p

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list