Skip to content

glm.nb, anova.negbin

2 messages · juli g. pausas, Ben Bolker

#
Prof Brian Ripley escribi?:
OK, sorry for asking too much. I just thought maybe I was also helping the developers
in locating a bug.

I'm a basic user of R, and I don't really know what's a patch and how to generate a
patch. So please apologise if I don't report  the patch to you.
I've been able to skip the first bug by masking the function "print.summary.negbin" of
MASS with the same fuction (and the same name) but with the modifications you suggested
me (moving brakets). Sure it's not the best way but it works. Don't know yet how to
solve the second one.
Thanks

juli
--
Juli G. Pausas   (Mr)
Centro de Estudios Ambientales del Mediterraneo (CEAM)
C/ C.R. Darwin 14, Parc Tecnologic,
46980 Paterna, Valencia, SPAIN
Tel: (+ 34) 96 131 8227; Fax: (+ 34) 96 131 8190
mailto:juli at ceam.es
http://www.gva.es/ceam

GCTE Fire Network - http://www.gva.es/ceam/FireNetwork


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 26 Sep 2001, juli g. pausas wrote:

            
A "patch" would be a change in the underlying R code that fixed the
problem.
  The best thing for helping to solve the second problem (if you're not up
to digging in and debugging it yourself) would be to provide a simple
example that replicates the bug, that people can run themselves.  This can
be hard if the error only occurs with particular (large) datasets, or in
the middle of a complicated analysis, but in this case I think it's not
too bad:

library(MASS)
tax <- rnbinom(10,mu=1,size=1)
areal <- runif(10)
tanual <- runif(10)
t <- glm.nb(tax ~ areal)  ## ignore warning messages about convergence
t2 <- update(t, .~ .+tanual) ## ditto
anova(t,t2)  ## OK
anova(t)  ## OK
anova(t2)

This replicates the error on my system (1.3.1, i686-pc-linux-gnu).

After getting the error, run

traceback()

to see where the error is coming from -- then

debug(anova.glm)

to step through the code one line at a time

The procedure crashes because method is NULL and nvars==1 when we hit the
following code in anova.glm():

    if (nvars > 1) {
       method <- object$method
       if (!is.function(method))
           method <- get(method, mode = "function")
   ...

 I don't have time to trace the problem further right now -- I don't blame
you for not being able to debug this, though, it does get into the middle
of some pretty hairy R code ...

  Ben Bolker





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