[R] glm.nb, anova.negbin

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Sep 26 15:30:51 CEST 2001

On Wed, 26 Sep 2001, Jari Oksanen wrote:

> juli at ceam.es said:
> > > Error in get(x, envir, mode, inherits) : invalid first argument
> > > In addition: Warning message:
> > > tests made without re-estimating theta in: anova.negbin(t2) >
> I looked quickly, and it seems that this error comes actually from
> `anova.glm'  and from the following `get':
>         if (!is.function(method))
>             method <- get(method, mode = "function")
> `anova.negbin' sends the  `negbin' `object' to `anova.glm', but the
> negbin object does not have a method (`glm' objects have method
> "glm.fit"). There seem to be some other differences in `negbin' and
> `glm' objects, so that `anova.glm' can't handle them (e.g., glm.control
> object is missing in `negbin' object).
> I would like to help, but I don't have time now (got to mark exams).

Yes, that's it: R is incompatible with S.  Although the information
is in the saved call, R uses a duplicate copy.  In glm.nb() adding
    fit$method <- method
    fit$control <- control
at the end seems to fix it, but without an example I can reproduce,
I cannot of course be sure.

And that was my main point: if reporting problems *please* report the
results of traceback(), and if possible a small reproducible example.

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