[R] MASS glm.nb: Offset fails

Prof Brian D Ripley ripley at stats.ox.ac.uk
Sat Jan 8 15:51:38 CET 2000


On Sat, 8 Jan 2000, Jari Oksanen wrote:

> I came to R from GLIM and its glm. My data sets (ecological community data) 
> are severely over-dispersed, and so I was delighted to find out that the MASS 
> library has glm.nb which is an advancement from the GLIM macros I had used 
> (N.E.Breslow, Applied Statistics 33, 38--44; 1984). However, I need to use 
> offset, but that failed.
> 
> I am not (yet --- hopefully) fluent enough in R to be able to debug the code, 
> but it seems that the problem comes in expanding `...' in the glm.nb call. The 
> first time this goes smoothly:
> 
>   Call <- match.call()
> 
> expands to (formula = TFLO ~ poly(PH, 2), offset = log(TOT)) which was my 
> exact call. However, the second time fails:

Can you please tell us exactly what you did (the precise call)? The correct
formula would have been

TFLO ~ poly(PH, 2) +  offset(log(TOT))

(V&R3, p. 217-8).


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