[R] glm: offset in poisson

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 16 14:16:52 CET 2000


> To: r-help at stat.math.ethz.ch
> From: "Juli G. Pausas" <juli at ceam.es>
> Subject: [R] glm: offset in poisson
> Date: Thu, 16 Mar 0 12:52:49 +0000 (GMT)
> X-Info: Mail Test Period
> 
> R-users,
> 
> Can an offset term be included in a Poisson model? 
> I get an error message when trying that:
> 
> >r3o <- glm(tax ~ areal + offset(o), family=poisson)
> Error in (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y,  : 
>         inner loop 1; can't correct step size
> In addition: Warning message: 
> Step size truncated due to divergence in: (if (is.empty.model(mt))
> glm.fit.null else glm.fit)(x = X, y = Y,  
> 
> (this error message doesn't appear with family= gaussian)
> 

Certainly, but the offset is on the scale of the log mean for the 
Poisson, and the mean for the Gaussian, so I suspect you may have completely
inappropriate values of the offset.  Here's an example from the 
V&R3 on-line exercises (and answers):

library(MASS)
data(Insurance)
glm(Claims ~ District*Group*Age - District:Group:Age
         + offset(log(Holders)), data=Insurance, family=poisson)

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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